CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Loading...
Searching...
No Matches
ctkSettings.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Library: CTK
4
5 Copyright (c) Kitware Inc.
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0.txt
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19=========================================================================*/
20/*=========================================================================
21
22 Program: ParaView
23 Module: pqSettings.h
24
25 Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
26 All rights reserved.
27
28 ParaView is a free software; you can redistribute it and/or modify it
29 under the terms of the ParaView license version 1.2.
30
31 See http://www.paraview.org/paraview/project/license.html for the full ParaView license.
32 A copy of this license can be obtained by contacting
33 Kitware Inc.
34 28 Corporate Drive
35 Clifton Park, NY 12065
36 USA
37
38THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
42CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
43EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
44PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
45PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
47NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
48SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
50=========================================================================*/
51
55
56#ifndef __ctkSettings_h
57#define __ctkSettings_h
58
59// Qt includes
60#include <QSettings>
61
62// CTK includes
63#include "ctkWidgetsExport.h"
64
65class QDialog;
66class QMainWindow;
67
71class CTK_WIDGETS_EXPORT ctkSettings : public QSettings
72{
73 Q_OBJECT
74
75public:
78 const QString& organization,
79 const QString& application,
80 QObject* parent = 0);
83 QSettings::Scope scope,
84 const QString& organization,
85 const QString& application = QString(),
86 QObject* parent = 0);
89 QSettings::Format format,
90 QSettings::Scope scope,
91 const QString& organization,
92 const QString& application = QString(),
93 QObject* parent = 0);
95 ctkSettings(const QString& fileName, QSettings::Format format, QObject* parent = 0);
97 ctkSettings(QObject* parent = 0);
98
100 Q_INVOKABLE void saveState(const QMainWindow& window, const QString& key);
101
103 Q_INVOKABLE void saveState(const QDialog& dialog, const QString& key);
104
107 Q_INVOKABLE void restoreState(const QString& key, QMainWindow& window);
108
111 Q_INVOKABLE void restoreState(const QString& key, QDialog& dialog);
112
114 Q_INVOKABLE void alertSettingsModified();
115
116Q_SIGNALS:
117 void modified();
118};
119
120#endif
Q_INVOKABLE void restoreState(const QString &key, QDialog &dialog)
Q_INVOKABLE void saveState(const QMainWindow &window, const QString &key)
Saves the position, size and layout of the QMainWindow.
ctkSettings(const QString &fileName, QSettings::Format format, QObject *parent=0)
ctkSettings(QSettings::Format format, QSettings::Scope scope, const QString &organization, const QString &application=QString(), QObject *parent=0)
void modified()
ctkSettings(QSettings::Scope scope, const QString &organization, const QString &application=QString(), QObject *parent=0)
Q_INVOKABLE void alertSettingsModified()
Calling this method will cause the modified signal to be emited.
Q_INVOKABLE void restoreState(const QString &key, QMainWindow &window)
Q_INVOKABLE void saveState(const QDialog &dialog, const QString &key)
Saves the position and size of the QDialog.
ctkSettings(QObject *parent=0)
ctkSettings(const QString &organization, const QString &application, QObject *parent=0)