dpi-dependent methods
This commit is contained in:
@@ -10,7 +10,7 @@ CLineEdit::CLineEdit(QWidget * parent): QLineEdit(parent) {
|
||||
cw->hide();
|
||||
cw->installEventFilter(this);
|
||||
connect(this, SIGNAL(textChanged(QString)), this, SLOT(textChanged_(QString)));
|
||||
int is = fontHeight();
|
||||
int is = fontHeight(this);
|
||||
QMargins m = textMargins();
|
||||
m.setRight(m.right() + (is * 1.2));
|
||||
setTextMargins(m);
|
||||
@@ -33,7 +33,7 @@ bool CLineEdit::eventFilter(QObject * o, QEvent * e) {
|
||||
|
||||
void CLineEdit::resizeEvent(QResizeEvent * e) {
|
||||
QLineEdit::resizeEvent(e);
|
||||
int is = fontHeight(), tm = (height() - is) / 2;
|
||||
int is = fontHeight(this), tm = (height() - is) / 2;
|
||||
cw->setGeometry(width() - is - tm, tm, is, is);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user