diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2009-09-25 14:42:01 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2009-09-25 14:42:01 (GMT) |
commit | 2b1f40b7dcf7ef69fe1f832ff544fcb31cf5c3a1 (patch) | |
tree | f6ddb01707d2e59e29b47ffcd2ea016c3164fc54 /src/scripttools | |
parent | 586722a4e288e9f1e9d7751a0e87e39c274144d8 (diff) | |
download | Qt-2b1f40b7dcf7ef69fe1f832ff544fcb31cf5c3a1.zip Qt-2b1f40b7dcf7ef69fe1f832ff544fcb31cf5c3a1.tar.gz Qt-2b1f40b7dcf7ef69fe1f832ff544fcb31cf5c3a1.tar.bz2 |
ifdefs to allow compilation with QT_NO_MAINWINDOW and QT_NO_TOOLBAR
Reviewed-by: Paul
Diffstat (limited to 'src/scripttools')
5 files changed, 26 insertions, 1 deletions
diff --git a/src/scripttools/debugging/qscriptbreakpointswidget.cpp b/src/scripttools/debugging/qscriptbreakpointswidget.cpp index 55479a3..356c6d5 100644 --- a/src/scripttools/debugging/qscriptbreakpointswidget.cpp +++ b/src/scripttools/debugging/qscriptbreakpointswidget.cpp @@ -306,13 +306,17 @@ QScriptBreakpointsWidget::QScriptBreakpointsWidget(QWidget *parent) QObject::connect(d->deleteBreakpointAction, SIGNAL(triggered()), this, SLOT(_q_deleteBreakpoint())); +#ifndef QT_NO_TOOLBAR QToolBar *toolBar = new QToolBar(); toolBar->addAction(newBreakpointAction); toolBar->addAction(d->deleteBreakpointAction); +#endif QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setMargin(0); +#ifndef QT_NO_TOOLBAR vbox->addWidget(toolBar); +#endif vbox->addWidget(d->newBreakpointWidget); vbox->addWidget(d->view); } diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp index 6a23bd1..c09e494 100644 --- a/src/scripttools/debugging/qscriptdebugger.cpp +++ b/src/scripttools/debugging/qscriptdebugger.cpp @@ -1927,6 +1927,7 @@ QMenu *QScriptDebugger::createStandardMenu(QWidget *widgetParent, QObject *actio return menu; } +#ifndef QT_NO_TOOLBAR QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject *actionParent) { QToolBar *tb = new QToolBar(widgetParent); @@ -1942,6 +1943,7 @@ QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject tb->addAction(action(FindInScriptAction, actionParent)); return tb; } +#endif bool QScriptDebugger::isInteractive() const { diff --git a/src/scripttools/debugging/qscriptdebugger_p.h b/src/scripttools/debugging/qscriptdebugger_p.h index 57758de..08e9a99 100644 --- a/src/scripttools/debugging/qscriptdebugger_p.h +++ b/src/scripttools/debugging/qscriptdebugger_p.h @@ -71,7 +71,9 @@ class QScriptDebuggerWidgetFactoryInterface; class QAction; class QEvent; class QMenu; +#ifndef QT_NO_TOOLBAR class QToolBar; +#endif class QScriptDebuggerPrivate; class Q_AUTOTEST_EXPORT QScriptDebugger : public QObject @@ -168,8 +170,9 @@ public: QAction *clearErrorLogAction(QObject *parent) const; QMenu *createStandardMenu(QWidget *widgetParent, QObject *actionParent); +#ifndef QT_NO_TOOLBAR QToolBar *createStandardToolBar(QWidget *widgetParent, QObject *actionParent); - +#endif bool eventFilter(QObject *, QEvent *e); bool isInteractive() const; diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp index 8615232..7456da0 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.cpp +++ b/src/scripttools/debugging/qscriptenginedebugger.cpp @@ -251,7 +251,9 @@ public: QScriptDebugger *debugger; QScriptEngineDebuggerFrontend *frontend; +#ifndef QT_NO_MAINWINDOW QMainWindow *standardWindow; +#endif bool autoShow; static QtScriptDebuggerResourceInitializer resourceInitializer; @@ -294,7 +296,9 @@ QScriptEngineDebuggerPrivate::QScriptEngineDebuggerPrivate() { debugger = 0; frontend = 0; +#ifndef QT_NO_MAINWINDOW standardWindow = 0; +#endif autoShow = true; } @@ -302,6 +306,7 @@ QScriptEngineDebuggerPrivate::~QScriptEngineDebuggerPrivate() { delete debugger; delete frontend; +#ifndef QT_NO_MAINWINDOW if (standardWindow) { QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); QByteArray geometry = standardWindow->saveGeometry(); @@ -311,14 +316,17 @@ QScriptEngineDebuggerPrivate::~QScriptEngineDebuggerPrivate() if (standardWindow->parent() == 0) delete standardWindow; } +#endif } +#ifndef QT_NO_MAINWINDOW void QScriptEngineDebuggerPrivate::_q_showStandardWindow() { Q_Q(QScriptEngineDebugger); (void)q->standardWindow(); // ensure it's created standardWindow->show(); } +#endif void QScriptEngineDebuggerPrivate::createDebugger() { @@ -499,6 +507,7 @@ void QScriptEngineDebugger::setAutoShowStandardWindow(bool autoShow) \sa createStandardMenu(), createStandardToolBar() */ +#ifndef QT_NO_MAINWINDOW QMainWindow *QScriptEngineDebugger::standardWindow() const { Q_D(const QScriptEngineDebugger); @@ -602,6 +611,7 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const const_cast<QScriptEngineDebuggerPrivate*>(d)->standardWindow = win; return win; } +#endif // QT_NO_MAINWINDOW /*! Creates a standard debugger menu with the given \a parent. @@ -622,12 +632,14 @@ QMenu *QScriptEngineDebugger::createStandardMenu(QWidget *parent) \sa createStandardMenu() */ +#ifndef QT_NO_TOOLBAR QToolBar *QScriptEngineDebugger::createStandardToolBar(QWidget *parent) { Q_D(QScriptEngineDebugger); d->createDebugger(); return d->debugger->createStandardToolBar(parent, this); } +#endif /*! \fn QScriptEngineDebugger::evaluationSuspended() diff --git a/src/scripttools/debugging/qscriptenginedebugger.h b/src/scripttools/debugging/qscriptenginedebugger.h index 44d77bd..1caba4a 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.h +++ b/src/scripttools/debugging/qscriptenginedebugger.h @@ -53,7 +53,9 @@ QT_MODULE(ScriptTools) class QAction; class QScriptEngine; class QWidget; +#ifndef QT_NO_MAINWINDOW class QMainWindow; +#endif class QMenu; class QToolBar; @@ -106,7 +108,9 @@ public: bool autoShowStandardWindow() const; void setAutoShowStandardWindow(bool autoShow); +#ifndef QT_NO_MAINWINDOW QMainWindow *standardWindow() const; +#endif QToolBar *createStandardToolBar(QWidget *parent = 0); QMenu *createStandardMenu(QWidget *parent = 0); |