eric6/IconEditor/IconSizeDialog.py

changeset 6942
2602857055c5
parent 6645
ad476851d7e0
child 7229
53054eb5b15a
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2009 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to enter the icon size.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWidgets import QDialog
13
14 from .Ui_IconSizeDialog import Ui_IconSizeDialog
15
16
17 class IconSizeDialog(QDialog, Ui_IconSizeDialog):
18 """
19 Class implementing a dialog to enter the icon size.
20 """
21 def __init__(self, width, height, parent=None):
22 """
23 Constructor
24
25 @param width width to be set (integer)
26 @param height height to be set (integer)
27 @param parent reference to the parent widget (QWidget)
28 """
29 super(IconSizeDialog, self).__init__(parent)
30 self.setupUi(self)
31
32 self.widthSpin.setValue(width)
33 self.heightSpin.setValue(height)
34
35 self.widthSpin.selectAll()
36
37 msh = self.minimumSizeHint()
38 self.resize(max(self.width(), msh.width()), msh.height())
39
40 def getData(self):
41 """
42 Public method to get the entered data.
43
44 @return tuple with width and height (tuple of two integers)
45 """
46 return self.widthSpin.value(), self.heightSpin.value()

eric ide

mercurial