IconEditor/IconZoomDialog.py

Sun, 29 Jul 2012 18:12:50 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 29 Jul 2012 18:12:50 +0200
branch
5_2_x
changeset 1966
6e8945315cbc
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
permissions
-rw-r--r--

Fixed a PEP-8 related issue.

# -*- coding: utf-8 -*-

# Copyright (c) 2009 - 2012 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to select the zoom factor.
"""

from PyQt4.QtGui import QDialog

from .Ui_IconZoomDialog import Ui_IconZoomDialog


class IconZoomDialog(QDialog, Ui_IconZoomDialog):
    """
    Class implementing a dialog to select the zoom factor.
    """
    def __init__(self, zoom, parent=None):
        """
        Constructor
        
        @param zoom zoom factor to show in the spinbox
        @param parent parent widget of this dialog (QWidget)
        """
        super().__init__(parent)
        self.setupUi(self)
        
        self.zoomSpinBox.setValue(zoom * 100)
        self.zoomSpinBox.selectAll()
        
    def getZoomFactor(self):
        """
        Public method to retrieve the zoom factor.
        
        @return zoom factor (int)
        """
        return self.zoomSpinBox.value() // 100

eric ide

mercurial