diff main/main.cpp @ 366:d0c5831d6528 macness

First step in creating a useful dock menu for SV; a placeholder item is added, so far
author Dan Stowell <dan.stowell@eecs.qmul.ac.uk>
date Mon, 11 Oct 2010 16:55:24 +0100
parents 174ca518546f
children 726e1c1382f3
line wrap: on
line diff
--- a/main/main.cpp	Mon Oct 11 15:47:12 2010 +0100
+++ b/main/main.cpp	Mon Oct 11 16:55:24 2010 +0100
@@ -37,6 +37,10 @@
 #include <QTimer>
 #include <QPainter>
 #include <QFileOpenEvent>
+#include <QMenu>
+#ifdef Q_WS_MAC
+    void qt_mac_set_dock_menu(QMenu *menu); // must declare it ourselves, weirdly enough
+#endif
 
 #include "../version.h"
 
@@ -211,6 +215,16 @@
     bool m_readyForFiles;
     QStringList m_filepathQueue;
 
+#ifdef Q_WS_MAC
+    void setupDockMenu() {
+        std::cerr << "SV adding mac dock menu" << std::endl;
+        QMenu *dockMenu = new QMenu();
+        dockMenu->addAction("a SV DOCK action");
+        qt_mac_set_dock_menu(dockMenu);
+    }
+#endif
+
+
 protected:
     MainWindow *m_mainWindow;
     bool event(QEvent *);
@@ -390,6 +404,10 @@
     settings.endGroup();
 #endif
 
+#ifdef Q_WS_MAC
+    application.setupDockMenu();
+#endif
+
     if (splash) splash->finish(gui);
     delete splash;