7 Module implementing specialized line edits. |
7 Module implementing specialized line edits. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt4.QtCore import pyqtSignal, Qt, QEvent, qVersion |
12 from PyQt5.QtCore import pyqtSignal, Qt, QEvent, qVersion |
13 from PyQt4.QtGui import QLineEdit, QStyle, QPainter, QPalette, \ |
13 from PyQt5.QtGui import QPainter, QPalette |
14 QStyleOptionFrameV2, QWidget, QHBoxLayout, QBoxLayout, QLayout, \ |
14 from PyQt5.QtWidgets import QLineEdit, QStyle, QWidget, QHBoxLayout, \ |
15 QApplication, QSpacerItem, QSizePolicy |
15 QBoxLayout, QLayout, QApplication, QSpacerItem, QSizePolicy, \ |
|
16 QStyleOptionFrame |
16 |
17 |
17 import UI.PixmapCache |
18 import UI.PixmapCache |
18 |
19 |
19 |
20 |
20 class E5LineEditSideWidget(QWidget): |
21 class E5LineEditSideWidget(QWidget): |
150 |
151 |
151 if qVersion() < "4.7.0": |
152 if qVersion() < "4.7.0": |
152 if not self.text() and \ |
153 if not self.text() and \ |
153 self.__inactiveText and \ |
154 self.__inactiveText and \ |
154 not self.hasFocus(): |
155 not self.hasFocus(): |
155 panel = QStyleOptionFrameV2() |
156 panel = QStyleOptionFrame() |
156 self.initStyleOption(panel) |
157 self.initStyleOption(panel) |
157 textRect = self.style().subElementRect( |
158 textRect = self.style().subElementRect( |
158 QStyle.SE_LineEditContents, panel, self) |
159 QStyle.SE_LineEditContents, panel, self) |
159 textRect.adjust(2, 0, 0, 0) |
160 textRect.adjust(2, 0, 0, 0) |
160 left = self.textMargin(self.LeftSide) |
161 left = self.textMargin(self.LeftSide) |