summaryrefslogtreecommitdiffstats
path: root/src/UiGuiSettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/UiGuiSettings.cpp')
-rwxr-xr-xsrc/UiGuiSettings.cpp440
1 files changed, 220 insertions, 220 deletions
diff --git a/src/UiGuiSettings.cpp b/src/UiGuiSettings.cpp
index 5d8349b..084b399 100755
--- a/src/UiGuiSettings.cpp
+++ b/src/UiGuiSettings.cpp
@@ -21,16 +21,16 @@
#include "SettingsPaths.h"
-#include <tqsettings.h>
-#include <tqpoint.h>
-#include <tqsize.h>
-#include <tqdir.h>
+#include <tntqsettings.h>
+#include <tntqpoint.h>
+#include <tntqsize.h>
+#include <tntqdir.h>
#include <tqdate.h>
-#include <tqstringlist.h>
+#include <tntqstringlist.h>
#include <tqcoreapplication.h>
#include <tqmetamethod.h>
#include <tqmetaproperty.h>
-#include <tqwidget.h>
+#include <tntqwidget.h>
//! \defgroup grp_Settings All concerning the settings.
@@ -42,15 +42,15 @@
*/
// Inits the single class instance pointer.
-QWeakPointer<UiGuiSettings> UiGuiSettings::_instance;
+TQWeakPointer<UiGuiSettings> UiGuiSettings::_instance;
/*!
\brief The constructor for the settings.
*/
-UiGuiSettings::UiGuiSettings() : QObject() {
+UiGuiSettings::UiGuiSettings() : TQObject() {
// Create the main application settings object from the UniversalIndentGUI.ini file.
- _qsettings = new QSettings(SettingsPaths::getSettingsPath() + "/UniversalIndentGUI.ini", QSettings::IniFormat, this);
+ _qsettings = new TQSettings(SettingsPaths::getSettingsPath() + "/UniversalIndentGUI.ini", TQSettings::IniFormat, this);
_indenterDirctoryStr = SettingsPaths::getGlobalFilesPath() + "/indenters";
readAvailableTranslations();
@@ -61,11 +61,11 @@ UiGuiSettings::UiGuiSettings() : QObject() {
/*!
\brief Returns the instance of the settings class. If no instance exists, ONE will be created.
*/
-QSharedPointer<UiGuiSettings> UiGuiSettings::getInstance() {
- QSharedPointer<UiGuiSettings> sharedInstance = _instance.toStrongRef();
+TQSharedPointer<UiGuiSettings> UiGuiSettings::getInstance() {
+ TQSharedPointer<UiGuiSettings> sharedInstance = _instance.toStrongRef();
if ( sharedInstance.isNull() ) {
// Create the settings object, which loads all UiGui settings from a file.
- sharedInstance = QSharedPointer<UiGuiSettings>(new UiGuiSettings());
+ sharedInstance = TQSharedPointer<UiGuiSettings>(new UiGuiSettings());
_instance = sharedInstance.toWeakRef();
}
@@ -88,18 +88,18 @@ UiGuiSettings::~UiGuiSettings() {
/*!
\brief Scans the translations directory for available translation files and
- stores them in the QList \a _availableTranslations.
+ stores them in the TQList \a _availableTranslations.
*/
void UiGuiSettings::readAvailableTranslations() {
- QString languageShort;
- QStringList languageFileList;
+ TQString languageShort;
+ TQStringList languageFileList;
// English is the default language. A translation file does not exist but to have a menu entry, added here.
languageFileList << "universalindent_en.qm";
// Find all translation files in the "translations" directory.
- QDir translationDirectory = QDir( SettingsPaths::getGlobalFilesPath() + "/translations" );
- languageFileList << translationDirectory.entryList( QStringList("universalindent_*.qm") );
+ TQDir translationDirectory = TQDir( SettingsPaths::getGlobalFilesPath() + "/translations" );
+ languageFileList << translationDirectory.entryList( TQStringList("universalindent_*.qm") );
// Loop for each found translation file
foreach ( languageShort, languageFileList ) {
@@ -116,17 +116,17 @@ void UiGuiSettings::readAvailableTranslations() {
/*!
\brief Returns a list of the mnemonics of the available translations.
*/
-QStringList UiGuiSettings::getAvailableTranslations() {
+TQStringList UiGuiSettings::getAvailableTranslations() {
return _availableTranslations;
}
/*!
- \brief Returns the value of the by \a settingsName defined setting as QVariant.
+ \brief Returns the value of the by \a settingsName defined setting as TQVariant.
If the named setting does not exist, 0 is being returned.
*/
-QVariant UiGuiSettings::getValueByName(QString settingName) {
+TQVariant UiGuiSettings::getValueByName(TQString settingName) {
return _qsettings->value("UniversalIndentGUI/" + settingName);
}
@@ -143,8 +143,8 @@ bool UiGuiSettings::initSettings()
// Read windows last size and position from the settings file.
_qsettings->setValue( "UniversalIndentGUI/maximized", _qsettings->value("UniversalIndentGUI/maximized", false) );
- _qsettings->setValue( "UniversalIndentGUI/position", _qsettings->value("UniversalIndentGUI/position", QPoint(50, 50)) );
- _qsettings->setValue( "UniversalIndentGUI/size", _qsettings->value("UniversalIndentGUI/size", QSize(800, 600)) );
+ _qsettings->setValue( "UniversalIndentGUI/position", _qsettings->value("UniversalIndentGUI/position", TQPoint(50, 50)) );
+ _qsettings->setValue( "UniversalIndentGUI/size", _qsettings->value("UniversalIndentGUI/size", TQSize(800, 600)) );
// Read last selected encoding for the opened source code file.
_qsettings->setValue( "UniversalIndentGUI/encoding", _qsettings->value("UniversalIndentGUI/encoding", "UTF-8") );
@@ -182,10 +182,10 @@ bool UiGuiSettings::initSettings()
// Read the update check settings from the settings file.
_qsettings->setValue( "UniversalIndentGUI/CheckForUpdate", _qsettings->value("UniversalIndentGUI/CheckForUpdate", false) );
- _qsettings->setValue( "UniversalIndentGUI/LastUpdateCheck", _qsettings->value("UniversalIndentGUI/LastUpdateCheck", QDate(1900,1,1)) );
+ _qsettings->setValue( "UniversalIndentGUI/LastUpdateCheck", _qsettings->value("UniversalIndentGUI/LastUpdateCheck", TQDate(1900,1,1)) );
// Read the main window state.
- _qsettings->setValue( "UniversalIndentGUI/MainWindowState", _qsettings->value("UniversalIndentGUI/MainWindowState", QByteArray()) );
+ _qsettings->setValue( "UniversalIndentGUI/MainWindowState", _qsettings->value("UniversalIndentGUI/MainWindowState", TQByteArray()) );
return true;
}
@@ -194,35 +194,35 @@ bool UiGuiSettings::initSettings()
/*!
\brief Register the by \a propertyName defined property of \a obj to be connected to the setting defined by \a settingName.
- The \a propertyName must be one of those that are listed in the Qt "Properties" documentation section of a Qt Object.
+ The \a propertyName must be one of those that are listed in the TQt "Properties" documentation section of a TQt Object.
All further needed info is retrieved via the \a obj's MetaObject, like the to the property bound signal.
*/
-bool UiGuiSettings::registerObjectProperty( QObject *obj, const QString &propertyName, const QString &settingName )
+bool UiGuiSettings::registerObjectProperty( TQObject *obj, const TQString &propertyName, const TQString &settingName )
{
- const QMetaObject *metaObject = obj->metaObject();
+ const TQMetaObject *metaObject = obj->metaObject();
bool connectSuccess = false;
// Connect to the objects destroyed signal, so that it will be correctly unregistered.
- connectSuccess = connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*)));
+ connectSuccess = connect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectProperty(TQObject*)));
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( connectSuccess && indexOfProp > -1 ) {
- QMetaProperty mProp = metaObject->property(indexOfProp);
+ TQMetaProperty mProp = metaObject->property(indexOfProp);
// Connect to the property's value changed signal.
if ( mProp.hasNotifySignal() ) {
- QMetaMethod signal = mProp.notifySignal();
- //QString teststr = qPrintable(SIGNAL() + QString(signal.signature()));
- // The command "SIGNAL() + QString(signal.signature())" assembles the signal methods signature to a valid Qt SIGNAL.
- connectSuccess = connect(obj, qPrintable(SIGNAL() + QString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
+ TQMetaMethod signal = mProp.notifySignal();
+ //TQString teststr = qPrintable(SIGNAL() + TQString(signal.signature()));
+ // The command "SIGNAL() + TQString(signal.signature())" assembles the signal methods signature to a valid TQt SIGNAL.
+ connectSuccess = connect(obj, qPrintable(SIGNAL() + TQString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
}
if ( connectSuccess ) {
- _registeredObjectProperties[obj] = QStringList() << propertyName << settingName;
+ _registeredObjectProperties[obj] = TQStringList() << propertyName << settingName;
}
else {
//TODO: Write a debug warning to the log.
- disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*)));
+ disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectProperty(TQObject*)));
return false;
}
@@ -237,7 +237,7 @@ bool UiGuiSettings::registerObjectProperty( QObject *obj, const QString &propert
}
else {
//TODO: Write a debug warning to the log.
- disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*)));
+ disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectProperty(TQObject*)));
return false;
}
@@ -246,18 +246,18 @@ bool UiGuiSettings::registerObjectProperty( QObject *obj, const QString &propert
/*!
- \brief Searches the child QObjects of \a obj for a property name and setting name definition within
+ \brief Searches the child TQObjects of \a obj for a property name and setting name definition within
their custom properties and registers this property name to that setting name if both were found.
The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
- where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and
+ where "connectedPropertyName" is the name of a TQObject property as it is documented in the TQtDocs, and
"connectedSettingName" is the name of a setting here within UiGuiSettings. If the mentioned setting
name doesn't exist, it will be created.
Returns true, if all found property and setting definitions could be successfully registered.
Returns false, if any of those registrations fails.
*/
-bool UiGuiSettings::registerObjectPropertyRecursive(QObject *obj) {
+bool UiGuiSettings::registerObjectPropertyRecursive(TQObject *obj) {
return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::registerObjectProperty);
}
@@ -268,13 +268,13 @@ bool UiGuiSettings::registerObjectPropertyRecursive(QObject *obj) {
Returns true, if the value could be assigned, otherwise returns false, which is the case if settingName doesn't exist
within the settings or if the mentioned propertyName wasn't found for the \a obj.
*/
-bool UiGuiSettings::setObjectPropertyToSettingValue( QObject *obj, const QString &propertyName, const QString &settingName )
+bool UiGuiSettings::setObjectPropertyToSettingValue( TQObject *obj, const TQString &propertyName, const TQString &settingName )
{
- const QMetaObject *metaObject = obj->metaObject();
+ const TQMetaObject *metaObject = obj->metaObject();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) {
- QMetaProperty mProp = metaObject->property(indexOfProp);
+ TQMetaProperty mProp = metaObject->property(indexOfProp);
// If setting already exists, set the objects property to the setting value.
if ( _qsettings->contains("UniversalIndentGUI/" + settingName) ) {
@@ -296,17 +296,17 @@ bool UiGuiSettings::setObjectPropertyToSettingValue( QObject *obj, const QString
/*!
- \brief Searches the child QObjects of \a obj for a property name and setting name definition within
+ \brief Searches the child TQObjects of \a obj for a property name and setting name definition within
their custom properties and sets each property to settings value.
The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
- where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and
+ where "connectedPropertyName" is the name of a TQObject property as it is documented in the TQtDocs, and
"connectedSettingName" is the name of a setting here within UiGuiSettings.
Returns true, if all found property and setting definitions could be successfully registered.
Returns false, if any of those registrations fails.
*/
-bool UiGuiSettings::setObjectPropertyToSettingValueRecursive(QObject *obj) {
+bool UiGuiSettings::setObjectPropertyToSettingValueRecursive(TQObject *obj) {
return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setObjectPropertyToSettingValue);
}
@@ -319,13 +319,13 @@ bool UiGuiSettings::setObjectPropertyToSettingValueRecursive(QObject *obj) {
Returns true, if the value could be assigned, otherwise returns false, which is the case if the mentioned
propertyName wasn't found for the \a obj.
*/
-bool UiGuiSettings::setSettingToObjectPropertyValue( QObject *obj, const QString &propertyName, const QString &settingName )
+bool UiGuiSettings::setSettingToObjectPropertyValue( TQObject *obj, const TQString &propertyName, const TQString &settingName )
{
- const QMetaObject *metaObject = obj->metaObject();
+ const TQMetaObject *metaObject = obj->metaObject();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) {
- QMetaProperty mProp = metaObject->property(indexOfProp);
+ TQMetaProperty mProp = metaObject->property(indexOfProp);
setValueByName(settingName, mProp.read(obj));
}
@@ -339,35 +339,35 @@ bool UiGuiSettings::setSettingToObjectPropertyValue( QObject *obj, const QString
/*!
- \brief Searches the child QObjects of \a obj for a property name and setting name definition within
+ \brief Searches the child TQObjects of \a obj for a property name and setting name definition within
their custom properties and sets each setting to the property value.
The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
- where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and
+ where "connectedPropertyName" is the name of a TQObject property as it is documented in the TQtDocs, and
"connectedSettingName" is the name of a setting here within UiGuiSettings. If the settingName
didn't exist yet, it will be created.
Returns true, if all found property and setting definitions could be successfully registered.
Returns false, if any of those registrations fails.
*/
-bool UiGuiSettings::setSettingToObjectPropertyValueRecursive(QObject *obj) {
+bool UiGuiSettings::setSettingToObjectPropertyValueRecursive(TQObject *obj) {
return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setSettingToObjectPropertyValue);
}
/*!
- \brief Iterates over all \a objs child QObjects and checks whether they have the custom properties
+ \brief Iterates over all \a objs child TQObjects and checks whether they have the custom properties
"connectedPropertyName" and "connectedSettingName" set. If both are set, it invokes the \a callBackFunc
with both.
*/
-bool UiGuiSettings::checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiGuiSettings::*callBackFunc)(QObject *obj, const QString &propertyName, const QString &settingName)) {
+bool UiGuiSettings::checkCustomPropertiesAndCallFunction(TQObject *obj, bool (UiGuiSettings::*callBackFunc)(TQObject *obj, const TQString &propertyName, const TQString &settingName)) {
bool success = true;
// Find all widgets that have PropertyName and SettingName defined in their style sheet.
- QList<QObject *> allObjects = obj->findChildren<QObject *>();
- foreach (QObject *object, allObjects) {
- QString propertyName = object->property("connectedPropertyName").toString();
- QString settingName = object->property("connectedSettingName").toString();
+ TQList<TQObject *> allObjects = obj->findChildren<TQObject *>();
+ foreach (TQObject *object, allObjects) {
+ TQString propertyName = object->property("connectedPropertyName").toString();
+ TQString settingName = object->property("connectedSettingName").toString();
// If property and setting name were found, register that widget with the settings.
if ( !propertyName.isEmpty() && !settingName.isEmpty() ) {
@@ -382,22 +382,22 @@ bool UiGuiSettings::checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiG
/*!
\brief The with a certain property registered \a obj gets unregistered.
*/
-void UiGuiSettings::unregisterObjectProperty(QObject *obj) {
+void UiGuiSettings::unregisterObjectProperty(TQObject *obj) {
if ( _registeredObjectProperties.contains(obj) ) {
- const QMetaObject *metaObject = obj->metaObject();
- QString propertyName = _registeredObjectProperties[obj].first();
- QString settingName = _registeredObjectProperties[obj].last();
+ const TQMetaObject *metaObject = obj->metaObject();
+ TQString propertyName = _registeredObjectProperties[obj].first();
+ TQString settingName = _registeredObjectProperties[obj].last();
bool connectSuccess = false;
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) {
- QMetaProperty mProp = metaObject->property(indexOfProp);
+ TQMetaProperty mProp = metaObject->property(indexOfProp);
// Disconnect to the property's value changed signal.
if ( mProp.hasNotifySignal() ) {
- QMetaMethod signal = mProp.notifySignal();
- // The command "SIGNAL() + QString(signal.signature())" assembles the signal methods signature to a valid Qt SIGNAL.
- connectSuccess = disconnect(obj, qPrintable(SIGNAL() + QString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
+ TQMetaMethod signal = mProp.notifySignal();
+ // The command "SIGNAL() + TQString(signal.signature())" assembles the signal methods signature to a valid TQt SIGNAL.
+ connectSuccess = disconnect(obj, qPrintable(SIGNAL() + TQString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
}
}
_registeredObjectProperties.remove(obj);
@@ -413,35 +413,35 @@ void UiGuiSettings::unregisterObjectProperty(QObject *obj) {
\a settingName changes the slot gets tried to be invoked with the settings value as parameter. This only works,
if the slot parameter is of the same type as the setting.
*/
-bool UiGuiSettings::registerObjectSlot(QObject *obj, const QString &slotName, const QString &settingName) {
+bool UiGuiSettings::registerObjectSlot(TQObject *obj, const TQString &slotName, const TQString &settingName) {
- const QMetaObject *metaObject = obj->metaObject();
+ const TQMetaObject *metaObject = obj->metaObject();
bool connectSuccess = false;
// Connect to the objects destroyed signal, so that it will be correctly unregistered.
- connectSuccess = connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*)));
+ connectSuccess = connect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectSlot(TQObject*)));
- QString normalizedSlotName = QMetaObject::normalizedSignature( qPrintable(slotName) );
+ TQString normalizedSlotName = TQMetaObject::normalizedSignature( qPrintable(slotName) );
int indexOfMethod = metaObject->indexOfMethod( qPrintable(normalizedSlotName) );
if ( connectSuccess && indexOfMethod > -1 ) {
- QMetaMethod mMethod = metaObject->method(indexOfMethod);
- //QMetaMethod::Access access = mMethod.access();
- //QMetaMethod::MethodType methType = mMethod.methodType();
+ TQMetaMethod mMethod = metaObject->method(indexOfMethod);
+ //TQMetaMethod::Access access = mMethod.access();
+ //TQMetaMethod::MethodType methType = mMethod.methodType();
// Since the method can at maximum be invoked with the setting value as argument,
// only methods taking max one argument are allowed.
if ( mMethod.parameterTypes().size() <= 1 ) {
- _registeredObjectSlots.insert(obj, QStringList() << normalizedSlotName << settingName);
+ _registeredObjectSlots.insert(obj, TQStringList() << normalizedSlotName << settingName);
}
else {
//TODO: Write a debug warning to the log.
- disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*)));
+ disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectSlot(TQObject*)));
return false;
}
}
else {
//TODO: Write a debug warning to the log.
- disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*)));
+ disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectSlot(TQObject*)));
return false;
}
@@ -453,10 +453,10 @@ bool UiGuiSettings::registerObjectSlot(QObject *obj, const QString &slotName, co
\brief If \a obj, \a slotName and \a settingName are given, that certain connection is unregistered.
If only \a obj is given, all to this object registered slot-setting connections are unregistered.
*/
-void UiGuiSettings::unregisterObjectSlot(QObject *obj, const QString &slotName, const QString &settingName) {
- //const QMetaObject *metaObject = obj->metaObject();
- QString normalizedSlotName = QMetaObject::normalizedSignature( qPrintable(slotName) );
- QMutableMapIterator<QObject*, QStringList> it(_registeredObjectSlots);
+void UiGuiSettings::unregisterObjectSlot(TQObject *obj, const TQString &slotName, const TQString &settingName) {
+ //const TQMetaObject *metaObject = obj->metaObject();
+ TQString normalizedSlotName = TQMetaObject::normalizedSignature( qPrintable(slotName) );
+ TQMutableMapIterator<TQObject*, TQStringList> it(_registeredObjectSlots);
while (it.hasNext()) {
it.next();
if (it.key() == obj && slotName.isEmpty() && settingName.isEmpty())
@@ -472,15 +472,15 @@ void UiGuiSettings::unregisterObjectSlot(QObject *obj, const QString &slotName,
and distributes the new value to all other to the same settingName registered objects.
*/
void UiGuiSettings::handleObjectPropertyChange() {
- QObject *obj = QObject::sender();
- QString className = obj->metaObject()->className();
- const QMetaObject *metaObject = obj->metaObject();
- QString propertyName = _registeredObjectProperties[obj].first();
- QString settingName = _registeredObjectProperties[obj].last();
+ TQObject *obj = TQObject::sender();
+ TQString className = obj->metaObject()->className();
+ const TQMetaObject *metaObject = obj->metaObject();
+ TQString propertyName = _registeredObjectProperties[obj].first();
+ TQString settingName = _registeredObjectProperties[obj].last();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) {
- QMetaProperty mProp = metaObject->property(indexOfProp);
+ TQMetaProperty mProp = metaObject->property(indexOfProp);
setValueByName(settingName, mProp.read(obj));
}
}
@@ -493,38 +493,38 @@ void UiGuiSettings::handleObjectPropertyChange() {
the changed value set too.
If the \a settingName didn't exist yet, it will be created.
*/
-void UiGuiSettings::setValueByName(const QString &settingName, const QVariant &value) {
+void UiGuiSettings::setValueByName(const TQString &settingName, const TQVariant &value) {
// Do the updating only, if the setting was really changed.
if ( _qsettings->value("UniversalIndentGUI/" + settingName) != value ) {
_qsettings->setValue("UniversalIndentGUI/" + settingName, value);
// Set the new value for all registered object properties for settingName.
- for ( QMap<QObject*, QStringList>::ConstIterator it = _registeredObjectProperties.begin(); it != _registeredObjectProperties.end(); ++it ) {
+ for ( TQMap<TQObject*, TQStringList>::ConstIterator it = _registeredObjectProperties.begin(); it != _registeredObjectProperties.end(); ++it ) {
if ( it.value().last() == settingName ) {
- QObject *obj = it.key();
- const QMetaObject *metaObject = obj->metaObject();
- QString propertyName = it.value().first();
+ TQObject *obj = it.key();
+ const TQMetaObject *metaObject = obj->metaObject();
+ TQString propertyName = it.value().first();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) {
- QMetaProperty mProp = metaObject->property(indexOfProp);
+ TQMetaProperty mProp = metaObject->property(indexOfProp);
mProp.write(obj, value);
}
}
}
// Invoke all registered object methods for settingName.
- for ( QMap<QObject*, QStringList>::ConstIterator it = _registeredObjectSlots.begin(); it != _registeredObjectSlots.end(); ++it ) {
+ for ( TQMap<TQObject*, TQStringList>::ConstIterator it = _registeredObjectSlots.begin(); it != _registeredObjectSlots.end(); ++it ) {
if ( it.value().last() == settingName ) {
- QObject *obj = it.key();
- const QMetaObject *metaObject = obj->metaObject();
- QString slotName = it.value().first();
+ TQObject *obj = it.key();
+ const TQMetaObject *metaObject = obj->metaObject();
+ TQString slotName = it.value().first();
int indexOfMethod = metaObject->indexOfMethod( qPrintable(slotName) );
if ( indexOfMethod > -1 ) {
- QMetaMethod mMethod = metaObject->method(indexOfMethod);
- //QMetaMethod::Access access = mMethod.access();
- //QMetaMethod::MethodType methType = mMethod.methodType();
+ TQMetaMethod mMethod = metaObject->method(indexOfMethod);
+ //TQMetaMethod::Access access = mMethod.access();
+ //TQMetaMethod::MethodType methType = mMethod.methodType();
bool success = false;
@@ -536,7 +536,7 @@ void UiGuiSettings::setValueByName(const QString &settingName, const QVariant &v
}
// Handle registered slots taking zero parameters.
else {
- success = mMethod.invoke( obj, Qt::DirectConnection );
+ success = mMethod.invoke( obj, TQt::DirectConnection );
}
if ( success == false ) {
@@ -549,138 +549,138 @@ void UiGuiSettings::setValueByName(const QString &settingName, const QVariant &v
}
-#include <tqbitarray.h>
-#include <tqbitmap.h>
-#include <tqbrush.h>
-#include <tqcursor.h>
-#include <tqdatetime.h>
-#include <tqfont.h>
+#include <tntqbitarray.h>
+#include <tntqbitmap.h>
+#include <tntqbrush.h>
+#include <tntqcursor.h>
+#include <tntqdatetime.h>
+#include <tntqfont.h>
#include <tqicon.h>
-#include <tqkeysequence.h>
-#include <tqlocale.h>
-#include <tqpalette.h>
-#include <tqpen.h>
-#include <tqsizepolicy.h>
+#include <tntqkeysequence.h>
+#include <tntqlocale.h>
+#include <tntqpalette.h>
+#include <tntqpen.h>
+#include <tntqsizepolicy.h>
#include <tqtextformat.h>
#include <tqtextlength.h>
-#include <tqurl.h>
-#if QT_VERSION >= 0x040600
+#include <tntqurl.h>
+#if TQT_VERSION >= 0x040600
#include <tqmatrix4x4.h>
#include <tqvector2d.h>
#endif
-bool UiGuiSettings::invokeMethodWithValue( QObject *obj, QMetaMethod mMethod, QVariant value )
+bool UiGuiSettings::invokeMethodWithValue( TQObject *obj, TQMetaMethod mMethod, TQVariant value )
{
switch (value.type()) {
- case QVariant::BitArray :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBitArray, value.toBitArray()) );
- case QVariant::Bitmap :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBitmap, value.value<QBitmap>()) );
- case QVariant::Bool :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(bool, value.toBool()) );
- case QVariant::Brush :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBrush, value.value<QBrush>()) );
- case QVariant::ByteArray :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QByteArray, value.toByteArray()) );
- case QVariant::Char :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QChar, value.toChar()) );
- case QVariant::Color :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QColor, value.value<QColor>()) );
- case QVariant::Cursor :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QCursor, value.value<QCursor>()) );
- case QVariant::Date :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QDate, value.toDate()) );
- case QVariant::DateTime :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QDateTime, value.toDateTime()) );
- case QVariant::Double :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(double, value.toDouble()) );
- case QVariant::Font :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QFont, value.value<QFont>()) );
- case QVariant::Hash :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantHash, value.toHash()) );
- case QVariant::Icon :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QIcon, value.value<QIcon>()) );
- case QVariant::Image :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QImage, value.value<QImage>()) );
- case QVariant::Int :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(int, value.toInt()) );
- case QVariant::KeySequence :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QKeySequence, value.value<QKeySequence>()) );
- case QVariant::Line :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLine, value.toLine()) );
- case QVariant::LineF :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLineF, value.toLineF()) );
- case QVariant::List :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantList, value.toList()) );
- case QVariant::Locale :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLocale, value.toLocale()) );
- case QVariant::LongLong :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(qlonglong, value.toLongLong()) );
- case QVariant::Map :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantMap, value.toMap()) );
- case QVariant::Matrix :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QMatrix, value.value<QMatrix>()) );
- case QVariant::Transform :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTransform, value.value<QTransform>()) );
-#if QT_VERSION >= 0x040600
- case QVariant::Matrix4x4 :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QMatrix4x4, value.value<QMatrix4x4>()) );
+ case TQVariant::BitArray :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQBitArray, value.toBitArray()) );
+ case TQVariant::Bitmap :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQBitmap, value.value<TQBitmap>()) );
+ case TQVariant::Bool :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(bool, value.toBool()) );
+ case TQVariant::Brush :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQBrush, value.value<TQBrush>()) );
+ case TQVariant::ByteArray :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQByteArray, value.toByteArray()) );
+ case TQVariant::Char :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQChar, value.toChar()) );
+ case TQVariant::Color :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQColor, value.value<TQColor>()) );
+ case TQVariant::Cursor :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQCursor, value.value<TQCursor>()) );
+ case TQVariant::Date :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQDate, value.toDate()) );
+ case TQVariant::DateTime :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQDateTime, value.toDateTime()) );
+ case TQVariant::Double :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(double, value.toDouble()) );
+ case TQVariant::Font :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQFont, value.value<TQFont>()) );
+ case TQVariant::Hash :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVariantHash, value.toHash()) );
+ case TQVariant::Icon :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQIcon, value.value<TQIcon>()) );
+ case TQVariant::Image :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQImage, value.value<TQImage>()) );
+ case TQVariant::Int :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(int, value.toInt()) );
+ case TQVariant::KeySequence :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQKeySequence, value.value<TQKeySequence>()) );
+ case TQVariant::Line :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQLine, value.toLine()) );
+ case TQVariant::LineF :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQLineF, value.toLineF()) );
+ case TQVariant::List :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVariantList, value.toList()) );
+ case TQVariant::Locale :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQLocale, value.toLocale()) );
+ case TQVariant::LongLong :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(qlonglong, value.toLongLong()) );
+ case TQVariant::Map :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVariantMap, value.toMap()) );
+ case TQVariant::Matrix :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQMatrix, value.value<TQMatrix>()) );
+ case TQVariant::Transform :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTransform, value.value<TQTransform>()) );
+#if TQT_VERSION >= 0x040600
+ case TQVariant::Matrix4x4 :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQMatrix4x4, value.value<TQMatrix4x4>()) );
#endif
- case QVariant::Palette :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPalette, value.value<QPalette>()) );
- case QVariant::Pen :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPen, value.value<QPen>()) );
- case QVariant::Pixmap :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPixmap, value.value<QPixmap>()) );
- case QVariant::Point :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPoint, value.toPoint()) );
- // case QVariant::PointArray :
- // return Q_ARG(QPointArray, value.value<QPointArray>()) );
- case QVariant::PointF :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPointF, value.toPointF()) );
- case QVariant::Polygon :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPolygon, value.value<QPolygon>()) );
-#if QT_VERSION >= 0x040600
- case QVariant::Quaternion :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QQuaternion, value.value<QQuaternion>()) );
+ case TQVariant::Palette :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPalette, value.value<TQPalette>()) );
+ case TQVariant::Pen :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPen, value.value<TQPen>()) );
+ case TQVariant::Pixmap :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPixmap, value.value<TQPixmap>()) );
+ case TQVariant::Point :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPoint, value.toPoint()) );
+ // case TQVariant::PointArray :
+ // return Q_ARG(TQPointArray, value.value<TQPointArray>()) );
+ case TQVariant::PointF :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPointF, value.toPointF()) );
+ case TQVariant::Polygon :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPolygon, value.value<TQPolygon>()) );
+#if TQT_VERSION >= 0x040600
+ case TQVariant::Quaternion :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQQuaternion, value.value<TQQuaternion>()) );
#endif
- case QVariant::Rect :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRect, value.toRect()) );
- case QVariant::RectF :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRectF, value.toRectF()) );
- case QVariant::RegExp :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRegExp, value.toRegExp()) );
- case QVariant::Region :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRegion, value.value<QRegion>()) );
- case QVariant::Size :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSize, value.toSize()) );
- case QVariant::SizeF :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSizeF, value.toSizeF()) );
- case QVariant::SizePolicy :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSizePolicy, value.value<QSizePolicy>()) );
- case QVariant::String :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QString, value.toString()) );
- case QVariant::StringList :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QStringList, value.toStringList()) );
- case QVariant::TextFormat :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTextFormat, value.value<QTextFormat>()) );
- case QVariant::TextLength :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTextLength, value.value<QTextLength>()) );
- case QVariant::Time :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTime, value.toTime()) );
- case QVariant::UInt :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(uint, value.toUInt()) );
- case QVariant::ULongLong :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(qulonglong, value.toULongLong()) );
- case QVariant::Url :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QUrl, value.toUrl()) );
-#if QT_VERSION >= 0x040600
- case QVariant::Vector2D :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector2D, value.value<QVector2D>()) );
- case QVariant::Vector3D :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector3D, value.value<QVector3D>()) );
- case QVariant::Vector4D :
- return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector4D, value.value<QVector4D>()) );
+ case TQVariant::Rect :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRect, value.toRect()) );
+ case TQVariant::RectF :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRectF, value.toRectF()) );
+ case TQVariant::RegExp :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRegExp, value.toRegExp()) );
+ case TQVariant::Region :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRegion, value.value<TQRegion>()) );
+ case TQVariant::Size :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQSize, value.toSize()) );
+ case TQVariant::SizeF :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQSizeF, value.toSizeF()) );
+ case TQVariant::SizePolicy :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQSizePolicy, value.value<TQSizePolicy>()) );
+ case TQVariant::String :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQString, value.toString()) );
+ case TQVariant::StringList :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQStringList, value.toStringList()) );
+ case TQVariant::TextFormat :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTextFormat, value.value<TQTextFormat>()) );
+ case TQVariant::TextLength :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTextLength, value.value<TQTextLength>()) );
+ case TQVariant::Time :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTime, value.toTime()) );
+ case TQVariant::UInt :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(uint, value.toUInt()) );
+ case TQVariant::ULongLong :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(qulonglong, value.toULongLong()) );
+ case TQVariant::Url :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQUrl, value.toUrl()) );
+#if TQT_VERSION >= 0x040600
+ case TQVariant::Vector2D :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVector2D, value.value<TQVector2D>()) );
+ case TQVariant::Vector3D :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVector3D, value.value<TQVector3D>()) );
+ case TQVariant::Vector4D :
+ return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVector4D, value.value<TQVector4D>()) );
#endif
default:
return false;