diff options
author | David Boddie <david.boddie@nokia.com> | 2011-02-09 17:03:01 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-02-09 17:03:01 (GMT) |
commit | 1a7d04376d2b7ecbae69d14fb0d124e47507961d (patch) | |
tree | 1c96aeb1a26b96d068d249422806567226565dd3 /doc/src/snippets/code | |
parent | fb6e03e41aa79a4a459eeb21076ffd08541914ab (diff) | |
download | Qt-1a7d04376d2b7ecbae69d14fb0d124e47507961d.zip Qt-1a7d04376d2b7ecbae69d14fb0d124e47507961d.tar.gz Qt-1a7d04376d2b7ecbae69d14fb0d124e47507961d.tar.bz2 |
Doc: Snippet quoting and other documentation fixes.
Diffstat (limited to 'doc/src/snippets/code')
-rw-r--r-- | doc/src/snippets/code/doc_src_qdbusadaptors.cpp | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/doc/src/snippets/code/doc_src_qdbusadaptors.cpp b/doc/src/snippets/code/doc_src_qdbusadaptors.cpp index abb31a1..749e64b 100644 --- a/doc/src/snippets/code/doc_src_qdbusadaptors.cpp +++ b/doc/src/snippets/code/doc_src_qdbusadaptors.cpp @@ -39,82 +39,82 @@ ****************************************************************************/ //! [0] - class MainApplicationAdaptor: public QDBusAbstractAdaptor - { - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "org.kde.DBus.MainApplication") - Q_PROPERTY(QString caption READ caption WRITE setCaption) - Q_PROPERTY(QString organizationName READ organizationName) - Q_PROPERTY(QString organizationDomain READ organizationDomain) - - private: - QApplication *app; - - public: - MainApplicationAdaptor(QApplication *application) - : QDBusAbstractAdaptor(application), app(application) - { - connect(application, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit())); - connect(application, SIGNAL(focusChanged(QWidget*, QWidget*)), - SLOT(focusChangedSlot(QWidget*, QWidget*))); - } - - QString caption() - { - if (app->hasMainWindow()) - return app->mainWindow()->caption(); - return QString(""); // must not return a null QString - } - - void setCaption(const QString &newCaption) - { - if (app->hasMainWindow()) - app->mainWindow()->setCaption(newCaption); - } - - QString organizationName() - { - return app->organizationName(); - } - - QString organizationDomain() - { - return app->organizationDomain(); - } - - public slots: - Q_NOREPLY void quit() - { app->quit(); } - - void reparseConfiguration() - { app->reparseConfiguration(); } - - QString mainWindowObject() - { - if (app->hasMainWindow()) - return QString("/%1/mainwindow").arg(app->applicationName()); - return QString(); - } - - void setSessionManagement(bool enable) - { - if (enable) - app->enableSessionManagement(); - else - app->disableSessionManagement(); - } - - private slots: - void focusChangedSlot(QWidget *, QWidget *now) - { - if (now == app->mainWindow()) - emit mainWindowHasFocus(); - } - - signals: - void aboutToQuit(); - void mainWindowHasFocus(); - }; +class MainApplicationAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.DBus.MainApplication") + Q_PROPERTY(QString caption READ caption WRITE setCaption) + Q_PROPERTY(QString organizationName READ organizationName) + Q_PROPERTY(QString organizationDomain READ organizationDomain) + +private: + QApplication *app; + +public: + MainApplicationAdaptor(QApplication *application) + : QDBusAbstractAdaptor(application), app(application) + { + connect(application, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit())); + connect(application, SIGNAL(focusChanged(QWidget*, QWidget*)), + SLOT(focusChangedSlot(QWidget*, QWidget*))); + } + + QString caption() + { + if (app->hasMainWindow()) + return app->mainWindow()->caption(); + return QString(""); // must not return a null QString + } + + void setCaption(const QString &newCaption) + { + if (app->hasMainWindow()) + app->mainWindow()->setCaption(newCaption); + } + + QString organizationName() + { + return app->organizationName(); + } + + QString organizationDomain() + { + return app->organizationDomain(); + } + +public slots: + Q_NOREPLY void quit() + { app->quit(); } + + void reparseConfiguration() + { app->reparseConfiguration(); } + + QString mainWindowObject() + { + if (app->hasMainWindow()) + return QString("/%1/mainwindow").arg(app->applicationName()); + return QString(); + } + + void setSessionManagement(bool enable) + { + if (enable) + app->enableSessionManagement(); + else + app->disableSessionManagement(); + } + +private slots: + void focusChangedSlot(QWidget *, QWidget *now) + { + if (now == app->mainWindow()) + emit mainWindowHasFocus(); + } + +signals: + void aboutToQuit(); + void mainWindowHasFocus(); +}; //! [0] |