annotate src/UiGuiSettings.cpp @ 768:f3631db17328

Updated all date occurrences to the year 2011. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1045 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Thu, 21 Apr 2011 15:17:51 +0000
parents ac165b6ae67e
children de02d5ea9770
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
1 /***************************************************************************
768
f3631db17328 Updated all date occurrences to the year 2011.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 751
diff changeset
2 * Copyright (C) 2006-2011 by Thomas Schweitzer *
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
3 * thomas-schweitzer(at)arcor.de *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
4 * *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
5 * This program is free software; you can redistribute it and/or modify *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
6 * it under the terms of the GNU General Public License version 2.0 as *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
7 * published by the Free Software Foundation. *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
8 * *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
9 * This program is distributed in the hope that it will be useful, *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
12 * GNU General Public License for more details. *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
13 * *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
14 * You should have received a copy of the GNU General Public License *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
15 * along with this program in the file LICENSE.GPL; if not, write to the *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
16 * Free Software Foundation, Inc., *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
18 ***************************************************************************/
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
19
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
20 #include "UiGuiSettings.h"
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
21
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
22 #include "SettingsPaths.h"
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
23
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
24 #include <QSettings>
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
25 #include <QPoint>
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
26 #include <QSize>
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
27 #include <QDir>
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
28 #include <QDate>
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
29 #include <QStringList>
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
30 #include <QCoreApplication>
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
31 #include <QMetaMethod>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
32 #include <QMetaProperty>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
33 #include <QWidget>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
34
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
35 //! \defgroup grp_Settings All concerning the settings.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
36
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
37 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
38 \class UiGuiSettings
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
39 \ingroup grp_Settings
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
40 \brief Handles the settings of the program. Reads them on startup and saves them on exit.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
41 Is a singleton class and can only be accessed via getInstance().
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
42 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
43
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
44 // Inits the single class instance pointer.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
45 QWeakPointer<UiGuiSettings> UiGuiSettings::_instance;
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
46
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
47
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
48 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
49 \brief The constructor for the settings.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
50 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
51 UiGuiSettings::UiGuiSettings() : QObject() {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
52 // Create the main application settings object from the UniversalIndentGUI.ini file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
53 _qsettings = new QSettings(SettingsPaths::getSettingsPath() + "/UniversalIndentGUI.ini", QSettings::IniFormat, this);
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
54
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
55 _indenterDirctoryStr = SettingsPaths::getGlobalFilesPath() + "/indenters";
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
56 readAvailableTranslations();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
57 initSettings();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
58 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
59
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
60
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
61 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
62 \brief Returns the instance of the settings class. If no instance exists, ONE will be created.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
63 */
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
64 QSharedPointer<UiGuiSettings> UiGuiSettings::getInstance() {
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
65 QSharedPointer<UiGuiSettings> sharedInstance = _instance.toStrongRef();
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
66 if ( sharedInstance.isNull() ) {
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
67 // Create the settings object, which loads all UiGui settings from a file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
68 sharedInstance = QSharedPointer<UiGuiSettings>(new UiGuiSettings());
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
69 _instance = sharedInstance.toWeakRef();
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
70 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
71
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
72 return sharedInstance;
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
73 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
74
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
75
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
76 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
77 \brief The destructor saves the settings to a file.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
78 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
79 UiGuiSettings::~UiGuiSettings() {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
80 // Convert the language setting from an integer index to a string.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
81 int index = _qsettings->value("UniversalIndentGUI/language", 0).toInt();
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
82 if ( index < 0 || index >= _availableTranslations.size() )
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
83 index = 0;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
84
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
85 _qsettings->setValue( "UniversalIndentGUI/language", _availableTranslations.at(index) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
86 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
87
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
88
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
89 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
90 \brief Scans the translations directory for available translation files and
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
91 stores them in the QList \a _availableTranslations.
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
92 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
93 void UiGuiSettings::readAvailableTranslations() {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
94 QString languageShort;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
95 QStringList languageFileList;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
96
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
97 // English is the default language. A translation file does not exist but to have a menu entry, added here.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
98 languageFileList << "universalindent_en.qm";
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
99
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
100 // Find all translation files in the "translations" directory.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
101 QDir translationDirectory = QDir( SettingsPaths::getGlobalFilesPath() + "/translations" );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
102 languageFileList << translationDirectory.entryList( QStringList("universalindent_*.qm") );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
103
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
104 // Loop for each found translation file
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
105 foreach ( languageShort, languageFileList ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
106 // Remove the leading string "universalindent_" from the filename.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
107 languageShort.remove(0,16);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
108 // Remove trailing file extension ".qm".
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
109 languageShort.chop(3);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
110
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
111 _availableTranslations.append(languageShort);
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
112 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
113 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
114
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
115
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
116 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
117 \brief Returns a list of the mnemonics of the available translations.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
118 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
119 QStringList UiGuiSettings::getAvailableTranslations() {
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
120 return _availableTranslations;
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
121 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
122
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
123
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
124 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
125 \brief Returns the value of the by \a settingsName defined setting as QVariant.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
126
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
127 If the named setting does not exist, 0 is being returned.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
128 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
129 QVariant UiGuiSettings::getValueByName(QString settingName) {
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
130 return _qsettings->value("UniversalIndentGUI/" + settingName);
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
131 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
132
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
133
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
134 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
135 \brief Loads the settings for the main application.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
136
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
137 Settings are for example last selected indenter, last loaded source code file and so on.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
138 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
139 bool UiGuiSettings::initSettings()
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
140 {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
141 // Read the version string saved in the settings file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
142 _qsettings->setValue( "UniversalIndentGUI/version", _qsettings->value("UniversalIndentGUI/version", "") );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
143
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
144 // Read windows last size and position from the settings file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
145 _qsettings->setValue( "UniversalIndentGUI/maximized", _qsettings->value("UniversalIndentGUI/maximized", false) );
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
146 _qsettings->setValue( "UniversalIndentGUI/position", _qsettings->value("UniversalIndentGUI/position", QPoint(50, 50)) );
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
147 _qsettings->setValue( "UniversalIndentGUI/size", _qsettings->value("UniversalIndentGUI/size", QSize(800, 600)) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
148
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
149 // Read last selected encoding for the opened source code file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
150 _qsettings->setValue( "UniversalIndentGUI/encoding", _qsettings->value("UniversalIndentGUI/encoding", "UTF-8") );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
151
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
152 // Read maximum length of list for recently opened files.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
153 _qsettings->setValue( "UniversalIndentGUI/recentlyOpenedListSize", _qsettings->value("UniversalIndentGUI/recentlyOpenedListSize", 5) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
154
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
155 // Read if last opened source code file should be loaded on startup.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
156 _qsettings->setValue( "UniversalIndentGUI/loadLastSourceCodeFileOnStartup", _qsettings->value("UniversalIndentGUI/loadLastSourceCodeFileOnStartup", true) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
157
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
158 // Read last opened source code file from the settings file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
159 _qsettings->setValue( "UniversalIndentGUI/lastSourceCodeFile", _qsettings->value("UniversalIndentGUI/lastSourceCodeFile", _indenterDirctoryStr+"/example.cpp") );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
160
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
161 // Read last selected indenter from the settings file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
162 int selectedIndenter = _qsettings->value("UniversalIndentGUI/selectedIndenter", 0).toInt();
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
163 if ( selectedIndenter < 0 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
164 selectedIndenter = 0;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
165 }
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
166 _qsettings->setValue( "UniversalIndentGUI/selectedIndenter", selectedIndenter );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
167
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
168 // Read if syntax highlighting is enabled.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
169 _qsettings->setValue( "UniversalIndentGUI/SyntaxHighlightingEnabled", _qsettings->value("UniversalIndentGUI/SyntaxHighlightingEnabled", true) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
170
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
171 // Read if white space characters should be displayed.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
172 _qsettings->setValue( "UniversalIndentGUI/whiteSpaceIsVisible", _qsettings->value("UniversalIndentGUI/whiteSpaceIsVisible", false) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
173
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
174 // Read if indenter parameter tool tips are enabled.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
175 _qsettings->setValue( "UniversalIndentGUI/indenterParameterTooltipsEnabled", _qsettings->value("UniversalIndentGUI/indenterParameterTooltipsEnabled", true) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
176
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
177 // Read the tab width from the settings file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
178 _qsettings->setValue( "UniversalIndentGUI/tabWidth", _qsettings->value("UniversalIndentGUI/tabWidth", 4) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
179
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
180 // Read the last selected language and stores the index it has in the list of available translations.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
181 _qsettings->setValue( "UniversalIndentGUI/language", _availableTranslations.indexOf( _qsettings->value("UniversalIndentGUI/language", "").toString() ) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
182
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
183 // Read the update check settings from the settings file.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
184 _qsettings->setValue( "UniversalIndentGUI/CheckForUpdate", _qsettings->value("UniversalIndentGUI/CheckForUpdate", true) );
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
185 _qsettings->setValue( "UniversalIndentGUI/LastUpdateCheck", _qsettings->value("UniversalIndentGUI/LastUpdateCheck", QDate(1900,1,1)) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
186
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
187 // Read the main window state.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
188 _qsettings->setValue( "UniversalIndentGUI/MainWindowState", _qsettings->value("UniversalIndentGUI/MainWindowState", QByteArray()) );
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
189
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
190 return true;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
191 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
192
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
193
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
194 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
195 \brief Register the by \a propertyName defined property of \a obj to be connected to the setting defined by \a settingName.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
196
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
197 The \a propertyName must be one of those that are listed in the Qt "Properties" documentation section of a Qt Object.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
198 All further needed info is retrieved via the \a obj's MetaObject, like the to the property bound signal.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
199 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
200 bool UiGuiSettings::registerObjectProperty( QObject *obj, const QString &propertyName, const QString &settingName )
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
201 {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
202 const QMetaObject *metaObject = obj->metaObject();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
203 bool connectSuccess = false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
204
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
205 // Connect to the objects destroyed signal, so that it will be correctly unregistered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
206 connectSuccess = connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*)));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
207
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
208 int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
209 if ( connectSuccess && indexOfProp > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
210 QMetaProperty mProp = metaObject->property(indexOfProp);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
211
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
212 // Connect to the property's value changed signal.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
213 if ( mProp.hasNotifySignal() ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
214 QMetaMethod signal = mProp.notifySignal();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
215 //QString teststr = qPrintable(SIGNAL() + QString(signal.signature()));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
216 // The command "SIGNAL() + QString(signal.signature())" assembles the signal methods signature to a valid Qt SIGNAL.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
217 connectSuccess = connect(obj, qPrintable(SIGNAL() + QString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
218 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
219
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
220 if ( connectSuccess ) {
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
221 _registeredObjectProperties[obj] = QStringList() << propertyName << settingName;
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
222 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
223 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
224 //TODO: Write a debug warning to the log.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
225 disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*)));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
226 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
227 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
228
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
229 // If setting already exists, set the objects property to the setting value.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
230 if ( _qsettings->contains("UniversalIndentGUI/" + settingName) ) {
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
231 mProp.write(obj, _qsettings->value("UniversalIndentGUI/" + settingName));
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
232 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
233 // Otherwise add the setting and set it to the value of the objects property.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
234 else {
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
235 _qsettings->setValue("UniversalIndentGUI/" + settingName, mProp.read(obj));
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
236 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
237 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
238 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
239 //TODO: Write a debug warning to the log.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
240 disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*)));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
241 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
242 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
243
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
244 return true;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
245 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
246
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
247
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
248 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
249 \brief Searches the child QObjects of \a obj for a property name and setting name definition within
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
250 their custom properties and registers this property name to that setting name if both were found.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
251
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
252 The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
253 where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
254 "connectedSettingName" is the name of a setting here within UiGuiSettings. If the mentioned setting
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
255 name doesn't exist, it will be created.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
256
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
257 Returns true, if all found property and setting definitions could be successfully registered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
258 Returns false, if any of those registrations fails.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
259 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
260 bool UiGuiSettings::registerObjectPropertyRecursive(QObject *obj) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
261 return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::registerObjectProperty);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
262 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
263
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
264
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
265 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
266 \brief Assigns the by \a settingName defined setting value to the by \a propertyName defined property of \a obj.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
267
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
268 Returns true, if the value could be assigned, otherwise returns false, which is the case if settingName doesn't exist
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
269 within the settings or if the mentioned propertyName wasn't found for the \a obj.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
270 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
271 bool UiGuiSettings::setObjectPropertyToSettingValue( QObject *obj, const QString &propertyName, const QString &settingName )
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
272 {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
273 const QMetaObject *metaObject = obj->metaObject();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
274
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
275 int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
276 if ( indexOfProp > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
277 QMetaProperty mProp = metaObject->property(indexOfProp);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
278
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
279 // If setting already exists, set the objects property to the setting value.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
280 if ( _qsettings->contains("UniversalIndentGUI/" + settingName) ) {
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
281 mProp.write(obj, _qsettings->value("UniversalIndentGUI/" + settingName));
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
282 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
283 // The setting didn't exist so return that setting the objects property failed.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
284 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
285 //TODO: Write a debug warning to the log.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
286 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
287 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
288 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
289 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
290 //TODO: Write a debug warning to the log.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
291 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
292 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
293
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
294 return true;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
295 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
296
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
297
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
298 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
299 \brief Searches the child QObjects of \a obj for a property name and setting name definition within
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
300 their custom properties and sets each property to settings value.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
301
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
302 The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
303 where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
304 "connectedSettingName" is the name of a setting here within UiGuiSettings.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
305
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
306 Returns true, if all found property and setting definitions could be successfully registered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
307 Returns false, if any of those registrations fails.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
308 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
309 bool UiGuiSettings::setObjectPropertyToSettingValueRecursive(QObject *obj) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
310 return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setObjectPropertyToSettingValue);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
311 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
312
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
313
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
314 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
315 \brief Assigns the by \a propertyName defined property's value of \a obj to the by \a settingName defined setting.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
316
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
317 If the \a settingName didn't exist yet, it will be created.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
318
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
319 Returns true, if the value could be assigned, otherwise returns false, which is the case if the mentioned
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
320 propertyName wasn't found for the \a obj.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
321 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
322 bool UiGuiSettings::setSettingToObjectPropertyValue( QObject *obj, const QString &propertyName, const QString &settingName )
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
323 {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
324 const QMetaObject *metaObject = obj->metaObject();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
325
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
326 int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
327 if ( indexOfProp > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
328 QMetaProperty mProp = metaObject->property(indexOfProp);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
329
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
330 setValueByName(settingName, mProp.read(obj));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
331 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
332 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
333 //TODO: Write a debug warning to the log.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
334 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
335 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
336
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
337 return true;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
338 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
339
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
340
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
341 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
342 \brief Searches the child QObjects of \a obj for a property name and setting name definition within
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
343 their custom properties and sets each setting to the property value.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
344
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
345 The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
346 where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
347 "connectedSettingName" is the name of a setting here within UiGuiSettings. If the settingName
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
348 didn't exist yet, it will be created.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
349
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
350 Returns true, if all found property and setting definitions could be successfully registered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
351 Returns false, if any of those registrations fails.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
352 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
353 bool UiGuiSettings::setSettingToObjectPropertyValueRecursive(QObject *obj) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
354 return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setSettingToObjectPropertyValue);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
355 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
356
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
357
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
358 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
359 \brief Iterates over all \a objs child QObjects and checks whether they have the custom properties
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
360 "connectedPropertyName" and "connectedSettingName" set. If both are set, it invokes the \a callBackFunc
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
361 with both.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
362 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
363 bool UiGuiSettings::checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiGuiSettings::*callBackFunc)(QObject *obj, const QString &propertyName, const QString &settingName)) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
364 bool success = true;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
365
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
366 // Find all widgets that have PropertyName and SettingName defined in their style sheet.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
367 QList<QObject *> allObjects = obj->findChildren<QObject *>();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
368 foreach (QObject *object, allObjects) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
369 QString propertyName = object->property("connectedPropertyName").toString();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
370 QString settingName = object->property("connectedSettingName").toString();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
371
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
372 // If property and setting name were found, register that widget with the settings.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
373 if ( !propertyName.isEmpty() && !settingName.isEmpty() ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
374 success &= (this->*callBackFunc)( object, propertyName, settingName );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
375 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
376 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
377
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
378 return success;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
379 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
380
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
381
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
382 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
383 \brief The with a certain property registered \a obj gets unregistered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
384 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
385 void UiGuiSettings::unregisterObjectProperty(QObject *obj) {
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
386 if ( _registeredObjectProperties.contains(obj) ) {
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
387 const QMetaObject *metaObject = obj->metaObject();
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
388 QString propertyName = _registeredObjectProperties[obj].first();
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
389 QString settingName = _registeredObjectProperties[obj].last();
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
390
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
391 bool connectSuccess = false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
392 int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
393 if ( indexOfProp > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
394 QMetaProperty mProp = metaObject->property(indexOfProp);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
395
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
396 // Disconnect to the property's value changed signal.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
397 if ( mProp.hasNotifySignal() ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
398 QMetaMethod signal = mProp.notifySignal();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
399 // The command "SIGNAL() + QString(signal.signature())" assembles the signal methods signature to a valid Qt SIGNAL.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
400 connectSuccess = disconnect(obj, qPrintable(SIGNAL() + QString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
401 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
402 }
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
403 _registeredObjectProperties.remove(obj);
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
404 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
405 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
406
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
407
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
408 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
409 \brief Registers a slot form the \a obj by its \a slotName to be invoked, if the by \a settingName defined
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
410 setting changes.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
411
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
412 The registered slot may have no parameters or exactly one. If it accepts one parameter, whenever the setting
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
413 \a settingName changes the slot gets tried to be invoked with the settings value as parameter. This only works,
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
414 if the slot parameter is of the same type as the setting.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
415 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
416 bool UiGuiSettings::registerObjectSlot(QObject *obj, const QString &slotName, const QString &settingName) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
417
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
418 const QMetaObject *metaObject = obj->metaObject();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
419
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
420 bool connectSuccess = false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
421 // Connect to the objects destroyed signal, so that it will be correctly unregistered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
422 connectSuccess = connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*)));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
423
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
424 QString normalizedSlotName = QMetaObject::normalizedSignature( qPrintable(slotName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
425 int indexOfMethod = metaObject->indexOfMethod( qPrintable(normalizedSlotName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
426 if ( connectSuccess && indexOfMethod > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
427 QMetaMethod mMethod = metaObject->method(indexOfMethod);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
428 QMetaMethod::Access access = mMethod.access();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
429 QMetaMethod::MethodType methType = mMethod.methodType();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
430
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
431 // Since the method can at maximum be invoked with the setting value as argument,
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
432 // only methods taking max one argument are allowed.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
433 if ( mMethod.parameterTypes().size() <= 1 ) {
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
434 _registeredObjectSlots.insert(obj, QStringList() << normalizedSlotName << settingName);
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
435 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
436 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
437 //TODO: Write a debug warning to the log.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
438 disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*)));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
439 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
440 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
441 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
442 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
443 //TODO: Write a debug warning to the log.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
444 disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*)));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
445 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
446 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
447
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
448 return true;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
449 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
450
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
451
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
452 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
453 \brief If \a obj, \a slotName and \a settingName are given, that certain connection is unregistered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
454 If only \a obj is given, all to this object registered slot-setting connections are unregistered.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
455 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
456 void UiGuiSettings::unregisterObjectSlot(QObject *obj, const QString &slotName, const QString &settingName) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
457 const QMetaObject *metaObject = obj->metaObject();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
458 QString normalizedSlotName = QMetaObject::normalizedSignature( qPrintable(slotName) );
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
459 QMutableMapIterator<QObject*, QStringList> it(_registeredObjectSlots);
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
460 while (it.hasNext()) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
461 it.next();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
462 if (it.key() == obj && slotName.isEmpty() && settingName.isEmpty())
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
463 it.remove();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
464 else if (it.key() == obj && it.value().first() == slotName && it.value().last() == settingName)
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
465 it.remove();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
466 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
467 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
468
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
469
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
470 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
471 \brief This private slot gets invoked whenever a registered objects property changes
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
472 and distributes the new value to all other to the same settingName registered objects.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
473 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
474 void UiGuiSettings::handleObjectPropertyChange() {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
475 QObject *obj = QObject::sender();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
476 QString className = obj->metaObject()->className();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
477 const QMetaObject *metaObject = obj->metaObject();
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
478 QString propertyName = _registeredObjectProperties[obj].first();
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
479 QString settingName = _registeredObjectProperties[obj].last();
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
480
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
481 int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
482 if ( indexOfProp > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
483 QMetaProperty mProp = metaObject->property(indexOfProp);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
484 setValueByName(settingName, mProp.read(obj));
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
485 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
486 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
487
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
488
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
489 /*!
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
490 \brief Sets the setting defined by \a settingName to \a value.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
491
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
492 When setting a changed value, all to this settingName registered objects get
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
493 the changed value set too.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
494 If the \a settingName didn't exist yet, it will be created.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
495 */
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
496 void UiGuiSettings::setValueByName(const QString &settingName, const QVariant &value) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
497 // Do the updating only, if the setting was really changed.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
498 if ( _qsettings->value("UniversalIndentGUI/" + settingName) != value ) {
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
499 _qsettings->setValue("UniversalIndentGUI/" + settingName, value);
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
500
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
501 // Set the new value for all registered object properties for settingName.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
502 for ( QMap<QObject*, QStringList>::ConstIterator it = _registeredObjectProperties.begin(); it != _registeredObjectProperties.end(); ++it ) {
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
503 if ( it.value().last() == settingName ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
504 QObject *obj = it.key();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
505 const QMetaObject *metaObject = obj->metaObject();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
506 QString propertyName = it.value().first();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
507
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
508 int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
509 if ( indexOfProp > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
510 QMetaProperty mProp = metaObject->property(indexOfProp);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
511 mProp.write(obj, value);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
512 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
513 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
514 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
515
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
516 // Invoke all registered object methods for settingName.
751
ac165b6ae67e Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 731
diff changeset
517 for ( QMap<QObject*, QStringList>::ConstIterator it = _registeredObjectSlots.begin(); it != _registeredObjectSlots.end(); ++it ) {
731
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
518 if ( it.value().last() == settingName ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
519 QObject *obj = it.key();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
520 const QMetaObject *metaObject = obj->metaObject();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
521 QString slotName = it.value().first();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
522
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
523 int indexOfMethod = metaObject->indexOfMethod( qPrintable(slotName) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
524 if ( indexOfMethod > -1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
525 QMetaMethod mMethod = metaObject->method(indexOfMethod);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
526 QMetaMethod::Access access = mMethod.access();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
527 QMetaMethod::MethodType methType = mMethod.methodType();
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
528
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
529 bool success = false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
530
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
531 // Handle registered slots taking one parameter.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
532 if ( mMethod.parameterTypes().size() == 1 ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
533 if ( mMethod.parameterTypes().first() == value.typeName() ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
534 success = invokeMethodWithValue(obj, mMethod, value);
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
535 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
536 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
537 // Handle registered slots taking zero parameters.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
538 else {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
539 success = mMethod.invoke( obj, Qt::DirectConnection );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
540 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
541
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
542 if ( success == false ) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
543 // TODO: Write a warning to the log if no success.
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
544 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
545 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
546 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
547 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
548 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
549 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
550
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
551
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
552 #include <QBitArray>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
553 #include <QBitmap>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
554 #include <QBrush>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
555 #include <QCursor>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
556 #include <QDateTime>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
557 #include <QFont>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
558 #include <QIcon>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
559 #include <QKeySequence>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
560 #include <QLocale>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
561 #include <QPalette>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
562 #include <QPen>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
563 #include <QSizePolicy>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
564 #include <QTextFormat>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
565 #include <QTextLength>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
566 #include <QUrl>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
567 #if QT_VERSION >= 0x040600
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
568 #include <QMatrix4x4>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
569 #include <QVector2D>
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
570 #endif
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
571
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
572 bool UiGuiSettings::invokeMethodWithValue( QObject *obj, QMetaMethod mMethod, QVariant value )
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
573 {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
574 switch (value.type()) {
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
575 case QVariant::BitArray :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
576 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBitArray, value.toBitArray()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
577 case QVariant::Bitmap :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
578 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBitmap, value.value<QBitmap>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
579 case QVariant::Bool :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
580 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(bool, value.toBool()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
581 case QVariant::Brush :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
582 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBrush, value.value<QBrush>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
583 case QVariant::ByteArray :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
584 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QByteArray, value.toByteArray()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
585 case QVariant::Char :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
586 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QChar, value.toChar()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
587 case QVariant::Color :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
588 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QColor, value.value<QColor>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
589 case QVariant::Cursor :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
590 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QCursor, value.value<QCursor>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
591 case QVariant::Date :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
592 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QDate, value.toDate()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
593 case QVariant::DateTime :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
594 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QDateTime, value.toDateTime()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
595 case QVariant::Double :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
596 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(double, value.toDouble()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
597 case QVariant::Font :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
598 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QFont, value.value<QFont>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
599 case QVariant::Hash :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
600 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantHash, value.toHash()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
601 case QVariant::Icon :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
602 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QIcon, value.value<QIcon>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
603 case QVariant::Image :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
604 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QImage, value.value<QImage>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
605 case QVariant::Int :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
606 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(int, value.toInt()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
607 case QVariant::KeySequence :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
608 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QKeySequence, value.value<QKeySequence>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
609 case QVariant::Line :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
610 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLine, value.toLine()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
611 case QVariant::LineF :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
612 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLineF, value.toLineF()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
613 case QVariant::List :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
614 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantList, value.toList()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
615 case QVariant::Locale :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
616 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLocale, value.toLocale()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
617 case QVariant::LongLong :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
618 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(qlonglong, value.toLongLong()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
619 case QVariant::Map :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
620 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantMap, value.toMap()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
621 case QVariant::Matrix :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
622 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QMatrix, value.value<QMatrix>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
623 case QVariant::Transform :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
624 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTransform, value.value<QTransform>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
625 #if QT_VERSION >= 0x040600
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
626 case QVariant::Matrix4x4 :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
627 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QMatrix4x4, value.value<QMatrix4x4>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
628 #endif
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
629 case QVariant::Palette :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
630 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPalette, value.value<QPalette>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
631 case QVariant::Pen :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
632 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPen, value.value<QPen>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
633 case QVariant::Pixmap :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
634 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPixmap, value.value<QPixmap>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
635 case QVariant::Point :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
636 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPoint, value.toPoint()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
637 // case QVariant::PointArray :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
638 // return Q_ARG(QPointArray, value.value<QPointArray>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
639 case QVariant::PointF :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
640 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPointF, value.toPointF()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
641 case QVariant::Polygon :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
642 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPolygon, value.value<QPolygon>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
643 #if QT_VERSION >= 0x040600
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
644 case QVariant::Quaternion :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
645 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QQuaternion, value.value<QQuaternion>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
646 #endif
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
647 case QVariant::Rect :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
648 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRect, value.toRect()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
649 case QVariant::RectF :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
650 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRectF, value.toRectF()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
651 case QVariant::RegExp :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
652 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRegExp, value.toRegExp()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
653 case QVariant::Region :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
654 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRegion, value.value<QRegion>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
655 case QVariant::Size :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
656 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSize, value.toSize()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
657 case QVariant::SizeF :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
658 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSizeF, value.toSizeF()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
659 case QVariant::SizePolicy :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
660 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSizePolicy, value.value<QSizePolicy>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
661 case QVariant::String :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
662 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QString, value.toString()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
663 case QVariant::StringList :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
664 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QStringList, value.toStringList()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
665 case QVariant::TextFormat :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
666 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTextFormat, value.value<QTextFormat>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
667 case QVariant::TextLength :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
668 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTextLength, value.value<QTextLength>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
669 case QVariant::Time :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
670 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTime, value.toTime()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
671 case QVariant::UInt :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
672 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(uint, value.toUInt()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
673 case QVariant::ULongLong :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
674 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(qulonglong, value.toULongLong()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
675 case QVariant::Url :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
676 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QUrl, value.toUrl()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
677 #if QT_VERSION >= 0x040600
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
678 case QVariant::Vector2D :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
679 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector2D, value.value<QVector2D>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
680 case QVariant::Vector3D :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
681 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector3D, value.value<QVector3D>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
682 case QVariant::Vector4D :
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
683 return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector4D, value.value<QVector4D>()) );
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
684 #endif
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
685 default:
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
686 return false;
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
687 }
ca1bafc93ee2 Drastically simplified the connection between QObject properties and the settings. Thus the UiGuiSettingsDialog widgets do no longer need to have a special object name. Instead they need custom properties "connectedPropertyName" and "connectedSettingName" set, which then can be used to create the connection to the setting.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 728
diff changeset
688 }