dpi-dependent methods

This commit is contained in:
2021-06-14 15:45:29 +03:00
parent b09390a460
commit 8646132928
10 changed files with 18 additions and 18 deletions

View File

@@ -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);
}