LtsWidgets: Qt6 API fixes complete
- QComboBox::activated signal: QString→int parameter (lts_text_editor) - qAsConst→std::as_const (5 files) - localPos()→position() (lts_height_plot_widget) - setMargin→setContentsMargins (tests/window.cpp) - CMAKE_AUTOUIC OFF + include in header for MOC - enterEvent(QEnterEvent*) signature fixes - QRegExp→QRegularExpression replacements All LtsWidgets module files now Qt6-compatible.
This commit is contained in:
25 files changed
+58
-47
No files matched your search
@@ -356,8 +356,7 @@ void LtsHeightPlotWidget::Private::repaint()
|
||||
QImage img(m_curSize, QImage::Format_ARGB32);
|
||||
img.fill(Qt::transparent);
|
||||
QPainter p(&img);
|
||||
const QPainter::RenderHints hints = QPainter::HighQualityAntialiasing |
|
||||
QPainter::SmoothPixmapTransform |
|
||||
const QPainter::RenderHints hints = QPainter::SmoothPixmapTransform |
|
||||
QPainter::TextAntialiasing |
|
||||
QPainter::Antialiasing;
|
||||
p.setRenderHints(hints);
|
||||
@@ -416,7 +415,7 @@ void LtsHeightPlotWidget::Private::repaint()
|
||||
const QPointF p1(-20, y);
|
||||
const QString str = QString::number(i);
|
||||
QRectF r = fm.boundingRect(str);
|
||||
r.setWidth(fm.width(str)); // important, see docu!
|
||||
r.setWidth(fm.horizontalAdvance(str)); // important, see docu!
|
||||
r.moveTo(p1.x() - r.width() / 2., p1.y() - r.height() / 2.);
|
||||
p.drawText(r, str, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
}
|
||||
@@ -447,7 +446,7 @@ void LtsHeightPlotWidget::Private::repaint()
|
||||
const QPointF p1(point.x(), point.y() + 15);
|
||||
const QString str = QString::number(i);
|
||||
QRectF r = fm.boundingRect(str);
|
||||
r.setWidth(fm.width(str)); // important, see docu!
|
||||
r.setWidth(fm.horizontalAdvance(str)); // important, see docu!
|
||||
r.moveTo(p1.x() - r.width() / 2., p1.y() - r.height() / 2.);
|
||||
p.drawText(r, str, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
}
|
||||
@@ -526,7 +525,7 @@ void LtsHeightPlotWidget::setMarks(const QVector<QPointF> &data)
|
||||
void LtsHeightPlotWidget::setBackgroundBrush(const QBrush &brush)
|
||||
{
|
||||
QPalette pal = palette();
|
||||
pal.setBrush(QPalette::Background, brush);
|
||||
pal.setBrush(QPalette::Window, brush);
|
||||
setPalette(pal);
|
||||
}
|
||||
|
||||
@@ -594,7 +593,7 @@ void LtsHeightPlotWidget::mouseMoveEvent(QMouseEvent *e)
|
||||
if (!d->m_heightList.count())
|
||||
return;
|
||||
|
||||
const QPointF pos = d->m_transInverted.map(e->localPos());
|
||||
const QPointF pos = d->m_transInverted.map(e->position());
|
||||
emit mousePositionChanged(d->getDataPos(pos.x()), d->getDataHeight(pos.x()), pos.y());
|
||||
d->m_mousePos = pos;
|
||||
update();
|
||||
|
||||
Reference in new issue
Block a user