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

List:       kde-commits
Subject:    koffice/lib/kofficeui
From:       Thomas Zander <zander () kde ! org>
Date:       2005-12-07 19:57:10
Message-ID: 1133985430.512501.579.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 486424 by zander:

Add a signal to the spinbox that emits the point based value instead
of the current-unit based value.


 M  +8 -0      koUnitWidgets.cc  
 M  +10 -0     koUnitWidgets.h  


--- trunk/koffice/lib/kofficeui/koUnitWidgets.cc #486423:486424
@@ -127,6 +127,8 @@
     QSpinBox::setValidator( m_validator );
     setAcceptLocalizedNumbers( true );
     setUnit( KoUnit::U_PT );
+
+    connect(this, SIGNAL(valueChanged( double )), SLOT(privateValueChanged()));
 }
 
 
@@ -148,6 +150,8 @@
     setUnit( unit );
     changeValue( value );
     setLineStep( 0.5 );
+
+    connect(this, SIGNAL(valueChanged( double )), SLOT(privateValueChanged()));
 }
 
 void
@@ -159,6 +163,10 @@
     // a proper value is getting saved.
 }
 
+void KoUnitDoubleSpinBox::privateValueChanged() {
+    emit valueChangedPt( value () );
+}
+
 void
 KoUnitDoubleSpinBox::setUnit( KoUnit::Unit unit )
 {
--- trunk/koffice/lib/kofficeui/koUnitWidgets.h #486423:486424
@@ -133,10 +133,20 @@
 
     /// Set minimum, maximum value and the step size (all in points) (by Tymoteusz Majewski, maju7@o2.pl)
     void setMinMaxStep( double min, double max, double step );
+
+signals:
+    /// emitted like valueChanged in the parent, but this one emits the point value
+    void valueChangedPt( double );
+
+
 private:
     double m_lowerInPoints; ///< lowest value in points
     double m_upperInPoints; ///< highest value in points
     double m_stepInPoints;  ///< step in points
+
+private slots:
+    // exists to do emits for valueChangedPt
+    void privateValueChanged();
 };
 
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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