diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /lib/widgets/propeditor/propertyeditor.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/widgets/propeditor/propertyeditor.cpp')
-rw-r--r-- | lib/widgets/propeditor/propertyeditor.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/lib/widgets/propeditor/propertyeditor.cpp b/lib/widgets/propeditor/propertyeditor.cpp index 10f21ac1..c9e6e85d 100644 --- a/lib/widgets/propeditor/propertyeditor.cpp +++ b/lib/widgets/propeditor/propertyeditor.cpp @@ -27,12 +27,12 @@ #include "compat_tools.h" #endif -#include <qtable.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qptrlist.h> -#include <qvaluelist.h> -#include <qpushbutton.h> +#include <tqtable.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> +#include <tqpushbutton.h> #include "property.h" #include "multiproperty.h" @@ -59,7 +59,7 @@ public: return m_property->type(); } - QString name() const + TQString name() const { return m_property->name(); } @@ -69,11 +69,11 @@ public: return m_property; } - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { if ((column == 0) && m_changed) { - QFont font; + TQFont font; font.setBold(true); p->setFont(font); p->setBrush(cg.highlight()); @@ -81,18 +81,18 @@ public: } if (column == 1) { - QRect r(0, 0, m_editor->header()->sectionSize(1), height()); + TQRect r(0, 0, m_editor->header()->sectionSize(1), height()); //FIXME: this is ugly, but how else can we deal with ValueFromList properties? - QVariant valueToDraw; + TQVariant valueToDraw; if (m_property->type() == Property::ValueFromList) valueToDraw = m_property->findValueDescription(); else valueToDraw = m_property->value(); - QColorGroup icg(cg); + TQColorGroup icg(cg); #ifndef PURE_QT - icg.setColor(QColorGroup::Background, backgroundColor()); + icg.setColor(TQColorGroup::Background, backgroundColor()); #else - icg.setColor(QColorGroup::Background, white); + icg.setColor(TQColorGroup::Background, white); #endif m_editor->machine(m_property)->propertyEditor->drawViewer(p, icg, r, valueToDraw); return; @@ -120,22 +120,22 @@ private: class PropertyGroupItem: public KListViewItem{ public: - PropertyGroupItem(KListView *parent, const QString &name) + PropertyGroupItem(KListView *parent, const TQString &name) :KListViewItem(parent, name) { init(); } - PropertyGroupItem(KListViewItem *parent, const QString &name) + PropertyGroupItem(KListViewItem *parent, const TQString &name) :KListViewItem(parent, name) { init(); } - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { if (column == 0) { - QFont font; + TQFont font; font.setBold(true); p->setFont(font); p->setBrush(cg.highlight()); @@ -164,7 +164,7 @@ public: setSelectable(false); } }; -PropertyEditor::PropertyEditor(QWidget *parent, const char *name) +PropertyEditor::PropertyEditor(TQWidget *parent, const char *name) :KListView(parent, name) { setSorting(-1); @@ -172,15 +172,15 @@ PropertyEditor::PropertyEditor(QWidget *parent, const char *name) addColumn(i18n("Name")); addColumn(i18n("Value")); setAllColumnsShowFocus(true); - setColumnWidthMode(0, QListView::Maximum); - setResizeMode(QListView::LastColumn); + setColumnWidthMode(0, TQListView::Maximum); + setResizeMode(TQListView::LastColumn); header()->setClickEnabled(false); - connect(header(), SIGNAL(sizeChange(int, int, int)), - this, SLOT(updateEditorSize())); - connect(this, SIGNAL(currentChanged(QListViewItem*)), - this, SLOT(slotClicked(QListViewItem*))); + connect(header(), TQT_SIGNAL(sizeChange(int, int, int)), + this, TQT_SLOT(updateEditorSize())); + connect(this, TQT_SIGNAL(currentChanged(TQListViewItem*)), + this, TQT_SLOT(slotClicked(TQListViewItem*))); m_currentEditItem = 0; m_doubleClickForEdit = true; @@ -188,19 +188,19 @@ PropertyEditor::PropertyEditor(QWidget *parent, const char *name) m_currentEditWidget = 0; m_list = 0; - m_currentEditArea = new QWidget(viewport()); + m_currentEditArea = new TQWidget(viewport()); m_currentEditArea->hide(); - m_undoButton = new QPushButton(m_currentEditArea); + m_undoButton = new TQPushButton(m_currentEditArea); #ifndef PURE_QT m_undoButton->setPixmap(SmallIcon("undo")); #else - m_undoButton->setPixmap( QPixmap("undo.xpm") ); + m_undoButton->setPixmap( TQPixmap("undo.xpm") ); #endif - m_undoButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding); + m_undoButton->setSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::MinimumExpanding); m_undoButton->resize(m_undoButton->height(), m_undoButton->height()); m_undoButton->hide(); - connect(m_undoButton, SIGNAL(clicked()), this, SLOT(undo())); - m_currentEditLayout = new QGridLayout(m_currentEditArea, 1, 2, 0, 0); + connect(m_undoButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(undo())); + m_currentEditLayout = new TQGridLayout(m_currentEditArea, 1, 2, 0, 0); // m_currentEditLayout->addWidget(m_undoButton, 0, 1); } @@ -214,17 +214,17 @@ void PropertyEditor::populateProperties(PropertyList *list) if (list == 0) return; m_list = list; - connect(m_list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(propertyValueChanged(Property*))); - const QValueList<QPair<QString, QValueList<QString> > >& groups = m_list->propertiesOfGroup(); - for (QValueList<QPair<QString, QValueList<QString> > >::const_iterator it = groups.begin(); + connect(m_list, TQT_SIGNAL(propertyValueChanged(Property*)), this, TQT_SLOT(propertyValueChanged(Property*))); + const TQValueList<QPair<TQString, TQValueList<TQString> > >& groups = m_list->propertiesOfGroup(); + for (TQValueList<QPair<TQString, TQValueList<TQString> > >::const_iterator it = groups.begin(); it != groups.end(); ++it) { // qWarning("PropertyEditor::populateProperties: adding group %s", (*it).first.ascii()); PropertyGroupItem *group = 0; if ( (!(*it).first.isEmpty()) && ((*it).second.count() > 0) ) group = new PropertyGroupItem(this, (*it).first); - const QValueList<QString> &properties = (*it).second; - for (QValueList<QString>::const_iterator it2 = properties.begin(); it2 != properties.end(); ++it2) + const TQValueList<TQString> &properties = (*it).second; + for (TQValueList<TQString>::const_iterator it2 = properties.begin(); it2 != properties.end(); ++it2) { // qWarning("PropertyEditor::populateProperties: adding property %s", (*it2).ascii()); if (group) @@ -241,7 +241,7 @@ void PropertyEditor::populateProperties(PropertyList *list) } } -void PropertyEditor::addProperty(PropertyGroupItem *group, const QString &name) +void PropertyEditor::addProperty(PropertyGroupItem *group, const TQString &name) { if ((*m_list)[name] == 0) return; @@ -250,7 +250,7 @@ void PropertyEditor::addProperty(PropertyGroupItem *group, const QString &name) addChildProperties(pitem); } -void PropertyEditor::addProperty(const QString &name) +void PropertyEditor::addProperty(const TQString &name) { if ((*m_list)[name] == 0) return; @@ -273,7 +273,7 @@ void PropertyEditor::addChildProperties(PropertyItem *parent) // qWarning("seeking children: count: %d", prop->details.count()); parent->setOpen(true); - for (QValueList<ChildProperty>::iterator it = prop->details.begin(); it != prop->details.end(); ++it) + for (TQValueList<ChildProperty>::iterator it = prop->details.begin(); it != prop->details.end(); ++it) { // qWarning("found child %s", (*it).name().ascii()); new PropertyItem(this, parent, new MultiProperty(&m_detailedList, &(*it))); @@ -288,7 +288,7 @@ void PropertyEditor::clearProperties() hideEditor(); - disconnect(m_list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(propertyValueChanged(Property*))); + disconnect(m_list, TQT_SIGNAL(propertyValueChanged(Property*)), this, TQT_SLOT(propertyValueChanged(Property*))); clear(); delete m_list; m_list = 0; @@ -302,7 +302,7 @@ void PropertyEditor::propertyValueChanged(Property *property) else { // repaint all items - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while (it.current()) { repaintItem(it.current()); @@ -311,7 +311,7 @@ void PropertyEditor::propertyValueChanged(Property *property) } } -void PropertyEditor::propertyChanged(MultiProperty *property, const QVariant &value) +void PropertyEditor::propertyChanged(MultiProperty *property, const TQVariant &value) { if (!property) return; @@ -360,7 +360,7 @@ void PropertyEditor::showEditor(PropertyItem *item) void PropertyEditor::placeEditor(PropertyItem *item) { - QRect r = itemRect(item); + TQRect r = itemRect(item); if (!r.size().isValid()) { ensureItemVisible(item); @@ -374,7 +374,7 @@ void PropertyEditor::placeEditor(PropertyItem *item) if (visibleWidth() < r.right()) r.setRight(visibleWidth()); - r = QRect(viewportToContents(r.topLeft()), r.size()); + r = TQRect(viewportToContents(r.topLeft()), r.size()); if (item->pixmap(1)) { @@ -417,7 +417,7 @@ void PropertyEditor::updateEditorSize() placeEditor(m_currentEditItem); } -void PropertyEditor::slotClicked(QListViewItem *item) +void PropertyEditor::slotClicked(TQListViewItem *item) { if (item == 0) { @@ -440,13 +440,13 @@ void PropertyEditor::slotClicked(QListViewItem *item) Machine *PropertyEditor::machine(MultiProperty *property) { // int type = property->type(); - QString name = property->name(); - QMap<QString, QVariant> values = property->valueList(); + TQString name = property->name(); + TQMap<TQString, TQVariant> values = property->valueList(); if (m_registeredForType[name] == 0) { m_registeredForType[name] = PropertyMachineFactory::getInstance()->machineForProperty(property); - connect(m_registeredForType[name]->propertyEditor, SIGNAL(propertyChanged(MultiProperty*, const QVariant&)), - this, SLOT(propertyChanged(MultiProperty*, const QVariant&))); + connect(m_registeredForType[name]->propertyEditor, TQT_SIGNAL(propertyChanged(MultiProperty*, const TQVariant&)), + this, TQT_SLOT(propertyChanged(MultiProperty*, const TQVariant&))); m_registeredForType[name]->propertyEditor->reparent(m_currentEditArea, 0, m_currentEditArea->childrenRect().topLeft()); m_registeredForType[name]->propertyEditor->hide(); } @@ -455,7 +455,7 @@ Machine *PropertyEditor::machine(MultiProperty *property) void PropertyEditor::clearMachineCache() { - for (QMap<QString, Machine* >::iterator it = m_registeredForType.begin(); it != m_registeredForType.end(); ++it) + for (TQMap<TQString, Machine* >::iterator it = m_registeredForType.begin(); it != m_registeredForType.end(); ++it) { delete it.data(); } |