Sat, 05 Dec 2015 16:06:05 +0100
Prepared first stable release of eric 6.1.
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
4021
195a471c327b
Updated copyright for 2015.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3670
diff
changeset
|
3 | # Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
7 | Module implementing combobox classes using the eric6 line edits. |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
3145
a9de05d4a22f
# __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
3057
diff
changeset
|
10 | from __future__ import unicode_literals |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2401
diff
changeset
|
11 | |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
12 | from PyQt5.QtWidgets import QComboBox |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | class E5ComboBox(QComboBox): |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | """ |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
17 | Class implementing a combobox using the eric6 line edit. |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | """ |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | def __init__(self, parent=None, inactiveText=""): |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | """ |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | Constructor |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | @param parent reference to the parent widget (QWidget) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | @param inactiveText text to be shown on inactivity (string) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | """ |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2401
diff
changeset
|
26 | super(E5ComboBox, self).__init__(parent) |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | self.setMinimumHeight(24) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | |
2401
4f428de32b69
Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
30 | from .E5LineEdit import E5LineEdit |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | self.__lineedit = E5LineEdit(self, inactiveText) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | self.setLineEdit(self.__lineedit) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | self.setMinimumHeight(self.__lineedit.minimumHeight() + 3) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | def inactiveText(self): |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | """ |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | Public method to get the inactive text. |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | |
2953
703452a2876f
Started correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2401
diff
changeset
|
40 | @return inactive text (string) |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | """ |
4585
dbedc2e21bbd
Fixed a bug in the E5ComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4583
diff
changeset
|
42 | return self.lineEdit().inactiveText() |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | def setInactiveText(self, inactiveText): |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | """ |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | Public method to set the inactive text. |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | @param inactiveText text to be shown on inactivity (string) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | """ |
4585
dbedc2e21bbd
Fixed a bug in the E5ComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4583
diff
changeset
|
50 | self.lineEdit().setInactiveText(inactiveText) |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | class E5ClearableComboBox(E5ComboBox): |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | """ |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
55 | Class implementing a combobox using the eric6 line edit. |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | """ |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | def __init__(self, parent=None, inactiveText=""): |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | """ |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | Constructor |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | @param parent reference to the parent widget (QWidget) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | @param inactiveText text to be shown on inactivity (string) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | """ |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2401
diff
changeset
|
64 | super(E5ClearableComboBox, self).__init__(parent, inactiveText) |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | |
2401
4f428de32b69
Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
66 | from .E5LineEdit import E5ClearableLineEdit |
2223
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | self.__lineedit = E5ClearableLineEdit(self, inactiveText) |
054c285dab38
Changed a bunch of forms to use the E5ClearableLineEdit and E5ClearableComboBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | self.setLineEdit(self.__lineedit) |