| mdebug.h | | mdebug.h | |
| | | | |
| skipping to change at line 25 | | skipping to change at line 25 | |
| ** and appearing in the file LICENSE.LGPL included in the packaging | | ** and appearing in the file LICENSE.LGPL included in the packaging | |
| ** of this file. | | ** of this file. | |
| ** | | ** | |
| ***************************************************************************
*/ | | ***************************************************************************
*/ | |
| | | | |
| #ifndef MDEBUG_H | | #ifndef MDEBUG_H | |
| #define MDEBUG_H | | #define MDEBUG_H | |
| | | | |
| #include <QDebug> | | #include <QDebug> | |
| | | | |
|
| | | //! \internal | |
| | | | |
| | | class MWidgetController; | |
| | | | |
| | | class MDebug | |
| | | { | |
| | | public: | |
| | | typedef void (*MMsgHandler)(int, const char *); | |
| | | | |
| | | enum Type { | |
| | | Debug, | |
| | | Warning, | |
| | | Fatal, | |
| | | Critical, | |
| | | System, | |
| | | Performance, | |
| | | | |
| | | User = 0xFF | |
| | | }; | |
| | | | |
| | | MDebug(int type = Debug); | |
| | | MDebug(const MDebug &debug); | |
| | | ~MDebug(); | |
| | | | |
| | | MDebug &operator<<(const QString &string); | |
| | | MDebug &operator<<(const MWidgetController *controller); | |
| | | | |
| | | static void installMessageHandler(MMsgHandler handler); | |
| | | static MMsgHandler messageHandler(); | |
| | | | |
| | | private: | |
| | | void flush(); | |
| | | QtMsgType convertMsgType(int type); | |
| | | | |
| | | struct Stream { | |
| | | Stream(int type) : ts(&buffer, QIODevice::WriteOnly), ref(1), type( | |
| | | type), output(true) {} | |
| | | | |
| | | QTextStream ts; | |
| | | QString buffer; | |
| | | int ref; | |
| | | int type; | |
| | | bool output; | |
| | | }; | |
| | | | |
| | | Stream *stream; | |
| | | }; | |
| | | | |
| | | //! \internal_end | |
| | | | |
| /*! | | /*! | |
| * \brief Redirects all debugging output from qDebug, qWarning, qCritical a
nd qFatal | | * \brief Redirects all debugging output from qDebug, qWarning, qCritical a
nd qFatal | |
| * to specified file. | | * to specified file. | |
| * \param filename const char* Specifies file name | | * \param filename const char* Specifies file name | |
| * \return true if file was opened successfully | | * \return true if file was opened successfully | |
| */ | | */ | |
| bool mRedirectOutput(const QString &filename); | | bool mRedirectOutput(const QString &filename); | |
| | | | |
| #ifdef QT_NO_DEBUG_OUTPUT | | #ifdef QT_NO_DEBUG_OUTPUT | |
| #define mDebug(x) qDebug() | | #define mDebug(x) qDebug() | |
| | | | |
| skipping to change at line 70 | | skipping to change at line 119 | |
| #ifdef QT_NO_WARNING_OUTPUT | | #ifdef QT_NO_WARNING_OUTPUT | |
| #define mWarning(x) qDebug() | | #define mWarning(x) qDebug() | |
| #else | | #else | |
| | | | |
| /** | | /** | |
| * Returns an object to send warning messages to the message handler. | | * Returns an object to send warning messages to the message handler. | |
| * Use as a replacement for qWarning. Pass the name of the module | | * Use as a replacement for qWarning. Pass the name of the module | |
| * as QString to categorize the output. | | * as QString to categorize the output. | |
| * | | * | |
| * \sa mDebug(const QString &) | | * \sa mDebug(const QString &) | |
|
| | | * \sa mPerformanceWarning(const QString &) | |
| */ | | */ | |
| inline QDebug mWarningStream(const QString &module) | | inline QDebug mWarningStream(const QString &module) | |
| { | | { | |
| // Use qPrintable around QString to avoid "" around it | | // Use qPrintable around QString to avoid "" around it | |
| return qWarning() << qPrintable(QString("%1:").arg(module)); | | return qWarning() << qPrintable(QString("%1:").arg(module)); | |
| } | | } | |
| | | | |
| #define mWarning(x) mWarningStream(x) | | #define mWarning(x) mWarningStream(x) | |
| #endif // QT_NO_WARNING_OUTPUT | | #endif // QT_NO_WARNING_OUTPUT | |
| | | | |
|
| | | #define mPerformanceWarning(x) mPerformanceWarningStream(x) | |
| | | | |
| | | inline MDebug mPerformanceWarningStream(const QString &module) | |
| | | { | |
| | | return MDebug(MDebug::Performance) << qPrintable(QString("%1:").arg(mod | |
| | | ule)); | |
| | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 59 lines changed or added | |
|
| mdialog.h | | mdialog.h | |
| | | | |
| skipping to change at line 564 | | skipping to change at line 564 | |
| /*! | | /*! | |
| * \brief Sets the dialog's title bar icon. | | * \brief Sets the dialog's title bar icon. | |
| * | | * | |
| * \param iconId Logical id of icon to be displayed in title bar. | | * \param iconId Logical id of icon to be displayed in title bar. | |
| * \sa titleBarIconId() | | * \sa titleBarIconId() | |
| */ | | */ | |
| void setTitleBarIconId(const QString &iconId); | | void setTitleBarIconId(const QString &iconId); | |
| | | | |
| public Q_SLOTS: | | public Q_SLOTS: | |
| /*! | | /*! | |
|
| * Shows the dialog on the currently active window and registers it in | | * \brief Shows the dialog on the currently active window or seperately | |
| the | | on its own. | |
| * associated MSceneManager. Uses an animation to show the window. | | | |
| * | | * | |
|
| * If systemModal property is true, it will be displayed as a separate | | * If isSystem() is true, it will be displayed as a separate top level | |
| top level | | * MWindow regardless of whether there's an active window and if isModa | |
| * MWindow regardless of whether there's an active window and the user | | l() | |
| * won't be able to switch to any other application or to the home scre | | * is true as well the user also won't be able to switch to any other | |
| en until | | * application or to the home screen until that dialog is closed | |
| * the dialog is closed (the home button won't be accessible). | | * (the home button won't be accessible). | |
| | | * | |
| | | * \attention If your application has multiple MWindows and isSystem() | |
| | | is false, | |
| | | * usage of this method is strongly discouraged since it can make a dia | |
| | | log | |
| | | * appear in an MWindow different from the intended one. That's due to | |
| | | the fact | |
| | | * that it depends on which MWindow happens to be active when this meth | |
| | | od is called. | |
| | | * In such scenarios use either appear(MWindow*) or appear(QGraphicsSce | |
| | | ne*). | |
| * | | * | |
| * \param policy Deletion policy, defines the ownership for this win
dow | | * \param policy Deletion policy, defines the ownership for this win
dow | |
| * | | * | |
|
| * \sa setSystemModal() | | * \sa isSystem(), isModal() | |
| */ | | */ | |
| virtual void appear(MSceneWindow::DeletionPolicy policy = KeepWhenDone)
; | | virtual void appear(MSceneWindow::DeletionPolicy policy = KeepWhenDone)
; | |
| | | | |
| /*! | | /*! | |
| * Shows the dialog on the window specified by \a window and registers | | * Shows the dialog on the window specified by \a window and registers | |
| * it in the associated MSceneManager. Uses animation to show the dialo
g. | | * it in the associated MSceneManager. Uses animation to show the dialo
g. | |
| * | | * | |
| * If \a window is 0, it functions just like appear() (without window p
arameter). | | * If \a window is 0, it functions just like appear() (without window p
arameter). | |
| * Otherwise it ignores the systemModal property and is displayed as ap
plication | | * Otherwise it ignores the systemModal property and is displayed as ap
plication | |
| * modal. | | * modal. | |
| | | | |
End of changes. 3 change blocks. |
| 10 lines changed or deleted | | 20 lines changed or added | |
|
| mrichtextedit.h | | mrichtextedit.h | |
| | | | |
| skipping to change at line 107 | | skipping to change at line 107 | |
| | | | |
| protected: | | protected: | |
| /*! \reimp */ | | /*! \reimp */ | |
| virtual void keyPressEvent(QKeyEvent *event); | | virtual void keyPressEvent(QKeyEvent *event); | |
| /*! \reimp_end */ | | /*! \reimp_end */ | |
| | | | |
| private: | | private: | |
| Q_DECLARE_PRIVATE(MRichTextEdit) | | Q_DECLARE_PRIVATE(MRichTextEdit) | |
| | | | |
| Q_PRIVATE_SLOT(d_func(), void _q_updateStyle()) | | Q_PRIVATE_SLOT(d_func(), void _q_updateStyle()) | |
|
| | | Q_PRIVATE_SLOT(d_func(), void _q_setFontFamily(const QString &)) | |
| | | Q_PRIVATE_SLOT(d_func(), void _q_setFontSize(int)) | |
| | | Q_PRIVATE_SLOT(d_func(), void _q_setFontColor(const QColor &)) | |
| | | | |
| Q_DISABLE_COPY(MRichTextEdit) | | Q_DISABLE_COPY(MRichTextEdit) | |
| | | | |
| #ifdef UNIT_TEST | | #ifdef UNIT_TEST | |
| friend class Ut_MRichTextEdit; | | friend class Ut_MRichTextEdit; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| #endif //MRichTEXTEDIT_H | | #endif //MRichTEXTEDIT_H | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 3 lines changed or added | |
|