Changeset View
Changeset View
Standalone View
Standalone View
src/mainwindow.h
Show All 33 Lines | |||||
34 | /** | 34 | /** | ||
35 | * A KPart-aware main window, whose user interface is described in XML. | 35 | * A KPart-aware main window, whose user interface is described in XML. | ||
36 | * | 36 | * | ||
37 | * It implements all internal interfaces in the case of a | 37 | * It implements all internal interfaces in the case of a | ||
38 | * KMainWindow as host: the builder and servant interface (for menu | 38 | * KMainWindow as host: the builder and servant interface (for menu | ||
39 | * merging). | 39 | * merging). | ||
40 | * | 40 | * | ||
41 | * Inherit your main window from this class | 41 | * Inherit your main window from this class | ||
42 | * and don't forget to call setupGUI() before you call createGUI() | 42 | * and make sure to call @c setXMLFile() and @c setupGUI() before you | ||
43 | * on the KPart. For example: | 43 | * call @c createGUI() on the KPart. | ||
44 | * | 44 | * | ||
45 | * For example: | ||||
45 | * \code | 46 | * \code | ||
46 | * setCentralWidget(m_part->widget()); | 47 | * setCentralWidget(m_part->widget()); | ||
47 | * setupGUI(ToolBar | Keys | StatusBar | Save, "appui.rc"); | 48 | * setXMLFile(QStringLiteral("appui.rc")); | ||
49 | * setupGUI(ToolBar | Keys | StatusBar | Save); // Never Create flag here | ||||
48 | * createGUI(m_part); | 50 | * createGUI(m_part); | ||
49 | * \endcode | 51 | * \endcode | ||
50 | * | 52 | * | ||
51 | * @warning you should not pass the Default flag to setupGUI(), since it contains | 53 | * @warning You should not pass the @c Default flag set to @c setupGUI(), | ||
52 | * the Create flag that is not supposed to be used from this class. | 54 | * since it contains the @c Create flag, which is not supposed to be used | ||
53 | * @see setupGUI, @see createGUI | 55 | * from this class. | ||
56 | * @see KXmlGuiWindow::Create, @see setupGUI, @see createGUI | ||||
54 | * | 57 | * | ||
55 | */ | 58 | */ | ||
56 | class KPARTS_EXPORT MainWindow : public KXmlGuiWindow, virtual public PartBase | 59 | class KPARTS_EXPORT MainWindow : public KXmlGuiWindow, virtual public PartBase | ||
57 | { | 60 | { | ||
58 | Q_OBJECT | 61 | Q_OBJECT | ||
59 | public: | 62 | public: | ||
60 | /** | 63 | /** | ||
61 | * Constructor, same signature as KMainWindow. | 64 | * Constructor, same signature as KMainWindow. | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |