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. Pick-to: 6.6 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>
This commit is contained in:
parent
5d9c9fe8f7
commit
5f55f6c8ab
@ -2175,7 +2175,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);
|
||||
}
|
||||
|
@ -1134,7 +1134,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);
|
||||
}
|
||||
|
@ -1777,7 +1777,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