Changeset View
Changeset View
Standalone View
Standalone View
examples/window.cpp
Show All 12 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
13 | 13 | | |||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "window.h" | 20 | #include "window.h" | ||
21 | #include "designerwindow.h" | 21 | #include "DesignerWidget.h" | ||
22 | 22 | | |||
23 | #include <KReportRenderObjects> | 23 | #include <KReportRenderObjects> | ||
24 | #include <KReportPluginManager> | 24 | #include <KReportPluginManager> | ||
25 | #include <KReportRendererBase> | 25 | #include <KReportRendererBase> | ||
26 | 26 | | |||
27 | #include <QApplication> | 27 | #include <QApplication> | ||
28 | #include <QDebug> | 28 | #include <QDebug> | ||
29 | #include <QFile> | 29 | #include <QFile> | ||
Show All 28 Lines | 52 | #if 0 | |||
58 | } | 58 | } | ||
59 | #endif | 59 | #endif | ||
60 | 60 | | |||
61 | KReportPluginManager* manager = KReportPluginManager::self(); | 61 | KReportPluginManager* manager = KReportPluginManager::self(); | ||
62 | //! @todo | 62 | //! @todo | ||
63 | Q_UNUSED(manager); | 63 | Q_UNUSED(manager); | ||
64 | 64 | | |||
65 | // restore visual settings | 65 | // restore visual settings | ||
66 | QSettings settings("org.kde.kreport", "KReportExample"); | 66 | QSettings settings("org.kde.kreport", "KReportExample"); | ||
piggz: Better to use QCoreApplication::setOrganisationName() etc ?
eg http://doc.qt.io/qt-5/qsettings. | |||||
staniek: Right, doing that now. Thanks. | |||||
67 | restoreGeometry(settings.value("MainWindow/geometry").toByteArray()); | 67 | restoreGeometry(settings.value("MainWindow/geometry").toByteArray()); | ||
68 | restoreState(settings.value("MainWindow/windowState").toByteArray()); | 68 | restoreState(settings.value("MainWindow/windowState").toByteArray()); | ||
69 | 69 | | |||
70 | showDesign(m_designerWidget->document()); | 70 | showDesign(m_designerWidget->document()); | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | Window::~Window() | 73 | Window::~Window() | ||
74 | { | 74 | { | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |
Better to use QCoreApplication::setOrganisationName() etc ?
eg http://doc.qt.io/qt-5/qsettings.html#details
Then just call
QSettings settings;