~ubuntu-branches/debian/wheezy/agtl/wheezy

« back to all changes in this revision

Viewing changes to files/advancedcaching/qt/showimagedialog.py

  • Committer: Bazaar Package Importer
  • Author(s): Heiko Stuebner
  • Date: 2011-01-22 13:55:12 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110122135512-1mik0vssgpnx2fgu
Tags: 0.8.0.3-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
 
 
4
#   Copyright (C) 2010 Daniel Fett
 
5
#   This program is free software: you can redistribute it and/or modify
 
6
#   it under the terms of the GNU General Public License as published by
 
7
#   the Free Software Foundation, either version 3 of the License, or
 
8
#   (at your option) any later version.
 
9
#
 
10
#   This program is distributed in the hope that it will be useful,
 
11
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#   GNU General Public License for more details.
 
14
#
 
15
#   You should have received a copy of the GNU General Public License
 
16
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
#
 
18
#   Author: Daniel Fett agtl@danielfett.de
 
19
#   Jabber: fett.daniel@jaber.ccc.de
 
20
#   Bugtracker and GIT Repository: http://github.com/webhamster/advancedcaching
 
21
#
 
22
 
 
23
import logging
 
24
 
 
25
from PyQt4.QtCore import *
 
26
from PyQt4.QtGui import *
 
27
from ui_showimagedialog import Ui_ShowImageDialog
 
28
logger = logging.getLogger('qtshowimagedialog')
 
29
 
 
30
class QtShowImageDialog(Ui_ShowImageDialog, QDialog):
 
31
 
 
32
    def __init__(self, parent=None):
 
33
        QDialog.__init__(self, parent)
 
34
        self.setupUi(self)
 
35
        self.size_hint = QSize(10, 10)
 
36
 
 
37
    def show_image(self, pixmap):
 
38
        self.labelImage.setPixmap(pixmap)
 
39
        self.size_hint = pixmap.size()
 
40
        self.labelImage.adjustSize()
 
41
        self.scrollAreaWidgetContents.adjustSize()
 
42
        self.scrollArea.adjustSize()
 
43
        self.adjustSize()
 
44
 
 
45
    def sizeHint(self):
 
46
        return self.size_hint
 
47