Skip to content

Commit a165e12

Browse files
committed
#3499 navigationwidget: fix Qt 5.9 build error
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 5b9ffea commit a165e12

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/helpers/nomenuiconstyle.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ void NoMenuIconStyle::drawControl(ControlElement element, const QStyleOption *op
44
QPainter *painter, const QWidget *widget) const {
55
if (element == CE_MenuItem && widget && qobject_cast<const QMenu *>(widget)) {
66
if (const auto *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
7+
#if defined(__clang__) && __has_warning("-Wdeprecated-copy-with-user-provided-copy")
8+
#pragma clang diagnostic push
9+
#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy"
10+
#endif
711
QStyleOptionMenuItem opt(*menuItem); // Copy original option
8-
opt.icon = QIcon(); // Remove the icon
9-
opt.maxIconWidth = 0; // Prevent space allocation
12+
#if defined(__clang__) && __has_warning("-Wdeprecated-copy-with-user-provided-copy")
13+
#pragma clang diagnostic pop
14+
#endif
15+
opt.icon = QIcon(); // Remove the icon
16+
opt.maxIconWidth = 0; // Prevent space allocation
1017

1118
QProxyStyle::drawControl(element, &opt, painter, widget);
1219
return;

0 commit comments

Comments
 (0)