diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
commit | 87a016680e3677da3993f333561e79eb0cead7d5 (patch) | |
tree | cbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/variant.h | |
parent | 6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff) | |
download | ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip |
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/variant.h')
-rw-r--r-- | src/variant.h | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/src/variant.h b/src/variant.h index 8367026..b74c221 100644 --- a/src/variant.h +++ b/src/variant.h @@ -11,22 +11,23 @@ #ifndef VARIANT_H #define VARIANT_H -#include <qobject.h> -#include <qvariant.h> +#include <tqobject.h> +#include <tqvariant.h> -class QColor; -class QString; +class TQColor; +class TQString; /** For information: -QVariant::type() returns an enum for the current data type -contained. e.g. returns QVariant::Color or QVariant::Rect +TQVariant::type() returns an enum for the current data type +contained. e.g. returns TQVariant::Color or TQVariant::Rect @author Daniel Clarke @author David Saxton */ -class Variant : public QObject +class Variant : public TQObject { Q_OBJECT + TQ_OBJECT public: class Type { @@ -35,7 +36,7 @@ public: { None, Int, // Integer - Raw, // QByteArray + Raw, // TQByteArray Double, // Real number String, // Editable string Multiline, // String that may contain linebreaks @@ -68,8 +69,8 @@ public: /** * Returns the filter used for file dialogs (if this is of type Type::FileName) */ - QString filter() const { return m_filter; } - void setFilter( const QString & filter ) { m_filter = filter; } + TQString filter() const { return m_filter; } + void setFilter( const TQString & filter ) { m_filter = filter; } /** * The selection of colours to be used in the combo box - e.g. * ColorCombo::LED. @@ -81,22 +82,22 @@ public: * This function is for convenience; it sets both the toolbar and editor * caption. */ - void setCaption( const QString & caption ) { setToolbarCaption(caption); setEditorCaption(caption); } + void setCaption( const TQString & caption ) { setToolbarCaption(caption); setEditorCaption(caption); } /** * This text is displayed to the left of the entry widget in the toolbar */ - QString toolbarCaption() const { return m_toolbarCaption; } - void setToolbarCaption( const QString & caption ) { m_toolbarCaption = caption; } + TQString toolbarCaption() const { return m_toolbarCaption; } + void setToolbarCaption( const TQString & caption ) { m_toolbarCaption = caption; } /** * This text is displayed to the left of the entry widget in the item editor */ - QString editorCaption() const { return m_editorCaption; } - void setEditorCaption( const QString & caption ) { m_editorCaption = caption; } + TQString editorCaption() const { return m_editorCaption; } + void setEditorCaption( const TQString & caption ) { m_editorCaption = caption; } /** * Unit of number, (e.g. V (volts) / F (farads)) */ - QString unit() const { return m_unit; } - void setUnit( const QString & unit ) { m_unit = unit; } + TQString unit() const { return m_unit; } + void setUnit( const TQString & unit ) { m_unit = unit; } /** * The smallest (as in negative, not absoluteness) value that the user can * set this to. @@ -115,8 +116,8 @@ public: */ double minAbsValue() const { return m_minAbsValue; } void setMinAbsValue( double val ); - QVariant defaultValue() const { return m_defaultValue; } - void setDefaultValue( QVariant val ); + TQVariant defaultValue() const { return m_defaultValue; } + void setDefaultValue( TQVariant val ); /** * If this data is marked as advanced, it will only display in the item * editor (and not in the toolbar) @@ -133,16 +134,16 @@ public: * Returns the best possible attempt at representing the data in a string * for display. Used by the properties list view. */ - QString displayString() const; + TQString displayString() const; /** * The list of values that the data is allowed to take (if it is string) */ - QStringList allowed() const { return m_allowed; } - void setAllowed(QStringList stringList); - void appendAllowed(QString string); + TQStringList allowed() const { return m_allowed; } + void setAllowed(TQStringList stringList); + void appendAllowed(TQString string); - QVariant value() const { return m_value; } - void setValue( const QVariant& val ); + TQVariant value() const { return m_value; } + void setValue( const TQVariant& val ); void resetToDefault(); signals: @@ -152,23 +153,23 @@ signals: * This is done so that slots that don't care about the old value don't * have to accept it */ - void valueChanged( QVariant newValue, QVariant oldValue ); + void valueChanged( TQVariant newValue, TQVariant oldValue ); private: - QVariant m_value; // the actual data - QVariant m_defaultValue; - QString m_unit; + TQVariant m_value; // the actual data + TQVariant m_defaultValue; + TQString m_unit; double m_minAbsValue; double m_minValue; double m_maxValue; - QString m_toolbarCaption; // Short description shown in e.g. properties dialog - QString m_editorCaption; // Text displayed before the data entry widget in the toolbar + TQString m_toolbarCaption; // Short description shown in e.g. properties dialog + TQString m_editorCaption; // Text displayed before the data entry widget in the toolbar bool m_bAdvanced; // If advanced, only display data in item editor bool m_bHidden; // If hidden, do not allow user to change data - QString m_filter; // If type() == Type::FileName this is the filter used in file dialogs. + TQString m_filter; // If type() == Type::FileName this is the filter used in file dialogs. bool m_bSetDefault; // If false, then the default will be set to the first thing this variant is set to Type::Value m_type; - QStringList m_allowed; + TQStringList m_allowed; int m_colorScheme; }; |