[qet] [4296] Improve Basic shapes Properties size function replace QSpinBox by QDoublespinBox , int to double |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4296
Author: scorpio810
Date: 2015-12-30 21:04:17 +0100 (Wed, 30 Dec 2015)
Log Message:
-----------
Improve Basic shapes Properties size function replace QSpinBox by QDoublespinBox, int to double
Modified Paths:
--------------
trunk/sources/qetgraphicsitem/qetshapeitem.cpp
trunk/sources/qetgraphicsitem/qetshapeitem.h
trunk/sources/ui/shapegraphicsitempropertieswidget.cpp
trunk/sources/ui/shapegraphicsitempropertieswidget.ui
Modified: trunk/sources/qetgraphicsitem/qetshapeitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/qetshapeitem.cpp 2015-12-30 13:53:20 UTC (rev 4295)
+++ trunk/sources/qetgraphicsitem/qetshapeitem.cpp 2015-12-30 20:04:17 UTC (rev 4296)
@@ -459,7 +459,7 @@
is_movable_ = (e.attribute("is_movable").toInt());
m_pen.setStyle(Qt::PenStyle(e.attribute("style","0").toInt()));
- m_pen.setWidthF(e.attribute("shape_size", QString::number(shape_size)).toInt());
+ m_pen.setWidthF(e.attribute("shape_size", QString::number(shape_size)).toDouble());
QString type = e.attribute("type");
//Compatibility for version older than N°4075, shape type was stored with an int
Modified: trunk/sources/qetgraphicsitem/qetshapeitem.h
===================================================================
--- trunk/sources/qetgraphicsitem/qetshapeitem.h 2015-12-30 13:53:20 UTC (rev 4295)
+++ trunk/sources/qetgraphicsitem/qetshapeitem.h 2015-12-30 20:04:17 UTC (rev 4296)
@@ -103,7 +103,7 @@
bool m_hovered,
m_mouse_grab_handler;
int m_vector_index;
- int shape_size;
+ double shape_size;
QetGraphicsHandlerUtility m_handler;
};
#endif // QETSHAPEITEM_H
Modified: trunk/sources/ui/shapegraphicsitempropertieswidget.cpp
===================================================================
--- trunk/sources/ui/shapegraphicsitempropertieswidget.cpp 2015-12-30 13:53:20 UTC (rev 4295)
+++ trunk/sources/ui/shapegraphicsitempropertieswidget.cpp 2015-12-30 20:04:17 UTC (rev 4296)
@@ -134,10 +134,10 @@
if (m_live_edit){
connect (ui->m_style_cb, SIGNAL(activated(int)), this, SLOT(apply()));
- connect (ui->m_size_cb, SIGNAL(valueChanged(int)), this, SLOT(apply()));
+ connect (ui->m_size_cb, SIGNAL(valueChanged(double)), this, SLOT(apply()));
}else
disconnect (ui->m_style_cb, SIGNAL(activated(int)), this, SLOT(apply()));
- disconnect (ui->m_size_cb, SIGNAL(valueChanged(int)), this, SLOT(apply()));
+ disconnect (ui->m_size_cb, SIGNAL(valueChanged(double)), this, SLOT(apply()));
return true;
}
Modified: trunk/sources/ui/shapegraphicsitempropertieswidget.ui
===================================================================
--- trunk/sources/ui/shapegraphicsitempropertieswidget.ui 2015-12-30 13:53:20 UTC (rev 4295)
+++ trunk/sources/ui/shapegraphicsitempropertieswidget.ui 2015-12-30 20:04:17 UTC (rev 4296)
@@ -61,19 +61,28 @@
</property>
</widget>
</item>
- <item>
- <widget class="QSpinBox" name="m_size_cb">
+ <item alignment="Qt::AlignRight">
+ <widget class="QDoubleSpinBox" name="m_size_cb">
+ <property name="maximumSize">
+ <size>
+ <width>16777212</width>
+ <height>16777215</height>
+ </size>
+ </property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectToNearestValue</enum>
</property>
<property name="minimum">
- <number>1</number>
+ <double>0.400000000000000</double>
</property>
<property name="maximum">
- <number>20</number>
+ <double>50.000000000000000</double>
</property>
+ <property name="singleStep">
+ <double>0.200000000000000</double>
+ </property>
<property name="value">
- <number>1</number>
+ <double>1.000000000000000</double>
</property>
</widget>
</item>