aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggermainwindow.cpp
diff options
context:
space:
mode:
authorLasse Holmstedt <[email protected]>2010-02-09 20:44:40 +0100
committerLasse Holmstedt <[email protected]>2010-02-16 15:13:09 +0100
commit580280af260c0fe261f8056495db8daf15c10b20 (patch)
tree802003687bb311d32980ce1772726f165fb95077 /src/plugins/debugger/debuggermainwindow.cpp
parent70c47334bf0c985ee3cf825c4c3cb5a7cd914a8f (diff)
Changed QML Inspector from a separate global mode to a plugin.
The new QML Inspector depends on DebuggerPlugin. Also added a dropdown menu into the debugger toolbar from which the user can select the used debugging language, e.g. C++ or QML.
Diffstat (limited to 'src/plugins/debugger/debuggermainwindow.cpp')
-rw-r--r--src/plugins/debugger/debuggermainwindow.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp
new file mode 100644
index 00000000000..d35103acf22
--- /dev/null
+++ b/src/plugins/debugger/debuggermainwindow.cpp
@@ -0,0 +1,60 @@
+#include "debuggermainwindow.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtGui/QApplication>
+#include <QtGui/QMenu>
+#include <QtGui/QLayout>
+#include <QtGui/QMainWindow>
+#include <QtGui/QDockWidget>
+#include <QtGui/QStyle>
+
+#include <QDebug>
+
+namespace Debugger {
+
+DebuggerMainWindow::DebuggerMainWindow(DebuggerUISwitcher *uiSwitcher, QWidget *parent) :
+ FancyMainWindow(parent), m_uiSwitcher(uiSwitcher)
+{
+ // TODO how to "append" style sheet?
+ // QString sheet;
+ // After setting it, all prev. style stuff seem to be ignored.
+ /* sheet = QLatin1String(
+ "Debugger--DebuggerMainWindow::separator {"
+ " background: black;"
+ " width: 1px;"
+ " height: 1px;"
+ "}"
+ );
+ setStyleSheet(sheet);
+ */
+}
+
+DebuggerMainWindow::~DebuggerMainWindow()
+{
+
+}
+
+QMenu* DebuggerMainWindow::createPopupMenu()
+{
+ QMenu *menu = 0;
+
+ QList<Internal::DebugToolWindow* > dockwidgets = m_uiSwitcher->m_dockWidgets;
+
+ if (!dockwidgets.isEmpty()) {
+ menu = new QMenu(this);
+
+ for (int i = 0; i < dockwidgets.size(); ++i) {
+ QDockWidget *dockWidget = dockwidgets.at(i)->m_dockWidget;
+ if (dockWidget->parentWidget() == this &&
+ dockwidgets.at(i)->m_languageId == m_uiSwitcher->m_activeLanguage) {
+
+ menu->addAction(dockWidget->toggleViewAction());
+ }
+ }
+ menu->addSeparator();
+ }
+
+ return menu;
+}
+
+}