[qet] qet/qet: [5194] Basic shape add new CustomDashLine style with

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5194
Author:   scorpio810
Date:     2017-12-30 00:13:35 +0100 (Sat, 30 Dec 2017)
Log Message:
-----------
Basic shape add new CustomDashLine style with
Dash Pattern (<< 10 << 10 );

Modified Paths:
--------------
    trunk/sources/qetxml.cpp
    trunk/sources/ui/shapegraphicsitempropertieswidget.cpp
    trunk/sources/ui/shapegraphicsitempropertieswidget.ui

Modified: trunk/sources/qetxml.cpp
===================================================================
--- trunk/sources/qetxml.cpp	2017-12-28 13:29:20 UTC (rev 5193)
+++ trunk/sources/qetxml.cpp	2017-12-29 23:13:35 UTC (rev 5194)
@@ -39,6 +39,7 @@
 		case Qt::DotLine        : style = "DotLine";        break;
 		case Qt::DashDotLine    : style = "DashDotLine";    break;
 		case Qt::DashDotDotLine : style = "DashDotDotLine"; break;
+		case Qt::CustomDashLine : style = "CustomDashLine"; break;
 		default                 : style = "Unknow";         break;
 	}
 
@@ -71,6 +72,8 @@
 	else if (style == "DotLine")        pen.setStyle(Qt::DotLine);
 	else if (style == "DashDotLine")    pen.setStyle(Qt::DashDotLine);
 	else if (style == "DashDotDotLine") pen.setStyle(Qt::DashDotDotLine);
+	else if (style == "CustomDashLine") pen.setStyle(Qt::CustomDashLine),
+	pen.setDashPattern( QVector<qreal>() << 10 << 10 );
 	else                                pen.setStyle(Qt::DashLine);
 
 	pen.setColor(QColor(element.attribute("color", "#000000")));

Modified: trunk/sources/ui/shapegraphicsitempropertieswidget.cpp
===================================================================
--- trunk/sources/ui/shapegraphicsitempropertieswidget.cpp	2017-12-28 13:29:20 UTC (rev 5193)
+++ trunk/sources/ui/shapegraphicsitempropertieswidget.cpp	2017-12-29 23:13:35 UTC (rev 5194)
@@ -109,6 +109,12 @@
 
 	new_pen.setStyle(Qt::PenStyle(ui->m_style_cb->currentIndex() + 1));
 	new_pen.setWidthF(ui->m_size_dsb->value());
+	
+	if (ui->m_style_cb->currentIndex() ==5) {
+	new_pen.setDashPattern( QVector<qreal>() << 10 << 10 );
+	new_pen.setStyle( Qt::CustomDashLine );
+	}
+	//painter.setPen( new_pen );
 	new_pen.setColor(ui->m_color_pb->palette().color(QPalette::Button));
 
 	if (new_pen != old_pen)

Modified: trunk/sources/ui/shapegraphicsitempropertieswidget.ui
===================================================================
--- trunk/sources/ui/shapegraphicsitempropertieswidget.ui	2017-12-28 13:29:20 UTC (rev 5193)
+++ trunk/sources/ui/shapegraphicsitempropertieswidget.ui	2017-12-29 23:13:35 UTC (rev 5194)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>261</width>
-    <height>293</height>
+    <height>346</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -54,6 +54,11 @@
           <string>Traits points points</string>
          </property>
         </item>
+        <item>
+         <property name="text">
+          <string>Tiret custom</string>
+         </property>
+        </item>
        </widget>
       </item>
       <item row="1" column="1">


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/