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

List:       kde-commits
Subject:    kdevelop/lib/widgets/propeditor
From:       Zack Rusin <zack () kde ! org>
Date:       2004-10-06 18:53:59
Message-ID: 20041006185359.5B5FA126F2 () office ! kde ! org
[Download RAW message or body]

CVS commit by zrusin: 

fixes for the double handling


  M +10 -3     pdoublenuminput.cpp   1.8
  M +3 -0      pdoublenuminput.h   1.6


--- kdevelop/lib/widgets/propeditor/pdoublenuminput.cpp  #1.7:1.8
@@ -39,6 +39,8 @@ PDoubleNumInput::PDoubleNumInput(MultiPr
     m_edit = new KDoubleNumInput(-999999.0, 999999.0, 0.0, 0.01, 2, this);
     m_edit->setLabel(QString::null);
+    connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
 #else
     m_edit = new QFloatInput(-999999, 999999, 0.01, 2, this );
+    connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
 #endif
     m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
@@ -48,5 +50,4 @@ PDoubleNumInput::PDoubleNumInput(MultiPr
     l->addWidget(m_edit);
 
-    connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
 }
 
@@ -58,11 +59,13 @@ QVariant PDoubleNumInput::value() const
 void PDoubleNumInput::setValue(const QVariant &value, bool emitChange)
 {
-    disconnect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
 #ifndef PURE_QT
+    disconnect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
     m_edit->setValue(value.toDouble());
+    connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
 #else
+    disconnect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
     m_edit->setValue(int(value.toDouble()*pow(m_edit->digits(),10)));
+    connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
 #endif
-    connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
     if (emitChange)
         emit propertyChanged(m_property, value);
@@ -73,4 +76,8 @@ void PDoubleNumInput::updateProperty(dou
     emit propertyChanged(m_property, QVariant(val));
 }
+void PDoubleNumInput::updateProperty(int val)
+{
+    emit propertyChanged(m_property, QVariant(val));
+}
 
 }

--- kdevelop/lib/widgets/propeditor/pdoublenuminput.h  #1.5:1.6
@@ -47,5 +47,8 @@ public:
 
 private slots:
+    //because of a bug in moc which doesn't detect conditional slots
+    //we need them both
     void updateProperty(double val);
+    void updateProperty(int val);
 
 private:


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

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