diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/koproperty/customproperty.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/koproperty/customproperty.cpp')
-rw-r--r-- | lib/koproperty/customproperty.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/lib/koproperty/customproperty.cpp b/lib/koproperty/customproperty.cpp index 700baa79..f2c17808 100644 --- a/lib/koproperty/customproperty.cpp +++ b/lib/koproperty/customproperty.cpp @@ -20,18 +20,18 @@ #include "customproperty.h" #include "property.h" -#include <qsize.h> -#include <qrect.h> -#include <qsizepolicy.h> -#include <qpoint.h> +#include <tqsize.h> +#include <tqrect.h> +#include <tqsizepolicy.h> +#include <tqpoint.h> #include <klocale.h> #include <kdebug.h> using namespace KoProperty; -CustomProperty::CustomProperty(Property *parent) - : m_property(parent) +CustomProperty::CustomProperty(Property *tqparent) + : m_property(tqparent) { } @@ -51,7 +51,7 @@ SizeCustomProperty::SizeCustomProperty(Property *property) : CustomProperty(property) { if(property && (property->type() == Size) ) { - QSize s = property->value().toSize(); + TQSize s = property->value().toSize(); new Property("width", s.width(), i18n("Width"), i18n("Width"), Size_Width, property); new Property("height", s.height(), i18n("Height"), i18n("Height"), Size_Height, property); } @@ -75,40 +75,40 @@ SizeCustomProperty::handleValue() const } void -SizeCustomProperty::setValue(const QVariant &value, bool rememberOldValue) +SizeCustomProperty::setValue(const TQVariant &value, bool rememberOldValue) { if(!m_property) return; - if(m_property->parent()) { - QSize s = m_property->parent()->value().toSize(); + if(m_property->tqparent()) { + TQSize s = m_property->tqparent()->value().toSize(); if(m_property->type() == Size_Height) s.setHeight(value.toInt()); else if(m_property->type() == Size_Width) s.setWidth(value.toInt()); - m_property->parent()->setValue(s, true, false); + m_property->tqparent()->setValue(s, true, false); } else{ - QSize s = value.toSize(); + TQSize s = value.toSize(); m_property->child("width")->setValue(s.width(), rememberOldValue, false); m_property->child("height")->setValue(s.height(), rememberOldValue, false); } } -QVariant +TQVariant SizeCustomProperty::value() const { - if(!m_property || !m_property->parent()) - return QVariant(); + if(!m_property || !m_property->tqparent()) + return TQVariant(); if(m_property->type() == Size_Height) - return m_property->parent()->value().toSize().height(); + return m_property->tqparent()->value().toSize().height(); else if(m_property->type() == Size_Width) - return m_property->parent()->value().toSize().width(); + return m_property->tqparent()->value().toSize().width(); - return QVariant(); + return TQVariant(); } /////////////// PointCustomProperty ///////////////////// @@ -117,7 +117,7 @@ PointCustomProperty::PointCustomProperty(Property *property) : CustomProperty(property) { if(property && (property->type() == Point) ) { - QPoint p = property->value().toPoint(); + TQPoint p = property->value().toPoint(); new Property("x", p.x(), i18n("X"), i18n("X"), Point_X, property); new Property("y", p.y(), i18n("Y"), i18n("Y"), Point_Y, property); } @@ -141,40 +141,40 @@ PointCustomProperty::handleValue() const } void -PointCustomProperty::setValue(const QVariant &value, bool rememberOldValue) +PointCustomProperty::setValue(const TQVariant &value, bool rememberOldValue) { if(!m_property) return; - if(m_property->parent()) { - QPoint p = m_property->parent()->value().toPoint(); + if(m_property->tqparent()) { + TQPoint p = m_property->tqparent()->value().toPoint(); if(m_property->type() == Point_X) p.setX(value.toInt()); else if(m_property->type() == Point_Y) p.setY(value.toInt()); - m_property->parent()->setValue(p, true, false); + m_property->tqparent()->setValue(p, true, false); } else { - QPoint p = value.toPoint(); + TQPoint p = value.toPoint(); m_property->child("x")->setValue(p.x(), rememberOldValue, false); m_property->child("y")->setValue(p.y(), rememberOldValue, false); } } -QVariant +TQVariant PointCustomProperty::value() const { - if(!m_property || !m_property->parent()) - return QVariant(); + if(!m_property || !m_property->tqparent()) + return TQVariant(); if(m_property->type() == Point_X) - return m_property->parent()->value().toPoint().x(); + return m_property->tqparent()->value().toPoint().x(); else if(m_property->type() == Point_Y) - return m_property->parent()->value().toPoint().y(); + return m_property->tqparent()->value().toPoint().y(); - return QVariant(); + return TQVariant(); } /////////////// RectCustomProperty ///////////////////// @@ -183,7 +183,7 @@ RectCustomProperty::RectCustomProperty(Property *property) : CustomProperty(property) { if(property && (property->type() == Rect) ) { - QRect r = property->value().toRect(); + TQRect r = property->value().toRect(); new Property("x", r.x(), i18n("X"), i18n("X"), Rect_X, property); new Property("y", r.y(), i18n("Y"), i18n("Y"), Rect_Y, property); new Property("width", r.width(), i18n("Width"), i18n("Width"), Rect_Width, property); @@ -209,13 +209,13 @@ RectCustomProperty::handleValue() const } void -RectCustomProperty::setValue(const QVariant &value, bool rememberOldValue) +RectCustomProperty::setValue(const TQVariant &value, bool rememberOldValue) { if(!m_property) return; - if(m_property->parent()) { - QRect r = m_property->parent()->value().toRect(); + if(m_property->tqparent()) { + TQRect r = m_property->tqparent()->value().toRect(); if(m_property->type() == Rect_X) { //changing x component of Rect shouldn't change width @@ -234,10 +234,10 @@ RectCustomProperty::setValue(const QVariant &value, bool rememberOldValue) else if(m_property->type() == Rect_Height) r.setHeight(value.toInt()); - m_property->parent()->setValue(r, true, false); + m_property->tqparent()->setValue(r, true, false); } else { - QRect r = value.toRect(); + TQRect r = value.toRect(); m_property->child("x")->setValue(r.x(), rememberOldValue, false); m_property->child("y")->setValue(r.y(), rememberOldValue, false); m_property->child("width")->setValue(r.width(), rememberOldValue, false); @@ -245,22 +245,22 @@ RectCustomProperty::setValue(const QVariant &value, bool rememberOldValue) } } -QVariant +TQVariant RectCustomProperty::value() const { - if(!m_property || !m_property->parent()) - return QVariant(); + if(!m_property || !m_property->tqparent()) + return TQVariant(); if(m_property->type() == Rect_X) - return m_property->parent()->value().toRect().x(); + return m_property->tqparent()->value().toRect().x(); else if(m_property->type() == Rect_Y) - return m_property->parent()->value().toRect().y(); + return m_property->tqparent()->value().toRect().y(); else if(m_property->type() == Rect_Width) - return m_property->parent()->value().toRect().width(); + return m_property->tqparent()->value().toRect().width(); else if(m_property->type() == Rect_Height) - return m_property->parent()->value().toRect().height(); + return m_property->tqparent()->value().toRect().height(); - return QVariant(); + return TQVariant(); } @@ -270,16 +270,16 @@ SizePolicyCustomProperty::SizePolicyCustomProperty(Property *property) : CustomProperty(property) { if(property && (property->type() == SizePolicy) ) { -// QMap<QString, QVariant> spValues; - QValueList<QVariant> keys; - keys << QSizePolicy::Fixed - << QSizePolicy::Minimum - << QSizePolicy::Maximum - << QSizePolicy::Preferred - << QSizePolicy::Expanding - << QSizePolicy::MinimumExpanding - << QSizePolicy::Ignored; - QStringList strings; +// TQMap<TQString, TQVariant> spValues; + TQValueList<TQVariant> keys; + keys << TQSizePolicy::Fixed + << TQSizePolicy::Minimum + << TQSizePolicy::Maximum + << TQSizePolicy::Preferred + << TQSizePolicy::Expanding + << TQSizePolicy::MinimumExpanding + << TQSizePolicy::Ignored; + TQStringList strings; strings << i18n("Size Policy", "Fixed") << i18n("Size Policy", "Minimum") << i18n("Size Policy", "Maximum") @@ -329,27 +329,27 @@ SizePolicyCustomProperty::handleValue() const } void -SizePolicyCustomProperty::setValue(const QVariant &value, bool rememberOldValue) +SizePolicyCustomProperty::setValue(const TQVariant &value, bool rememberOldValue) { if(!m_property) return; - if(m_property->parent()) { - QSizePolicy v = m_property->parent()->value().toSizePolicy(); + if(m_property->tqparent()) { + TQSizePolicy v = m_property->tqparent()->value().toSizePolicy(); if(m_property->type() == SizePolicy_HorData) - v.setHorData(QSizePolicy::SizeType(value.toInt())); + v.setHorData(TQSizePolicy::SizeType(value.toInt())); else if(m_property->type() == SizePolicy_VerData) - v.setVerData(QSizePolicy::SizeType(value.toInt())); + v.setVerData(TQSizePolicy::SizeType(value.toInt())); else if(m_property->type() == SizePolicy_HorStretch) v.setHorStretch(value.toInt()); else if(m_property->type() == SizePolicy_VerStretch) v.setVerStretch(value.toInt()); - m_property->parent()->setValue(v, true, false); + m_property->tqparent()->setValue(v, true, false); } else { - QSizePolicy v = value.toSizePolicy(); + TQSizePolicy v = value.toSizePolicy(); m_property->child("hSizeType")->setValue(v.horData(), rememberOldValue, false); m_property->child("vSizeType")->setValue(v.verData(), rememberOldValue, false); m_property->child("hStretch")->setValue(v.horStretch(), rememberOldValue, false); @@ -357,20 +357,20 @@ SizePolicyCustomProperty::setValue(const QVariant &value, bool rememberOldValue) } } -QVariant +TQVariant SizePolicyCustomProperty::value() const { - if(!m_property || !m_property->parent()) - return QVariant(); + if(!m_property || !m_property->tqparent()) + return TQVariant(); if(m_property->type() == SizePolicy_HorData) - return m_property->parent()->value().toSizePolicy().horData(); + return m_property->tqparent()->value().toSizePolicy().horData(); else if(m_property->type() == SizePolicy_VerData) - return m_property->parent()->value().toSizePolicy().verData(); + return m_property->tqparent()->value().toSizePolicy().verData(); else if(m_property->type() == SizePolicy_HorStretch) - return m_property->parent()->value().toSizePolicy().horStretch(); + return m_property->tqparent()->value().toSizePolicy().horStretch(); else if(m_property->type() == SizePolicy_VerStretch) - return m_property->parent()->value().toSizePolicy().verStretch(); + return m_property->tqparent()->value().toSizePolicy().verStretch(); - return QVariant(); + return TQVariant(); } |