Helper function internal::setToolTip() to remove as many #ifndef QT_NO_TOOLTIP tests as possible to cleanup the code

This commit is contained in:
Uwe Kindler
2020-02-05 08:33:40 +01:00
parent 505f14a601
commit acb423872a
4 changed files with 25 additions and 25 deletions

View File

@@ -184,9 +184,7 @@ void DockWidgetTabPrivate::createLayout()
CloseButton->setIcon(CloseIcon);
CloseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
_this->onDockWidgetFeaturesChanged();
#ifndef QT_NO_TOOLTIP
CloseButton->setToolTip(QObject::tr("Close Tab"));
#endif
internal::setToolTip(CloseButton, QObject::tr("Close Tab"));
_this->connect(CloseButton, SIGNAL(clicked()), SIGNAL(closeRequested()));
QFontMetrics fm(TitleLabel->font());
@@ -499,9 +497,7 @@ void CDockWidgetTab::setIcon(const QIcon& Icon)
d->IconLabel = new QLabel();
d->IconLabel->setAlignment(Qt::AlignVCenter);
d->IconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
#ifndef QT_NO_TOOLTIP
d->IconLabel->setToolTip(d->TitleLabel->toolTip());
#endif
internal::setToolTip(d->IconLabel, d->TitleLabel->toolTip());
Layout->insertWidget(0, d->IconLabel, Qt::AlignVCenter);
Layout->insertSpacing(1, qRound(1.5 * Layout->contentsMargins().left() / 2.0));
}