summaryrefslogtreecommitdiff
path: root/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2017-03-02 10:37:19 +0100
committerAlbert Astals Cid <aacid@kde.org>2017-04-18 14:31:52 +0000
commit6462f299ed188b3c3494d99d21e6563e37bd78e5 (patch)
tree373b4bfcb57698474217404a2395d183e8eb031b /src/plugins/platformthemes/gtk3/qgtk3menu.cpp
parentdf252fc2051a6d2939c77244e74aca4a115d7cce (diff)
downloadqtbase-6462f299ed188b3c3494d99d21e6563e37bd78e5.tar.gz
Make platform menu tag/setTag not be pure virtual
Reasons: * Tag means nothing to the platform, tag is something the Qt side code will store and then restore, but it's meaningless for the platform, since it can be either the pointer to an action (qmenu.cpp) or an item count (qcombobox.cpp) * Since it's meaningless to the platform you don't know what to do when trying to implement a platform, this shows in how the field was being initialized, some initialized to this, some initialized to 0 On a followup commit we will remove the virtual tag but first need to fix up other QPAs that don't live in the main repo Change-Id: I15ac83f3bf7e4c741153d31ac761dbbe6f4b1b52 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platformthemes/gtk3/qgtk3menu.cpp')
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3menu.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
index 38c2d251b4..a123c5aaec 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
@@ -84,7 +84,6 @@ QGtk3MenuItem::QGtk3MenuItem()
m_enabled(true),
m_underline(false),
m_invalid(true),
- m_tag(reinterpret_cast<quintptr>(this)),
m_menu(nullptr),
m_item(nullptr)
{
@@ -145,16 +144,6 @@ GtkWidget *QGtk3MenuItem::handle() const
return m_item;
}
-quintptr QGtk3MenuItem::tag() const
-{
- return m_tag;
-}
-
-void QGtk3MenuItem::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
QString QGtk3MenuItem::text() const
{
return m_text;
@@ -341,7 +330,6 @@ void QGtk3MenuItem::onToggle(GtkCheckMenuItem *check, void *data)
}
QGtk3Menu::QGtk3Menu()
- : m_tag(reinterpret_cast<quintptr>(this))
{
m_menu = gtk_menu_new();
@@ -402,16 +390,6 @@ void QGtk3Menu::syncSeparatorsCollapsible(bool enable)
Q_UNUSED(enable);
}
-quintptr QGtk3Menu::tag() const
-{
- return m_tag;
-}
-
-void QGtk3Menu::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
void QGtk3Menu::setEnabled(bool enabled)
{
gtk_widget_set_sensitive(m_menu, enabled);