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

@@ -85,7 +85,7 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
help_visible = true;
completer = new QCodeEditCompleter();
cursor_width = qMax<int>(qRound(fontHeight() / 10.), 1);
cursor_width = qMax<int>(qRound(fontHeight(this) / 10.), 1);
ui->textCode->setCursorWidth(0);
ui->textCode->viewport()->setMouseTracking(true);
ui->textLines->viewport()->setAutoFillBackground(false);
@@ -202,7 +202,7 @@ void QCodeEdit::setDocument(QTextDocument * doc) {
if (!qobject_cast<QPlainTextDocumentLayout*>(doc->documentLayout()))
doc->setDocumentLayout(new QPlainTextDocumentLayout(doc));
ui->textCode->setDocument(doc);
cursor_width = qMax<int>(qRound(fontHeight() / 10.), 1);
cursor_width = qMax<int>(qRound(fontHeight(this) / 10.), 1);
ui->textCode->setCursorWidth(0);
//ui->textCode->setCursorWidth(qMax<int>(qRound(fontHeight() / 10.), 1));
setShowSpaces(spaces_);
@@ -1576,7 +1576,7 @@ void QCodeEdit::raiseHelp(QTextCursor tc, int arg) {
#endif
QPoint whp;
whp.setX(whr.left() - whr.width() - (widget_help->width() - whr.width()) / 2);
whp.setY(whr.top() - widget_help->height() - (fontHeight() / 3));
whp.setY(whr.top() - widget_help->height() - (fontHeight(this) / 3));
//qDebug() << whr << whp << widget_help->width() << ", " << st;
widget_help->move(ui->textCode->viewport()->mapToGlobal(whp));
widget_help->show();