Don't show mnemonics in dockwidget titles
One might want to add an accellerator to dockwidget titles to be used in contexts that isn't directly the title, but still uses the title. Dockwidget title accelerators doesn't work in dock widgets, so don't show them. They are still available in e.g. a right click menu on a dockwidget to hide/show, and here the accellerator might come handy, and also if a dockwidget is tabbed. Change-Id: I196e1aa92a5c53fed735b598653c267509f788b8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> (cherry picked from commit cc67b25579c1bb5ea9f5c1ca4c9b7997e66f19b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5f55f6c8abf4154c5d816a39fc979409a422df44)
This commit is contained in:
parent
4f43990f7d
commit
c60c1dcf5f
@ -2171,7 +2171,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
|
||||
|
||||
const int indent = p->fontMetrics().descent();
|
||||
proxy()->drawItemText(p, r.adjusted(indent + 1, 1, -indent - 1, -1),
|
||||
Qt::AlignLeft | Qt::AlignVCenter, dwOpt->palette,
|
||||
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextHideMnemonic, dwOpt->palette,
|
||||
dwOpt->state & State_Enabled, dwOpt->title,
|
||||
QPalette::WindowText);
|
||||
|
||||
|
@ -1224,7 +1224,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
||||
Qt::ElideRight, titleRect.width());
|
||||
proxy()->drawItemText(painter,
|
||||
titleRect,
|
||||
Qt::AlignLeft | Qt::AlignVCenter, dwOpt->palette,
|
||||
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextHideMnemonic, dwOpt->palette,
|
||||
dwOpt->state & State_Enabled, titleText,
|
||||
QPalette::WindowText);
|
||||
}
|
||||
|
@ -1787,7 +1787,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
|
||||
titleRect.height(), titleRect.width());
|
||||
}
|
||||
proxy()->drawItemText(p, titleRect,
|
||||
Qt::AlignLeft | Qt::AlignVCenter, palette,
|
||||
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextHideMnemonic, palette,
|
||||
dwOpt->state & State_Enabled, dwOpt->title,
|
||||
floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText);
|
||||
p->setFont(oldFont);
|
||||
|
Loading…
x
Reference in New Issue
Block a user