|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 """ |
|
4 Module implementing a dialog to enter the icon size. |
|
5 """ |
|
6 |
|
7 from PyQt4.QtGui import QDialog |
|
8 from PyQt4.QtCore import pyqtSlot |
|
9 |
|
10 from Ui_IconSizeDialog import Ui_IconSizeDialog |
|
11 |
|
12 class IconSizeDialog(QDialog, Ui_IconSizeDialog): |
|
13 """ |
|
14 Class implementing a dialog to enter the icon size. |
|
15 """ |
|
16 def __init__(self, width, height, parent = None): |
|
17 """ |
|
18 Constructor |
|
19 |
|
20 @param width width to be set (integer) |
|
21 @param height height to be set (integer) |
|
22 @param parent reference to the parent widget (QWidget) |
|
23 """ |
|
24 QDialog.__init__(self, parent) |
|
25 self.setupUi(self) |
|
26 |
|
27 self.widthSpin.setValue(width) |
|
28 self.heightSpin.setValue(height) |
|
29 |
|
30 self.widthSpin.selectAll() |
|
31 |
|
32 def getData(self): |
|
33 """ |
|
34 Public method to get the entered data. |
|
35 |
|
36 @return tuple with width and height (tuple of two integers) |
|
37 """ |
|
38 return self.widthSpin.value(), self.heightSpin.value() |