summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-05-28 16:10:52 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-30 09:55:52 +0200
commita09a867de081b4e335ce36b7377ce33abcd3e142 (patch)
treed402cbfe251b184b9c7e1b3be2fe57d6ec037118 /src/plugins/platforms
parent1faafdbe4a9ef79c9afec8d9a5e8c126a1384d9a (diff)
Cocoa: Allow delayed title setting in menu items
This is what happens in uic generated code. Therefore, we should not mark an item as text-synced until it's got its text set. Task-number: QTBUG-31378 Change-Id: I7bb7db8abad922b50546c7669d285369ebf01394 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index 1255f75eb7..1e2b593a08 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -241,7 +241,8 @@ NSMenuItem *QCocoaMenuItem::sync()
mergeItem = [loader quitMenuItem];
break;
default:
- m_textSynced = true;
+ if (!m_text.isEmpty())
+ m_textSynced = true;
break;
}
break;
@@ -264,7 +265,7 @@ NSMenuItem *QCocoaMenuItem::sync()
m_native = nil; // create item below
m_merged = false;
}
- } else {
+ } else if (!m_text.isEmpty()) {
m_textSynced = true; // NoRole, and that was set explicitly. So, nothing to do anymore.
}