[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    lib/widgets/propeditor
From:       Sascha Cunz <sascha.cunz () tiscali ! de>
Date:       2005-09-11 2:23:32
Message-ID: 200509110423.32864.sascha.cunz () tiscali ! de
[Download RAW message or body]

Hi,
attached is a patch is against the branches/work/kdevelop3 version of 
lib/widgets/propeditor and is a port for trunk.

What i basicly did, is:
  - run qt3to4 over it
  - fixed some constants that qt3to4 did not catch
  - fixed QVariant access for QtGui module
  - uncoment stuff for that i cannot find documentation in
    Qt3support and mark it with @todo
    --> QEditListBox::insertStrList

However, i could not test this yet. But i'll need this stuff to port the 
appwizard.

Can this be commited (now) - or shall i wait until i can confirm it works?

Cheers Sascha

["propeditor.patch" (text/x-diff)]

Index: psymbolcombo.cpp
===================================================================
--- psymbolcombo.cpp	(Revision 459472)
+++ psymbolcombo.cpp	(Arbeitskopie)
@@ -24,6 +24,9 @@
 
 #ifndef PURE_QT
 #include <qdialog.h>
+//Added by qt3to4:
+#include <QVBoxLayout>
+#include <QHBoxLayout>
 
 #include <kcharselect.h>
 #include <klocale.h>
@@ -73,7 +76,7 @@
 #endif
     {
         disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, \
                SLOT(updateProperty(const QString&)));
-        m_edit->setText(QChar(value.toInt()));
+        m_edit->setText(QString(QChar(value.toInt())));
         connect(m_edit, SIGNAL(textChanged(const QString&)), this, \
SLOT(updateProperty(const QString&)));  if (emitChange)
             emit propertyChanged(m_property, value);
@@ -106,7 +109,7 @@
 
     if (dia->exec() == QDialog::Accepted)
     {
-        m_edit->setText(select->chr());
+        m_edit->setText(QString(select->chr()));
     }
     delete dia;
 #endif
@@ -122,7 +125,7 @@
     p->setBrush(cg.background());
     p->setPen(Qt::NoPen);
     p->drawRect(r);
-    p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, \
QChar(value.toInt())); +    p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | \
Qt::SingleLine, QString(QChar(value.toInt())));  }
 
 }
Index: pcolorcombo.cpp
===================================================================
--- pcolorcombo.cpp	(Revision 459472)
+++ pcolorcombo.cpp	(Arbeitskopie)
@@ -21,6 +21,8 @@
 
 #include <qlayout.h>
 #include <qpainter.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #include <kcolorcombo.h>
 
@@ -45,7 +47,7 @@
 void PColorCombo::setValue(const QVariant &value, bool emitChange)
 {
     disconnect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
-    m_edit->setColor(value.toColor());
+    m_edit->setColor(value.value<QColor>());
     connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
     if (emitChange)
         emit propertyChanged(m_property, value);
@@ -62,7 +64,7 @@
     p->setBrush(cg.background());
     p->drawRect(r);
     
-    p->setBrush(value.toColor());
+    p->setBrush(value.value<QColor>());
     p->setPen(Qt::SolidLine);
     QRect r2(r);
     r2.setTopLeft(r.topLeft() + QPoint(5,5));
Index: qeditlistbox.h
===================================================================
--- qeditlistbox.h	(Revision 459472)
+++ qeditlistbox.h	(Arbeitskopie)
@@ -20,8 +20,10 @@
 #ifndef QEDITLISTBOX_H
 #define QEDITLISTBOX_H
 
-#include <qgroupbox.h>
-#include <qlistbox.h>
+#include <q3groupbox.h>
+#include <q3listbox.h>
+//Added by qt3to4:
+#include <Q3StrList>
 
 class QLineEdit;
 class QComboBox;
@@ -42,7 +44,7 @@
 
 class QEditListBoxPrivate;
 
-class QEditListBox : public QGroupBox
+class QEditListBox : public Q3GroupBox
 {
    Q_OBJECT
 
@@ -134,7 +136,7 @@
       /**
        * Return a pointer to the embedded QListBox.
        */
-      QListBox* listBox() const     { return m_listBox; }
+      Q3ListBox* listBox() const     { return m_listBox; }
       /**
        * Return a pointer to the embedded QLineEdit.
        */
@@ -167,11 +169,11 @@
       /**
        * See QListBox::insertStringList()
        */
-      void insertStrList(const QStrList* list, int index=-1);
+      void insertStrList(const Q3StrList* list, int index=-1);
       /**
        * See QListBox::insertStrList()
        */
-      void insertStrList(const QStrList& list, int index=-1);
+      void insertStrList(const Q3StrList& list, int index=-1);
       /**
        * See QListBox::insertStrList()
        */
@@ -236,7 +238,7 @@
       void typedSomething(const QString& text);
 
    private:
-      QListBox *m_listBox;
+      Q3ListBox *m_listBox;
       QPushButton *servUpButton, *servDownButton;
       QPushButton *servNewButton, *servRemoveButton;
       QLineEdit *m_lineEdit;
Index: propertylist.cpp
===================================================================
--- propertylist.cpp	(Revision 459472)
+++ propertylist.cpp	(Arbeitskopie)
@@ -21,6 +21,9 @@
 
 #include "property.h"
 #include "multiproperty.h"
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <Q3PtrList>
 
 namespace PropertyLib{
 
@@ -146,7 +149,7 @@
     }
 }
 
-const QValueList<QPair<QString, QValueList<QString> > >& \
PropertyList::propertiesOfGroup() const +const Q3ValueList<QPair<QString, \
Q3ValueList<QString> > >& PropertyList::propertiesOfGroup() const  {
     return m_propertiesOfGroup;
 }
@@ -165,8 +168,8 @@
     if (m_groupOfProperty.contains(property) && (m_groupOfProperty[property] == \
group))  return;
 
-    QPair<QString, QValueList<QString> > *groupPair = 0;
-    for(QValueList<QPair<QString, QValueList<QString> > >::iterator it = \
m_propertiesOfGroup.begin(); +    QPair<QString, Q3ValueList<QString> > *groupPair = \
0; +    for(Q3ValueList<QPair<QString, Q3ValueList<QString> > >::iterator it = \
m_propertiesOfGroup.begin();  it != m_propertiesOfGroup.end(); ++it)
     {
         if ((*it).first == group)
@@ -177,7 +180,7 @@
     }
     if (groupPair == 0)
     {
-        groupPair = new QPair<QString, QValueList<QString> >();
+        groupPair = new QPair<QString, Q3ValueList<QString> >();
         groupPair->first = group;
         groupPair->second.append(property->name());
         m_propertiesOfGroup.append(*groupPair);
@@ -196,7 +199,7 @@
     QString group = m_groupOfProperty[property];
 //    qWarning("removeFromGroup group=%s", group.ascii());
 
-    for(QValueList<QPair<QString, QValueList<QString> > >::iterator it = \
m_propertiesOfGroup.begin(); +    for(Q3ValueList<QPair<QString, Q3ValueList<QString> \
> >::iterator it = m_propertiesOfGroup.begin();  it != m_propertiesOfGroup.end(); \
> > ++it)
     {
 //        qWarning("removeFromGroup checking %s", (*it).first.ascii());
@@ -224,11 +227,11 @@
     return false;
 }
 
-QPtrList<Property> PropertyList::properties(const QString &name)
+Q3PtrList<Property> PropertyList::properties(const QString &name)
 {
     if (m_list.contains(name))
         return m_list[name]->list;
-    return QPtrList<Property>();
+    return Q3PtrList<Property>();
 }
 
 PropertyList::Iterator PropertyList::begin()
@@ -341,7 +344,7 @@
     if (mp == *m_list[propertyName])
     {
         Property *prop;
-        QPtrList<Property> props = properties(propertyName);
+        Q3PtrList<Property> props = properties(propertyName);
         for (prop = props.first(); prop; prop = props.next())
             emit propertyValueChanged(prop);
     }
Index: prectedit.cpp
===================================================================
--- prectedit.cpp	(Revision 459472)
+++ prectedit.cpp	(Arbeitskopie)
@@ -22,6 +22,8 @@
 #include <qlineedit.h>
 #include <qlayout.h>
 #include <qpainter.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
Index: pdatetimeedit.h
===================================================================
--- pdatetimeedit.h	(Revision 459472)
+++ pdatetimeedit.h	(Arbeitskopie)
@@ -22,7 +22,7 @@
 
 #include "propertywidget.h"
 
-class QDateTimeEdit;
+class Q3DateTimeEdit;
 
 namespace PropertyLib{
 
@@ -43,7 +43,7 @@
     void updateProperty(const QDateTime &val);    
 
 private:
-    QDateTimeEdit *m_edit;
+    Q3DateTimeEdit *m_edit;
 
 };
 
Index: pstringlistedit.cpp
===================================================================
--- pstringlistedit.cpp	(Revision 459472)
+++ pstringlistedit.cpp	(Arbeitskopie)
@@ -23,6 +23,9 @@
 #include <qlayout.h>
 #include <qdialog.h>
 #include <qpainter.h>
+//Added by qt3to4:
+#include <QVBoxLayout>
+#include <QHBoxLayout>
 
 #ifndef PURE_QT
 #include <keditlistbox.h>
Index: ppixmapedit.h
===================================================================
--- ppixmapedit.h	(Revision 459472)
+++ ppixmapedit.h	(Arbeitskopie)
@@ -21,6 +21,10 @@
 #define PPIXMAPEDIT_H
 
 #include "propertywidget.h"
+//Added by qt3to4:
+#include <QLabel>
+#include <QResizeEvent>
+#include <QEvent>
 
 class QLabel;
 class QPushButton;
Index: propertywidgetproxy.cpp
===================================================================
--- propertywidgetproxy.cpp	(Revision 459472)
+++ propertywidgetproxy.cpp	(Arbeitskopie)
@@ -20,6 +20,8 @@
 #include "propertywidgetproxy.h"
 
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #include "propertywidget.h"
 #include "propertymachinefactory.h"
Index: plinestyleedit.cpp
===================================================================
--- plinestyleedit.cpp	(Revision 459472)
+++ plinestyleedit.cpp	(Arbeitskopie)
@@ -23,6 +23,8 @@
 #include <qpixmap.h>
 #include <qcombobox.h>
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib {
 
Index: propertymachinefactory.cpp
===================================================================
--- propertymachinefactory.cpp	(Revision 459472)
+++ propertymachinefactory.cpp	(Arbeitskopie)
@@ -166,7 +166,7 @@
             spValues[i18n("Up Arrow")] = Qt::UpArrowCursor;
             spValues[i18n("Cross")] = Qt::CrossCursor;
             spValues[i18n("Waiting")] = Qt::WaitCursor;
-            spValues[i18n("iBeam")] = Qt::IbeamCursor;
+            spValues[i18n("iBeam")] = Qt::IBeamCursor;
             spValues[i18n("Size Vertical")] = Qt::SizeVerCursor;
             spValues[i18n("Size Horizontal")] = Qt::SizeHorCursor;
             spValues[i18n("Size Slash")] = Qt::SizeBDiagCursor;
Index: multiproperty.h
===================================================================
--- multiproperty.h	(Revision 459472)
+++ multiproperty.h	(Arbeitskopie)
@@ -19,9 +19,11 @@
 #ifndef MULTIPROPERTY_H
 #define MULTIPROPERTY_H
 
-#include <qptrlist.h>
+#include <q3ptrlist.h>
 #include <qmap.h>
 #include <qvariant.h>
+//Added by qt3to4:
+#include <Q3ValueList>
 
 #include "property.h"
 #include "childproperty.h"
@@ -110,10 +112,10 @@
     void undo();
     
     /**The list of child properties.*/
-    QValueList<ChildProperty> details;
+    Q3ValueList<ChildProperty> details;
 
 private:
-    QPtrList<Property> list;
+    Q3PtrList<Property> list;
 
     PropertyList *m_propertyList;
     
Index: pyesnobutton.cpp
===================================================================
--- pyesnobutton.cpp	(Revision 459472)
+++ pyesnobutton.cpp	(Arbeitskopie)
@@ -22,6 +22,8 @@
 #include <qlayout.h>
 #include <qpainter.h>
 #include <qpushbutton.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #ifndef PURE_QT
 #include <klocale.h>
Index: qeditlistbox.cpp
===================================================================
--- qeditlistbox.cpp	(Revision 459472)
+++ qeditlistbox.cpp	(Arbeitskopie)
@@ -18,14 +18,17 @@
    Boston, MA 02111-1307, USA.
 */
 #include "qeditlistbox.h"
+//Added by qt3to4:
+#include <Q3StrList>
+#include <QGridLayout>
 
 #include "compat_tools.h"
 
 #include <qpushbutton.h>
 #include <qlayout.h>
-#include <qgroupbox.h>
-#include <qlistbox.h>
-#include <qwhatsthis.h>
+#include <q3groupbox.h>
+#include <q3listbox.h>
+#include <q3whatsthis.h>
 #include <qlabel.h>
 #include <qlineedit.h>
 #include <qcombobox.h>
@@ -47,14 +50,14 @@
 
 QEditListBox::QEditListBox(QWidget *parent, const char *name,
 			   bool checkAtEntering, int buttons )
-    :QGroupBox(parent, name )
+    :Q3GroupBox(parent, name )
 {
     init( checkAtEntering, buttons );
 }
 
 QEditListBox::QEditListBox(const QString& title, QWidget *parent,
 			   const char *name, bool checkAtEntering, int buttons)
-    :QGroupBox(title, parent, name )
+    :Q3GroupBox(title, parent, name )
 {
     init( checkAtEntering, buttons );
 }
@@ -62,7 +65,7 @@
 QEditListBox::QEditListBox(const QString& title, const CustomEditor& custom,
                            QWidget *parent, const char *name,
                            bool checkAtEntering, int buttons)
-    :QGroupBox(title, parent, name )
+    :Q3GroupBox(title, parent, name )
 {
     m_lineEdit = custom.lineEdit();
     init( checkAtEntering, buttons, custom.representationWidget() );
@@ -109,7 +112,7 @@
     else
         m_lineEdit=new QLineEdit(gb);
 
-    m_listBox = new QListBox(gb);
+    m_listBox = new Q3ListBox(gb);
 
     QWidget *editingWidget = representationWidget ?
                              representationWidget : m_lineEdit;
@@ -183,7 +186,7 @@
         }
         else
         {
-            StringComparisonMode mode = (StringComparisonMode) (ExactMatch | \
CaseSensitive ); +            Q3ListBox::StringComparisonMode mode = \
(Q3ListBox::StringComparisonMode) (Q3ListBox::ExactMatch | Q3ListBox::CaseSensitive \
);  bool enable = (m_listBox->findItem( text, mode ) == 0L);
             servNewButton->setEnabled( enable );
         }
@@ -205,7 +208,7 @@
         return;
     }
 
-    QListBoxItem *selItem = m_listBox->item(selIndex);
+    Q3ListBoxItem *selItem = m_listBox->item(selIndex);
     m_listBox->takeItem(selItem);
     m_listBox->insertItem(selItem, selIndex-1);
     m_listBox->setCurrentItem(selIndex - 1);
@@ -228,7 +231,7 @@
         return;
     }
 
-    QListBoxItem *selItem = m_listBox->item(selIndex);
+    Q3ListBoxItem *selItem = m_listBox->item(selIndex);
     m_listBox->takeItem(selItem);
     m_listBox->insertItem(selItem, selIndex+1);
     m_listBox->setCurrentItem(selIndex + 1);
@@ -254,7 +257,7 @@
             alreadyInList = true;
         else
         {
-            StringComparisonMode mode = (StringComparisonMode) (ExactMatch | \
CaseSensitive ); +            Q3ListBox::StringComparisonMode mode = \
(Q3ListBox::StringComparisonMode) (Q3ListBox::ExactMatch | Q3ListBox::CaseSensitive \
                );
             alreadyInList =(m_listBox->findItem(currentTextLE, mode) != 0);
         }
     }
@@ -355,14 +358,18 @@
     m_listBox->insertStringList(list,index);
 }
 
-void QEditListBox::insertStrList(const QStrList* list, int index)
+void QEditListBox::insertStrList(const Q3StrList* list, int index)
 {
+    /* @todo No support in Qt4 for:
     m_listBox->insertStrList(list,index);
+    */
 }
 
-void QEditListBox::insertStrList(const QStrList& list, int index)
+void QEditListBox::insertStrList(const Q3StrList& list, int index)
 {
+    /* @todo No support in Qt4 for:
     m_listBox->insertStrList(list,index);
+    */
 }
 
 void QEditListBox::insertStrList(const char ** list, int numStrings, int index)
Index: plineedit.cpp
===================================================================
--- plineedit.cpp	(Revision 459472)
+++ plineedit.cpp	(Arbeitskopie)
@@ -21,6 +21,8 @@
 
 #include <qlineedit.h>
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
Index: propertylist.h
===================================================================
--- propertylist.h	(Revision 459472)
+++ propertylist.h	(Arbeitskopie)
@@ -22,8 +22,8 @@
 
 #include <qobject.h>
 #include <qmap.h>
-#include <qptrlist.h>
-#include <qvaluelist.h>
+#include <q3ptrlist.h>
+#include <q3valuelist.h>
 #include <qpair.h>
 
 namespace PropertyLib{
@@ -110,7 +110,7 @@
     virtual void removeProperty(const QString &name);
     
     /**@return the list of grouped properties.*/
-    virtual const QValueList<QPair<QString, QValueList<QString> > >& \
propertiesOfGroup() const; +    virtual const Q3ValueList<QPair<QString, \
Q3ValueList<QString> > >& propertiesOfGroup() const;  /**@return the map: property - \
group name.*/  virtual const QMap<MultiProperty*, QString>& groupOfProperty() const;
     
@@ -120,7 +120,7 @@
     virtual bool contains(const QString &name);
     
     /**The list of properties with given name.*/
-    QPtrList<Property> properties(const QString &name);
+    Q3PtrList<Property> properties(const QString &name);
     
     Iterator begin();
     Iterator end();
@@ -146,7 +146,7 @@
     
     //groups of properties:
     // list of group name: (list of property names)
-    QValueList<QPair<QString, QValueList<QString> > > m_propertiesOfGroup;
+    Q3ValueList<QPair<QString, Q3ValueList<QString> > > m_propertiesOfGroup;
     // map of property: group
     QMap<MultiProperty*, QString> m_groupOfProperty;
 
Index: pcombobox.cpp
===================================================================
--- pcombobox.cpp	(Revision 459472)
+++ pcombobox.cpp	(Arbeitskopie)
@@ -21,6 +21,8 @@
 
 #include <qcombobox.h>
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
Index: pdoublenuminput.cpp
===================================================================
--- pdoublenuminput.cpp	(Revision 459472)
+++ pdoublenuminput.cpp	(Arbeitskopie)
@@ -24,6 +24,8 @@
 #else
 #include "qfloatinput.h"
 #endif
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #include <limits.h>
 #include <math.h>
@@ -36,7 +38,7 @@
 {
     QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
 #ifndef PURE_QT
-    m_edit = new KDoubleNumInput(-999999.0, 999999.0, 0.0, 0.01, 2, this);
+    m_edit = new KDoubleNumInput(-999999.0, 999999.0, 0.0, this);
     m_edit->setLabel(QString::null);
     connect(m_edit, SIGNAL(valueChanged(double)), this, \
SLOT(updateProperty(double)));  #else
Index: pstringlistedit.h
===================================================================
--- pstringlistedit.h	(Revision 459472)
+++ pstringlistedit.h	(Arbeitskopie)
@@ -21,6 +21,8 @@
 #define PSTRINGLISTEDIT_H
 
 #include "propertywidget.h"
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 class QLineEdit;
 class QPushButton;
Index: multiproperty.cpp
===================================================================
--- multiproperty.cpp	(Revision 459472)
+++ multiproperty.cpp	(Arbeitskopie)
@@ -63,7 +63,7 @@
     if (list.count() >= 1)
         value = list.getFirst()->value();
 
-    QPtrListIterator<Property> it(list);
+    Q3PtrListIterator<Property> it(list);
     Property *property;
     while ((property = it.current()) != 0)
     {
@@ -81,7 +81,7 @@
     if (list.count() >= 1)
         description = list.getFirst()->description();
 
-    QPtrListIterator<Property> it(list);
+    Q3PtrListIterator<Property> it(list);
     Property *property;
     while ((property = it.current()) != 0)
     {
@@ -99,7 +99,7 @@
     if (list.count() >= 1)
         v = list.getFirst()->readOnly();
 
-    QPtrListIterator<Property> it(list);
+    Q3PtrListIterator<Property> it(list);
     Property *property;
     while ((property = it.current()) != 0)
     {
@@ -117,7 +117,7 @@
     if (list.count() >= 1)
         v = list.getFirst()->readOnly();
 
-    QPtrListIterator<Property> it(list);
+    Q3PtrListIterator<Property> it(list);
     Property *property;
     while ((property = it.current()) != 0)
     {
Index: propertywidgetproxy.h
===================================================================
--- propertywidgetproxy.h	(Revision 459472)
+++ propertywidgetproxy.h	(Arbeitskopie)
@@ -22,6 +22,8 @@
 
 #include <qwidget.h>
 #include <qvariant.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #include "multiproperty.h"
 
Index: propertyeditor.h
===================================================================
--- propertyeditor.h	(Revision 459472)
+++ propertyeditor.h	(Arbeitskopie)
@@ -23,12 +23,14 @@
 #ifndef PURE_QT
 #include <klistview.h>
 #else
-#include <qlistview.h>
-#define KListView QListView
-#define KListViewItem QListViewItem
+#include <q3listview.h>
+#define KListView Q3ListView
+#define KListViewItem Q3ListViewItem
 #endif
 
 #include "propertylist.h"
+//Added by qt3to4:
+#include <QGridLayout>
 
 class QPushButton;
 class QGridLayout;
@@ -86,14 +88,14 @@
     void propertyChanged(MultiProperty *property, const QVariant &value);
 
     /**Shows property editor.*/
-    void slotClicked(QListViewItem* item);
+    void slotClicked(Q3ListViewItem* item);
     void updateEditorSize();
     
     /**Undoes the last change in property editor.*/
     void undo();
     
 protected:
-    void editItem(QListViewItem*, int);
+    void editItem(Q3ListViewItem*, int);
     void hideEditor();
     void showEditor(PropertyItem *item);
     void placeEditor(PropertyItem *item);
@@ -117,7 +119,7 @@
     QGridLayout *m_currentEditLayout;
     
     bool m_doubleClickForEdit;
-    QListViewItem* m_lastClickedItem;
+    Q3ListViewItem* m_lastClickedItem;
     
     QPushButton *m_undoButton;
     
Index: pspinbox.cpp
===================================================================
--- pspinbox.cpp	(Revision 459472)
+++ pspinbox.cpp	(Arbeitskopie)
@@ -23,6 +23,8 @@
 
 #include <qspinbox.h>
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
Index: pdateedit.h
===================================================================
--- pdateedit.h	(Revision 459472)
+++ pdateedit.h	(Arbeitskopie)
@@ -22,7 +22,7 @@
 
 #include "propertywidget.h"
 
-class QDateEdit;
+class Q3DateEdit;
 
 namespace PropertyLib{
 
@@ -43,7 +43,7 @@
     void updateProperty(const QDate &val);    
 
 private:
-    QDateEdit *m_edit;
+    Q3DateEdit *m_edit;
 };
 
 }
Index: ppointedit.cpp
===================================================================
--- ppointedit.cpp	(Revision 459472)
+++ ppointedit.cpp	(Arbeitskopie)
@@ -22,6 +22,8 @@
 #include <qlineedit.h>
 #include <qlayout.h>
 #include <qpainter.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
Index: psizepolicyedit.cpp
===================================================================
--- psizepolicyedit.cpp	(Revision 459472)
+++ psizepolicyedit.cpp	(Arbeitskopie)
@@ -23,6 +23,8 @@
 #include <qlayout.h>
 #include <qpainter.h>
 #include <qsizepolicy.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
@@ -47,13 +49,15 @@
     p->setPen(Qt::NoPen);
     p->setBrush(cg.background());
     p->drawRect(r);
-    p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, \
QString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolicy().horData())).arg(f \
indValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch()));
 +    QSizePolicy sp( value.value<QSizePolicy>() );
+    p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, \
QString("%1/%2/%3/%4").arg(findValueDescription(sp.horData())).arg(findValueDescription(sp.verData())).arg(sp.horStretch()).arg(sp.verStretch()));
  }
 
 void PSizePolicyEdit::setValue(const QVariant& value, bool emitChange)
 {
     m_value = value;
-    m_edit->setText(QString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolic \
y().horData())).arg(findValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch()));
 +    QSizePolicy sp( value.value<QSizePolicy>() );
+    m_edit->setText(QString("%1/%2/%3/%4").arg(findValueDescription(sp.horData())).ar \
g(findValueDescription(sp.verData())).arg(sp.horStretch()).arg(sp.verStretch()));  
     if (emitChange)
         emit propertyChanged(m_property, value);
Index: pfontbutton.cpp
===================================================================
--- pfontbutton.cpp	(Revision 459472)
+++ pfontbutton.cpp	(Arbeitskopie)
@@ -22,6 +22,8 @@
 #include <qlayout.h>
 #include <qpainter.h>
 #include <qpushbutton.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #include <kfontrequester.h>
 
@@ -57,7 +59,7 @@
     p->setPen(Qt::NoPen);
     p->setBrush(cg.background());
     p->drawRect(r);
-    QFontInfo fi(value.toFont());
+    QFontInfo fi(value.value<QFont>());
     p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine,
         fi.family() + (fi.bold() ? i18n(" Bold") : QString("")) +
         (fi.italic() ? i18n(" Italic") : QString("")) +
@@ -67,7 +69,7 @@
 void PFontButton::setValue(const QVariant& value, bool emitChange)
 {
     disconnect(m_edit, SIGNAL(fontSelected(const QFont&)), this, \
                SLOT(updateProperty(const QFont&)));
-    m_edit->setFont(value.toFont());
+    m_edit->setFont(value.value<QFont>());
     connect(m_edit, SIGNAL(fontSelected(const QFont& )), this, \
SLOT(updateProperty(const QFont& )));  if (emitChange)
         emit propertyChanged(m_property, value);
Index: purledit.cpp
===================================================================
--- purledit.cpp	(Revision 459472)
+++ purledit.cpp	(Arbeitskopie)
@@ -25,8 +25,10 @@
 #include <qpushbutton.h>
 #include <qlineedit.h>
 #endif
-#include <qfiledialog.h>
+#include <q3filedialog.h>
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
@@ -82,9 +84,9 @@
 #ifdef PURE_QT
     QString path = m_url;
     if( m_mode == Directory )
-	m_url = QFileDialog::getExistingDirectory( m_url,this);
+	m_url = Q3FileDialog::getExistingDirectory( m_url,this);
     else
-        m_url = QFileDialog::getOpenFileName(m_url, QString::null, this);
+        m_url = Q3FileDialog::getOpenFileName(m_url, QString::null, this);
     updateProperty(m_url);
     m_edit->setText(m_url);
 #endif
Index: propertyeditor.cpp
===================================================================
--- propertyeditor.cpp	(Revision 459472)
+++ propertyeditor.cpp	(Arbeitskopie)
@@ -27,12 +27,15 @@
 #include "compat_tools.h"
 #endif
 
-#include <qtable.h>
+#include <q3table.h>
 #include <qlayout.h>
 #include <qpainter.h>
-#include <qptrlist.h>
-#include <qvaluelist.h>
+#include <q3ptrlist.h>
+#include <q3valuelist.h>
 #include <qpushbutton.h>
+//Added by qt3to4:
+#include <QPixmap>
+#include <QGridLayout>
 
 #include "property.h"
 #include "multiproperty.h"
@@ -92,7 +95,7 @@
 #ifndef PURE_QT
             icg.setColor(QColorGroup::Background, backgroundColor());
 #else
-            icg.setColor(QColorGroup::Background, white);
+            icg.setColor(QColorGroup::Background, Qt::white);
 #endif
             m_editor->machine(m_property)->propertyEditor->drawViewer(p, icg, r, \
valueToDraw);  return;
@@ -172,15 +175,15 @@
     addColumn(i18n("Name"));
     addColumn(i18n("Value"));
     setAllColumnsShowFocus(true);
-    setColumnWidthMode(0, QListView::Maximum);
-    setResizeMode(QListView::LastColumn);
+    setColumnWidthMode(0, Q3ListView::Maximum);
+    setResizeMode(Q3ListView::LastColumn);
 
     header()->setClickEnabled(false);
 
     connect(header(), SIGNAL(sizeChange(int, int, int)),
         this, SLOT(updateEditorSize()));
-    connect(this, SIGNAL(currentChanged(QListViewItem*)),
-        this, SLOT(slotClicked(QListViewItem*)));
+    connect(this, SIGNAL(currentChanged(Q3ListViewItem*)),
+        this, SLOT(slotClicked(Q3ListViewItem*)));
 
     m_currentEditItem = 0;
     m_doubleClickForEdit = true;
@@ -215,16 +218,16 @@
         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(); +    const Q3ValueList<QPair<QString, Q3ValueList<QString> > >& \
groups = m_list->propertiesOfGroup(); +    for (Q3ValueList<QPair<QString, \
Q3ValueList<QString> > >::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 Q3ValueList<QString> &properties = \
(*it).second; +        for (Q3ValueList<QString>::const_iterator it2 = \
properties.begin(); it2 != properties.end(); ++it2)  {
 //            qWarning("PropertyEditor::populateProperties:    adding property %s", \
(*it2).ascii());  if (group)
@@ -273,7 +276,7 @@
 //     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 (Q3ValueList<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)));
@@ -302,7 +305,7 @@
     else
     {
 //        repaint all items
-        QListViewItemIterator it(this);
+        Q3ListViewItemIterator it(this);
         while (it.current())
         {
             repaintItem(it.current());
@@ -417,7 +420,7 @@
         placeEditor(m_currentEditItem);
 }
 
-void PropertyEditor::slotClicked(QListViewItem *item)
+void PropertyEditor::slotClicked(Q3ListViewItem *item)
 {
     if (item == 0)
     {
Index: psizeedit.cpp
===================================================================
--- psizeedit.cpp	(Revision 459472)
+++ psizeedit.cpp	(Arbeitskopie)
@@ -22,6 +22,8 @@
 #include <qlineedit.h>
 #include <qlayout.h>
 #include <qpainter.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
Index: pdateedit.cpp
===================================================================
--- pdateedit.cpp	(Revision 459472)
+++ pdateedit.cpp	(Arbeitskopie)
@@ -19,9 +19,11 @@
  ***************************************************************************/
 #include "pdateedit.h"
 
-#include <qdatetimeedit.h>
+#include <q3datetimeedit.h>
 #include <qpainter.h>
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
@@ -29,7 +31,7 @@
     :PropertyWidget(property, parent, name)
 {
     QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
-    m_edit = new QDateEdit(this);
+    m_edit = new Q3DateEdit(this);
     m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, \
QSizePolicy::MinimumExpanding);  l->addWidget(m_edit);
     
Index: pfontcombo.cpp
===================================================================
--- pfontcombo.cpp	(Revision 459472)
+++ pfontcombo.cpp	(Arbeitskopie)
@@ -29,6 +29,8 @@
 
 #ifdef PURE_QT
 #include <qfontdatabase.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 #endif
 
 namespace PropertyLib{
Index: pcheckbox.cpp
===================================================================
--- pcheckbox.cpp	(Revision 459472)
+++ pcheckbox.cpp	(Arbeitskopie)
@@ -22,6 +22,8 @@
 #include <qlayout.h>
 #include <qcheckbox.h>
 #include <qpainter.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #ifndef PURE_QT
 #include <klocale.h>
Index: psymbolcombo.h
===================================================================
--- psymbolcombo.h	(Revision 459472)
+++ psymbolcombo.h	(Arbeitskopie)
@@ -21,6 +21,8 @@
 #define PSYMBOLCOMBO_H
 
 #include "propertywidget.h"
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 class QLineEdit;
 class QPushButton;
Index: pdatetimeedit.cpp
===================================================================
--- pdatetimeedit.cpp	(Revision 459472)
+++ pdatetimeedit.cpp	(Arbeitskopie)
@@ -19,16 +19,18 @@
  ***************************************************************************/
 #include "pdatetimeedit.h"
 
-#include <qdatetimeedit.h>
+#include <q3datetimeedit.h>
 #include <qpainter.h>
 #include <qlayout.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 namespace PropertyLib{
 
 PDateTimeEdit::PDateTimeEdit(MultiProperty* property, QWidget* parent, const char* \
name): PropertyWidget(property, parent, name)  {
     QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
-    m_edit = new QDateTimeEdit(this);
+    m_edit = new Q3DateTimeEdit(this);
     m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, \
QSizePolicy::MinimumExpanding);  l->addWidget(m_edit);
     
Index: ppixmapedit.cpp
===================================================================
--- ppixmapedit.cpp	(Revision 459472)
+++ ppixmapedit.cpp	(Arbeitskopie)
@@ -25,6 +25,12 @@
 #include <qpainter.h>
 #include <qlabel.h>
 #include <qcursor.h>
+//Added by qt3to4:
+#include <QPixmap>
+#include <QEvent>
+#include <QKeyEvent>
+#include <QHBoxLayout>
+#include <QResizeEvent>
 
 #ifndef PURE_QT
 #include <klocale.h>
@@ -35,7 +41,7 @@
 #ifndef PURE_QT
 #include <kfiledialog.h>
 #else
-#include <qfiledialog.h>
+#include <q3filedialog.h>
 #endif
 #include <qpushbutton.h>
 
@@ -57,7 +63,7 @@
     m_button->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
     l->addWidget(m_edit);
     l->addWidget(m_button);
-    m_popup = new QLabel(0, 0, \
Qt::WStyle_NoBorder|Qt::WX11BypassWM|WStyle_StaysOnTop); +    m_popup = new QLabel(0, \
0, Qt::WStyle_NoBorder|Qt::WX11BypassWM/* @todo |WStyle_StaysOnTop*/);  \
m_popup->hide();  
 
@@ -74,12 +80,12 @@
     p->setPen(Qt::NoPen);
     p->setBrush(cg.background());
     p->drawRect(r);
-    p->drawPixmap(r.topLeft().x(), r.topLeft().y(), value.toPixmap());    
+    p->drawPixmap(r.topLeft().x(), r.topLeft().y(), value.value<QPixmap>());    
 }
 
 void PPixmapEdit::setValue(const QVariant& value, bool emitChange)
 {
-    m_edit->setPixmap(value.toPixmap());
+    m_edit->setPixmap(value.value<QPixmap>());
     if (emitChange)
         emit propertyChanged(m_property, value);
 }
@@ -94,7 +100,7 @@
         emit propertyChanged(m_property, value());
     }
 #else
-    QString url = QFileDialog::getOpenFileName();
+    QString url = Q3FileDialog::getOpenFileName();
     if (!url.isEmpty())
     {
         m_edit->setPixmap(QPixmap(url));
@@ -132,7 +138,7 @@
         if(ev->type() == QEvent::KeyPress)
         {
             QKeyEvent* e = static_cast<QKeyEvent*>(ev);
-            if((e->key() == Key_Enter) || (e->key()== Key_Space) || (e->key() == \
Key_Return)) +            if((e->key() == Qt::Key_Enter) || (e->key()== \
Qt::Key_Space) || (e->key() == Qt::Key_Return))  {
                     m_button->animateClick();
                     return true;
Index: childproperty.cpp
===================================================================
--- childproperty.cpp	(Revision 459472)
+++ childproperty.cpp	(Arbeitskopie)
@@ -89,7 +89,7 @@
         case SizePolicy:
         {
             qWarning("ChildProperty::setValue for QSizePolicy");
-            QSizePolicy v = m_parent->value().toSizePolicy();
+            QSizePolicy v = m_parent->value().value<QSizePolicy>();
             if (m_childType == SizePolicy_HorData)
                 v.setHorData(QSizePolicy::SizeType(value.toInt()));
             else if (m_childType == SizePolicy_VerData)
@@ -131,13 +131,13 @@
                 return m_parent->value().toRect().height();
         case SizePolicy:
             if (m_childType == SizePolicy_HorData)
-                return m_parent->value().toSizePolicy().horData();
+                return m_parent->value().value<QSizePolicy>().horData();
             else if (m_childType == SizePolicy_VerData)
-                return m_parent->value().toSizePolicy().verData();
+                return m_parent->value().value<QSizePolicy>().verData();
             else if (m_childType == SizePolicy_HorStretch)
-                return m_parent->value().toSizePolicy().horStretch();
+                return m_parent->value().value<QSizePolicy>().horStretch();
             else if (m_childType == SizePolicy_VerStretch)
-                return m_parent->value().toSizePolicy().verStretch();
+                return m_parent->value().value<QSizePolicy>().verStretch();
     }
     return QVariant();
 }
Index: pcolorbutton.cpp
===================================================================
--- pcolorbutton.cpp	(Revision 459472)
+++ pcolorbutton.cpp	(Arbeitskopie)
@@ -21,13 +21,15 @@
 
 #include <qlayout.h>
 #include <qpainter.h>
+//Added by qt3to4:
+#include <QHBoxLayout>
 
 #ifndef PURE_QT
 #include <kcolorbutton.h>
 #else
 #include <qpushbutton.h>
 #include <qpixmap.h>
-#include <qiconset.h>
+#include <qicon.h>
 #endif
 #include <qcolordialog.h>
 
@@ -67,7 +69,7 @@
     p->setBrush(cg.background());
     p->drawRect(r);
 
-    p->setBrush(value.toColor());
+    p->setBrush(value.value<QColor>());
     p->setPen(Qt::SolidLine);
     QRect r2(r);
     r2.setTopLeft(r.topLeft() + QPoint(5,5));
@@ -79,7 +81,7 @@
 {
 #ifndef PURE_QT
     disconnect(m_edit, SIGNAL(changed(const QColor&)), this, \
                SLOT(updateProperty(const QColor&)));
-    m_edit->setColor(value.toColor());
+    m_edit->setColor(value.value<QColor>());
     connect(m_edit, SIGNAL(changed(const QColor&)), this, SLOT(updateProperty(const \
QColor&)));  #else
     m_color = value.toColor();


_______________________________________________
KDevelop-devel mailing list
KDevelop-devel@barney.cs.uni-potsdam.de
http://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic