diff options
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/accessible/qaccessiblecolorwell.cpp | 5 | ||||
| -rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 10 | ||||
| -rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 9 |
3 files changed, 9 insertions, 15 deletions
diff --git a/src/widgets/accessible/qaccessiblecolorwell.cpp b/src/widgets/accessible/qaccessiblecolorwell.cpp index ca08e511e9a..64fcd2a7fd1 100644 --- a/src/widgets/accessible/qaccessiblecolorwell.cpp +++ b/src/widgets/accessible/qaccessiblecolorwell.cpp @@ -3,6 +3,8 @@ #include "private/qaccessiblecolorwell_p.h" +#include <QtCore/qcoreapplication.h> + QT_REQUIRE_CONFIG(accessibility); #if QT_CONFIG(colordialog) @@ -14,6 +16,7 @@ class QAccessibleColorWellItem : public QAccessibleInterface { QAccessibleColorWell *m_parent; + Q_DECLARE_TR_FUNCTIONS(QAccessibleColorWellItem) public: QAccessibleColorWellItem(QAccessibleColorWell *parent); @@ -79,7 +82,7 @@ QString QAccessibleColorWellItem::text(QAccessible::Text t) const if (t == QAccessible::Name) { QRgb color = m_parent->colorWell()->rgbValues()[m_parent->indexOfChild(this)]; //: Color specified via its 3 RGB components (red, green, blue) - return QObject::tr("RGB %1, %2, %3") + return tr("RGB %1, %2, %3") .arg(QString::number(qRed(color)), QString::number(qGreen(color)), QString::number(qBlue(color))); } diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 3417d93d587..97332cd7d5d 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -6,15 +6,12 @@ #include <qapplication.h> #include <qevent.h> -#include <qpointer.h> #include <qstyle.h> #include <qstyleoption.h> #include <qstylepainter.h> #if QT_CONFIG(effects) #include <private/qeffects_p.h> #endif -#include <qtextdocument.h> -#include <qdebug.h> #include <qpa/qplatformscreen.h> #include <qpa/qplatformcursor.h> #if QT_CONFIG(style_stylesheet) @@ -23,12 +20,9 @@ #include <qpa/qplatformwindow.h> #include <qpa/qplatformwindow_p.h> -#include <qlabel.h> #include <QtWidgets/private/qlabel_p.h> #include <QtGui/private/qhighdpiscaling_p.h> #include <qtooltip.h> - -#include <QtCore/qbasictimer.h> #include <QtWidgets/private/qtooltip_p.h> QT_BEGIN_NAMESPACE @@ -190,10 +184,10 @@ void QTipLabel::resizeEvent(QResizeEvent *e) void QTipLabel::mouseMoveEvent(QMouseEvent *e) { if (!rect.isNull()) { - QPoint pos = e->globalPosition().toPoint(); + QPointF pos = e->globalPosition(); if (widget) pos = widget->mapFromGlobal(pos); - if (!rect.contains(pos)) + if (!rect.contains(pos.toPoint())) hideTip(); } QLabel::mouseMoveEvent(e); diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 90c1cfb4b86..592b70ef8ba 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1994,12 +1994,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget); if (!tab->icon.isNull()) { - QPixmap tabIcon = tab->icon.pixmap(tab->iconSize, QStyleHelper::getDpr(p), - (tab->state & State_Enabled) ? QIcon::Normal - : QIcon::Disabled, - (tab->state & State_Selected) ? QIcon::On - : QIcon::Off); - p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon); + const auto mode = (tab->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled; + const auto state = (tab->state & State_Selected) ? QIcon::On : QIcon::Off; + tab->icon.paint(p, iconRect, Qt::AlignCenter, mode, state); } proxy()->drawItemText(p, tr, alignment, tab->palette, tab->state & State_Enabled, tab->text, |
