This commit is contained in:
Matthias Koefferlein 2021-11-25 19:53:00 +01:00
parent 646a207e00
commit c3010745ec
17 changed files with 442 additions and 314 deletions

View File

@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditablePathPropertiesPage</class> <class>EditablePathPropertiesPage</class>
<widget class="QWidget" name="EditablePathPropertiesPage" > <widget class="QWidget" name="EditablePathPropertiesPage">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,25 +10,34 @@
<height>378</height> <height>378</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="margin" > <property name="leftMargin">
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="5" column="0" colspan="3" > <item row="5" column="0" colspan="3">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>456</width> <width>456</width>
<height>16</height> <height>16</height>
@ -35,45 +45,54 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="7" column="1" colspan="2" > <item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="abs_cb" > <widget class="QCheckBox" name="abs_cb">
<property name="text" > <property name="text">
<string>Absolute (accumulated) transformations</string> <string>Absolute (accumulated) transformations</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1" colspan="2" > <item row="6" column="1" colspan="2">
<widget class="QCheckBox" name="dbu_cb" > <widget class="QCheckBox" name="dbu_cb">
<property name="text" > <property name="text">
<string>Coordinates in database units</string> <string>Coordinates in database units</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item row="3" column="0">
<widget class="QLabel" name="label_4" > <widget class="QLabel" name="label_4">
<property name="text" > <property name="text">
<string>Extension type</string> <string>Extension type</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="3" > <item row="0" column="0" colspan="3">
<widget class="QFrame" name="frame1" > <widget class="QFrame" name="frame1">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="label_12" > <widget class="QLabel" name="label_12">
<property name="font" > <property name="font">
<font> <font>
<family>Sans Serif</family> <family>Sans Serif</family>
<pointsize>12</pointsize> <pointsize>12</pointsize>
@ -84,25 +103,23 @@
<strikeout>false</strikeout> <strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="text" > <property name="text">
<string>Path Properties</string> <string>Path Properties</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="layer_lbl" > <widget class="QLabel" name="layer_lbl">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<hsizetype>7</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
@ -110,62 +127,66 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="label_2">
<property name="text" > <property name="text">
<string>Width</string> <string>Width</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0">
<widget class="QLabel" name="label_3" > <widget class="QLabel" name="label_3">
<property name="text" > <property name="text">
<string>Points (x,y)</string> <string>Points (x,y)</string>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="2" > <item row="2" column="1" colspan="2">
<widget class="QTextEdit" name="ptlist_le" > <widget class="QTextEdit" name="ptlist_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="lineWidth" > <property name="lineWidth">
<number>2</number> <number>2</number>
</property> </property>
<property name="tabStopWidth" >
<number>100</number>
</property>
</widget> </widget>
</item> </item>
<item row="8" column="0" colspan="3" > <item row="8" column="0" colspan="3">
<widget class="QFrame" name="frame2" > <widget class="QFrame" name="frame2">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="topMargin">
<number>6</number> <number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>211</width> <width>211</width>
<height>20</height> <height>20</height>
@ -174,15 +195,15 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="prop_pb" > <widget class="QPushButton" name="prop_pb">
<property name="text" > <property name="text">
<string>User Properties</string> <string>User Properties</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="inst_pb" > <widget class="QPushButton" name="inst_pb">
<property name="text" > <property name="text">
<string>Instantiation</string> <string>Instantiation</string>
</property> </property>
</widget> </widget>
@ -190,34 +211,41 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="2" > <item row="4" column="1" colspan="2">
<widget class="QFrame" name="frame_2" > <widget class="QFrame" name="frame_2">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="label_6" > <widget class="QLabel" name="label_6">
<property name="text" > <property name="text">
<string>start =</string> <string>start =</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="start_ext_le" > <widget class="QLineEdit" name="start_ext_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -225,18 +253,16 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_8" > <widget class="QLabel" name="label_8">
<property name="text" > <property name="text">
<string> end =</string> <string> end =</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="end_ext_le" > <widget class="QLineEdit" name="end_ext_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -246,24 +272,22 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="1" column="1">
<widget class="QLineEdit" name="width_le" > <widget class="QLineEdit" name="width_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2" > <item row="1" column="2">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>191</width> <width>191</width>
<height>25</height> <height>25</height>
@ -271,40 +295,38 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="4" column="0" > <item row="4" column="0">
<widget class="QLabel" name="label" > <widget class="QLabel" name="label">
<property name="text" > <property name="text">
<string>Var. extensions </string> <string>Var. extensions </string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1" colspan="2" > <item row="3" column="1" colspan="2">
<widget class="QComboBox" name="type_cb" > <widget class="QComboBox" name="type_cb">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<item> <item>
<property name="text" > <property name="text">
<string>Flush</string> <string>Flush</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>Square</string> <string>Square</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>Variable</string> <string>Variable</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text" > <property name="text">
<string>Round</string> <string>Round</string>
</property> </property>
</item> </item>

View File

@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PathPropertiesPage</class> <class>PathPropertiesPage</class>
<widget class="QWidget" name="PathPropertiesPage" > <widget class="QWidget" name="PathPropertiesPage">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,44 +10,60 @@
<height>368</height> <height>368</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="margin" > <property name="leftMargin">
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="3" column="1" colspan="2" > <item row="3" column="1" colspan="2">
<widget class="QFrame" name="frame_2" > <widget class="QFrame" name="frame_2">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="label_6" > <widget class="QLabel" name="label_6">
<property name="text" > <property name="text">
<string>start =</string> <string>start =</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="start_ext_le" > <widget class="QLineEdit" name="start_ext_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -54,18 +71,16 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_8" > <widget class="QLabel" name="label_8">
<property name="text" > <property name="text">
<string> end =</string> <string> end =</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="end_ext_le" > <widget class="QLineEdit" name="end_ext_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -75,41 +90,50 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="7" column="1" colspan="2" > <item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="abs_cb" > <widget class="QCheckBox" name="abs_cb">
<property name="text" > <property name="text">
<string>Absolute (accumulated) transformations</string> <string>Absolute (accumulated) transformations</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1" colspan="2" > <item row="6" column="1" colspan="2">
<widget class="QCheckBox" name="dbu_cb" > <widget class="QCheckBox" name="dbu_cb">
<property name="text" > <property name="text">
<string>Coordinates in database units</string> <string>Coordinates in database units</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0" colspan="3" > <item row="8" column="0" colspan="3">
<widget class="QFrame" name="frame1" > <widget class="QFrame" name="frame1">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="topMargin">
<number>6</number> <number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>211</width> <width>211</width>
<height>20</height> <height>20</height>
@ -118,15 +142,15 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="prop_pb" > <widget class="QPushButton" name="prop_pb">
<property name="text" > <property name="text">
<string>User Properties</string> <string>User Properties</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="inst_pb" > <widget class="QPushButton" name="inst_pb">
<property name="text" > <property name="text">
<string>Instantiation</string> <string>Instantiation</string>
</property> </property>
</widget> </widget>
@ -134,33 +158,28 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="2" > <item row="2" column="1" colspan="2">
<widget class="QTextEdit" name="ptlist_le" > <widget class="QTextEdit" name="ptlist_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="lineWidth" > <property name="lineWidth">
<number>2</number> <number>2</number>
</property> </property>
<property name="tabStopWidth" >
<number>100</number>
</property>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="3" > <item row="5" column="0" colspan="3">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>451</width> <width>451</width>
<height>8</height> <height>8</height>
@ -168,12 +187,12 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="2" > <item row="1" column="2">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>135</width> <width>135</width>
<height>20</height> <height>20</height>
@ -181,60 +200,67 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="0" > <item row="3" column="0">
<widget class="QLabel" name="label" > <widget class="QLabel" name="label">
<property name="text" > <property name="text">
<string>Extensions</string> <string>Extensions</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="1" column="1">
<widget class="QLineEdit" name="width_le" > <widget class="QLineEdit" name="width_le">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0">
<widget class="QLabel" name="label_3" > <widget class="QLabel" name="label_3">
<property name="text" > <property name="text">
<string>Points (x,y)</string> <string>Points (x,y)</string>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="label_2">
<property name="text" > <property name="text">
<string>Width</string> <string>Width</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="3" > <item row="0" column="0" colspan="3">
<widget class="QFrame" name="frame2" > <widget class="QFrame" name="frame2">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="label_12" > <widget class="QLabel" name="label_12">
<property name="font" > <property name="font">
<font> <font>
<family>Sans Serif</family> <family>Sans Serif</family>
<pointsize>12</pointsize> <pointsize>12</pointsize>
@ -245,25 +271,23 @@
<strikeout>false</strikeout> <strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="text" > <property name="text">
<string>Path Properties</string> <string>Path Properties</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="layer_lbl" > <widget class="QLabel" name="layer_lbl">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<hsizetype>7</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
@ -271,9 +295,9 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="1" > <item row="4" column="1">
<widget class="QCheckBox" name="round_cb" > <widget class="QCheckBox" name="round_cb">
<property name="text" > <property name="text">
<string>Round path ends</string> <string>Round path ends</string>
</property> </property>
</widget> </widget>

View File

@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PolygonPropertiesPage</class> <class>PolygonPropertiesPage</class>
<widget class="QWidget" name="PolygonPropertiesPage" > <widget class="QWidget" name="PolygonPropertiesPage">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,22 +10,31 @@
<height>282</height> <height>282</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="margin" > <property name="leftMargin">
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="3" column="0" > <item row="3" column="0">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
@ -32,63 +42,70 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="2" column="0" > <item row="2" column="0">
<widget class="QLabel" name="pointCountLabel" > <widget class="QLabel" name="pointCountLabel">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<widget class="QLabel" name="label_3" > <widget class="QLabel" name="label_3">
<property name="text" > <property name="text">
<string>Points (x,y)</string> <string>Points (x,y)</string>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1" > <item row="6" column="1">
<widget class="QCheckBox" name="abs_cb" > <widget class="QCheckBox" name="abs_cb">
<property name="text" > <property name="text">
<string>Absolute (accumulated) transformations</string> <string>Absolute (accumulated) transformations</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1" > <item row="5" column="1">
<widget class="QCheckBox" name="dbu_cb" > <widget class="QCheckBox" name="dbu_cb">
<property name="text" > <property name="text">
<string>Coordinates in database units</string> <string>Coordinates in database units</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="2" > <item row="0" column="0" colspan="2">
<widget class="QFrame" name="frame" > <widget class="QFrame" name="frame">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="label_12" > <widget class="QLabel" name="label_12">
<property name="font" > <property name="font">
<font> <font>
<family>Sans Serif</family> <family>Sans Serif</family>
<pointsize>12</pointsize> <pointsize>12</pointsize>
@ -99,25 +116,23 @@
<strikeout>false</strikeout> <strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="text" > <property name="text">
<string>Polygon Properties</string> <string>Polygon Properties</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="layer_lbl" > <widget class="QLabel" name="layer_lbl">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<hsizetype>7</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
@ -125,27 +140,36 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="7" column="0" colspan="2" > <item row="7" column="0" colspan="2">
<widget class="QFrame" name="frame1" > <widget class="QFrame" name="frame1">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="topMargin">
<number>6</number> <number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>211</width> <width>211</width>
<height>20</height> <height>20</height>
@ -154,15 +178,15 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="prop_pb" > <widget class="QPushButton" name="prop_pb">
<property name="text" > <property name="text">
<string>User Properties</string> <string>User Properties</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="inst_pb" > <widget class="QPushButton" name="inst_pb">
<property name="text" > <property name="text">
<string>Instantiation</string> <string>Instantiation</string>
</property> </property>
</widget> </widget>
@ -170,33 +194,28 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item rowspan="3" row="1" column="1" > <item row="1" column="1" rowspan="3">
<widget class="QTextEdit" name="pointListEdit" > <widget class="QTextEdit" name="pointListEdit">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="lineWidth" > <property name="lineWidth">
<number>2</number> <number>2</number>
</property> </property>
<property name="tabStopWidth" >
<number>100</number>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="2" > <item row="4" column="0" colspan="2">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>470</width> <width>470</width>
<height>16</height> <height>16</height>

View File

@ -388,6 +388,12 @@ PolygonPropertiesPage::PolygonPropertiesPage (edt::Service *service, db::Manager
setupUi (this); setupUi (this);
setup (); setup ();
#if QT_VERSION >= 0x60000
pointListEdit->setTabStopDistance (100);
#else
pointListEdit->setTabStopWidth (100);
#endif
connect (inst_pb, SIGNAL (clicked ()), this, SLOT (show_inst ())); connect (inst_pb, SIGNAL (clicked ()), this, SLOT (show_inst ()));
connect (prop_pb, SIGNAL (clicked ()), this, SLOT (show_props ())); connect (prop_pb, SIGNAL (clicked ()), this, SLOT (show_props ()));
@ -905,6 +911,12 @@ PathPropertiesPage::PathPropertiesPage (edt::Service *service, db::Manager *mana
setupUi (this); setupUi (this);
setup (); setup ();
#if QT_VERSION >= 0x60000
ptlist_le->setTabStopDistance (100);
#else
ptlist_le->setTabStopWidth (100);
#endif
connect (inst_pb, SIGNAL (clicked ()), this, SLOT (show_inst ())); connect (inst_pb, SIGNAL (clicked ()), this, SLOT (show_inst ()));
connect (prop_pb, SIGNAL (clicked ()), this, SLOT (show_props ())); connect (prop_pb, SIGNAL (clicked ()), this, SLOT (show_props ()));
@ -966,6 +978,12 @@ EditablePathPropertiesPage::EditablePathPropertiesPage (edt::Service *service, d
setupUi (this); setupUi (this);
setup (); setup ();
#if QT_VERSION >= 0x60000
ptlist_le->setTabStopDistance (100);
#else
ptlist_le->setTabStopWidth (100);
#endif
connect (inst_pb, SIGNAL (clicked ()), this, SLOT (show_inst ())); connect (inst_pb, SIGNAL (clicked ()), this, SLOT (show_inst ()));
connect (prop_pb, SIGNAL (clicked ()), this, SLOT (show_props ())); connect (prop_pb, SIGNAL (clicked ()), this, SLOT (show_props ()));
connect (type_cb, SIGNAL (currentIndexChanged (int)), this, SLOT (type_selected (int))); connect (type_cb, SIGNAL (currentIndexChanged (int)), this, SLOT (type_selected (int)));

View File

@ -33,6 +33,7 @@
#include <QColor> #include <QColor>
#include <QPalette> #include <QPalette>
#include <QApplication> #include <QApplication>
#include <QRegExp>
#include <cstdio> #include <cstdio>
#include <cctype> #include <cctype>

View File

@ -1550,7 +1550,11 @@ int
MacroEditorDialog::columns () MacroEditorDialog::columns ()
{ {
QFontMetrics fm (mp_console_text->font ()); QFontMetrics fm (mp_console_text->font ());
#if QT_VERSION >= 0x60000
int cw = fm.horizontalAdvance (QString::fromUtf8 ("X"));
#else
int cw = fm.width (QString::fromUtf8 ("X")); int cw = fm.width (QString::fromUtf8 ("X"));
#endif
if (cw > 0) { if (cw > 0) {
return mp_console_text->viewport ()->width () / cw; return mp_console_text->viewport ()->width () / cw;
} else { } else {

View File

@ -343,7 +343,13 @@ void MacroEditorSidePanel::set_debugging_on (bool on)
QSize MacroEditorSidePanel::sizeHint () const QSize MacroEditorSidePanel::sizeHint () const
{ {
return QSize (QFontMetrics (mp_text->font ()).width (QString::fromUtf8 ("12345")) + 3 * sidePanelMargin + m_breakpoint_pixmap.width (), 0); int w;
#if QT_VERSION >= 0x60000
w = QFontMetrics (mp_text->font ()).horizontalAdvance (QString::fromUtf8 ("12345"));
#else
w = QFontMetrics (mp_text->font ()).width (QString::fromUtf8 ("12345"));
#endif
return QSize (w + 3 * sidePanelMargin + m_breakpoint_pixmap.width (), 0);
} }
void MacroEditorSidePanel::mousePressEvent (QMouseEvent *event) void MacroEditorSidePanel::mousePressEvent (QMouseEvent *event)
@ -502,7 +508,11 @@ MacroEditorPage::MacroEditorPage (QWidget * /*parent*/, MacroEditorHighlighters
hlayout->addWidget (mp_text); hlayout->addWidget (mp_text);
mp_text->setWordWrapMode(QTextOption::NoWrap); mp_text->setWordWrapMode(QTextOption::NoWrap);
#if QT_VERSION >= 0x60000
mp_text->setTabStopDistance (m_ntab * QFontMetrics (mp_text->font ()).horizontalAdvance (QString::fromUtf8 ("x")));
#else
mp_text->setTabStopWidth (m_ntab * QFontMetrics (mp_text->font ()).width (QString::fromUtf8 ("x"))); mp_text->setTabStopWidth (m_ntab * QFontMetrics (mp_text->font ()).width (QString::fromUtf8 ("x")));
#endif
m_is_modified = false; m_is_modified = false;
connect (mp_text, SIGNAL (textChanged ()), this, SLOT (text_changed ())); connect (mp_text, SIGNAL (textChanged ()), this, SLOT (text_changed ()));
@ -959,7 +969,11 @@ void MacroEditorPage::set_ntab (int n)
{ {
if (n != m_ntab) { if (n != m_ntab) {
m_ntab = n; m_ntab = n;
#if QT_VERSION >= 0x60000
mp_text->setTabStopDistance (m_ntab * QFontMetrics (mp_text->font ()).horizontalAdvance (QString::fromUtf8 ("x")));
#else
mp_text->setTabStopWidth (m_ntab * QFontMetrics (mp_text->font ()).width (QString::fromUtf8 ("x"))); mp_text->setTabStopWidth (m_ntab * QFontMetrics (mp_text->font ()).width (QString::fromUtf8 ("x")));
#endif
} }
} }

View File

@ -20,8 +20,6 @@
*/ */
#ifndef HDR_layMacroEditorPage #ifndef HDR_layMacroEditorPage
#define HDR_layMacroEditorPage #define HDR_layMacroEditorPage
@ -32,6 +30,7 @@
#include <QDialog> #include <QDialog>
#include <QPixmap> #include <QPixmap>
#include <QRegExp>
#include <set> #include <set>

View File

@ -71,20 +71,17 @@ pretty_print (const tl::Variant &v)
} else if (v.is_double ()) { } else if (v.is_double ()) {
QString res; QString res (QString::fromUtf8 ("%.12g").arg (v.to_double ()));
res.sprintf ("%.12g", v.to_double ());
return res; return res;
} else if (v.is_char ()) { } else if (v.is_char ()) {
QString details; QString details (QString::fromUtf8 ("#%d (0x%x)").arg (v.to_int ()).arg (v.to_uint ()));
details.sprintf ("#%d (0x%x)", v.to_int (), v.to_uint ());
return tl::to_qstring (std::string ("'") + v.to_string () + "' ") + details; return tl::to_qstring (std::string ("'") + v.to_string () + "' ") + details;
} else if (v.is_ulong () || v.is_long () || v.is_ulonglong () || v.is_longlong ()) { } else if (v.is_ulong () || v.is_long () || v.is_ulonglong () || v.is_longlong ()) {
QString details; QString details (QString::fromUtf8 ("(0x%llx)").arg (v.to_ulonglong ()));
details.sprintf (" (0x%llx)", v.to_ulonglong ());
return tl::to_qstring (v.to_string ()) + details; return tl::to_qstring (v.to_string ()) + details;
} else { } else {

View File

@ -793,6 +793,15 @@ MainWindow::tech_message (const std::string &s)
mp_tech_status_label->setText(tl::to_qstring (s)); mp_tech_status_label->setText(tl::to_qstring (s));
} }
static int fm_width (const QFontMetrics &fm, const QString &s)
{
#if QT_VERSION >= 0x60000
return fm.horizontalAdvance (s);
#else
return fm.width (QString::fromUtf8 (s));
#endif
}
void void
MainWindow::format_message () MainWindow::format_message ()
{ {
@ -841,7 +850,7 @@ MainWindow::format_message ()
++ndrop; ++ndrop;
} while (short_message.size () < prev_len && fm.width (QString::fromUtf8 (" ") + tl::to_qstring (short_message)) > mp_msg_label->width ()); } while (short_message.size () < prev_len && fm_width (fm, QString::fromUtf8 (" ") + tl::to_qstring (short_message)) > mp_msg_label->width ());
mp_msg_label->setText (QString::fromUtf8 (" ") + tl::to_qstring (short_message)); mp_msg_label->setText (QString::fromUtf8 (" ") + tl::to_qstring (short_message));
mp_msg_label->setToolTip (tl::to_qstring (full_message)); mp_msg_label->setToolTip (tl::to_qstring (full_message));
@ -1579,7 +1588,11 @@ MainWindow::cm_print ()
QFont header_font (QString::fromUtf8 ("Helvetica"), 8); QFont header_font (QString::fromUtf8 ("Helvetica"), 8);
int hh = QFontMetrics (header_font, mp_printer.get ()).height (); int hh = QFontMetrics (header_font, mp_printer.get ()).height ();
QRect page_rect = mp_printer->pageRect (); #if QT_VERSION >= 0x60000
QRectF page_rect = mp_printer->pageRect (QPrinter::DevicePixel);
#else
QRectF page_rect = mp_printer->pageRect ();
#endif
page_rect.moveTo (0, 0); page_rect.moveTo (0, 0);
int b = std::min (page_rect.width (), page_rect.height ()) / 50; int b = std::min (page_rect.width (), page_rect.height ()) / 50;
@ -1588,7 +1601,7 @@ MainWindow::cm_print ()
page_rect.setTop (page_rect.top () + b); page_rect.setTop (page_rect.top () + b);
page_rect.setBottom (page_rect.bottom () - b); page_rect.setBottom (page_rect.bottom () - b);
QRect text_rect = page_rect; QRectF text_rect = page_rect;
text_rect.setLeft (text_rect.left () + hh / 2); text_rect.setLeft (text_rect.left () + hh / 2);
text_rect.setRight (text_rect.right () - hh / 2); text_rect.setRight (text_rect.right () - hh / 2);
text_rect.setBottom (text_rect.bottom () - hh / 2); text_rect.setBottom (text_rect.bottom () - hh / 2);

View File

@ -90,7 +90,11 @@ QSize
ProgressBarWidget::sizeHint () const ProgressBarWidget::sizeHint () const
{ {
QFontMetrics fm (font ()); QFontMetrics fm (font ());
#if QT_VERSION >= 0x60000
return QSize (fm.horizontalAdvance (QString::fromUtf8("100%")) * 4, fm.height () + 2);
#else
return QSize (fm.width (QString::fromUtf8("100%")) * 4, fm.height () + 2); return QSize (fm.width (QString::fromUtf8("100%")) * 4, fm.height () + 2);
#endif
} }
QSize QSize

View File

@ -85,8 +85,8 @@ ConfirmationDialog::mark_fetching (const std::string &name)
if (i != m_items_by_name.end ()) { if (i != m_items_by_name.end ()) {
list->scrollToItem (i->second); list->scrollToItem (i->second);
for (int c = 0; c < list->columnCount (); ++c) { for (int c = 0; c < list->columnCount (); ++c) {
i->second->setData (c, Qt::BackgroundColorRole, QColor (224, 244, 244)); i->second->setData (c, Qt::BackgroundRole, QColor (224, 244, 244));
i->second->setData (c, Qt::TextColorRole, QColor (Qt::blue)); i->second->setData (c, Qt::ForegroundRole, QColor (Qt::blue));
} }
i->second->setData (1, Qt::DisplayRole, tr ("FETCHING")); i->second->setData (1, Qt::DisplayRole, tr ("FETCHING"));
} }
@ -101,8 +101,8 @@ ConfirmationDialog::mark_error (const std::string &name)
if (i != m_items_by_name.end ()) { if (i != m_items_by_name.end ()) {
list->scrollToItem (i->second); list->scrollToItem (i->second);
for (int c = 0; c < list->columnCount (); ++c) { for (int c = 0; c < list->columnCount (); ++c) {
i->second->setData (c, Qt::BackgroundColorRole, QColor (255, 224, 244)); i->second->setData (c, Qt::BackgroundRole, QColor (255, 224, 244));
i->second->setData (c, Qt::TextColorRole, QColor (Qt::black)); i->second->setData (c, Qt::ForegroundRole, QColor (Qt::black));
} }
i->second->setData (1, Qt::DisplayRole, tr ("ERROR")); i->second->setData (1, Qt::DisplayRole, tr ("ERROR"));
} }
@ -117,8 +117,8 @@ ConfirmationDialog::mark_success (const std::string &name)
if (i != m_items_by_name.end ()) { if (i != m_items_by_name.end ()) {
list->scrollToItem (i->second); list->scrollToItem (i->second);
for (int c = 0; c < list->columnCount (); ++c) { for (int c = 0; c < list->columnCount (); ++c) {
i->second->setData (c, Qt::BackgroundColorRole, QColor (160, 255, 160)); i->second->setData (c, Qt::BackgroundRole, QColor (160, 255, 160));
i->second->setData (c, Qt::TextColorRole, QColor (Qt::black)); i->second->setData (c, Qt::ForegroundRole, QColor (Qt::black));
} }
i->second->setData (1, Qt::DisplayRole, tr ("INSTALLED")); i->second->setData (1, Qt::DisplayRole, tr ("INSTALLED"));
} }

View File

@ -463,7 +463,11 @@ SaltGrain::load (const std::string &p)
QResource res (tl::to_qstring (p)); QResource res (tl::to_qstring (p));
QByteArray data; QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) { if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ()); data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else { } else {
data = QByteArray ((const char *)res.data (), (int)res.size ()); data = QByteArray ((const char *)res.data (), (int)res.size ());

View File

@ -181,7 +181,11 @@ SaltGrainDetailsTextWidget::details_text ()
QBuffer buffer; QBuffer buffer;
buffer.open (QIODevice::WriteOnly); buffer.open (QIODevice::WriteOnly);
QTextStream stream (&buffer); QTextStream stream (&buffer);
#if QT_VERSION >= 0x60000
stream.setEncoding (QStringConverter::Utf8);
#else
stream.setCodec ("UTF-8"); stream.setCodec ("UTF-8");
#endif
stream << "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/></head><body>"; stream << "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/></head><body>";

View File

@ -43,6 +43,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include <QStyledItemDelegate> #include <QStyledItemDelegate>
#include <QRegExp>
namespace lay namespace lay
{ {

View File

@ -42,6 +42,7 @@
#include <QInputDialog> #include <QInputDialog>
#include <QHeaderView> #include <QHeaderView>
#include <QRegExp>
#include <fstream> #include <fstream>
@ -1249,8 +1250,7 @@ SearchReplaceDialog::update_mru_list ()
for (std::vector<std::string>::const_iterator mru = m_mru.begin (); mru != m_mru.end (); ++mru) { for (std::vector<std::string>::const_iterator mru = m_mru.begin (); mru != m_mru.end (); ++mru) {
QString text = tl::to_qstring (*mru); QString text = tl::to_qstring (*mru);
QString display_text = text; QString display_text = text.simplified ();
display_text.replace (QRegExp (QString::fromUtf8 ("\\s+")), QString::fromUtf8 (" "));
int nmax = 50; int nmax = 50;
if (display_text.size () > nmax) { if (display_text.size () > nmax) {
display_text = display_text.left (nmax) + QString::fromUtf8 ("..."); display_text = display_text.left (nmax) + QString::fromUtf8 ("...");

View File

@ -65,7 +65,11 @@ split_path (const std::string &path, std::vector <std::string> &pc)
sep = QString::fromUtf8 (":"); sep = QString::fromUtf8 (":");
#endif #endif
#if QT_VERSION >= 0x60000
QStringList pp = tl::to_qstring (path).split (sep, Qt::SkipEmptyParts);
#else
QStringList pp = tl::to_qstring (path).split (sep, QString::SkipEmptyParts); QStringList pp = tl::to_qstring (path).split (sep, QString::SkipEmptyParts);
#endif
for (QStringList::ConstIterator p = pp.begin (); p != pp.end (); ++p) { for (QStringList::ConstIterator p = pp.begin (); p != pp.end (); ++p) {
pc.push_back (tl::to_string (*p)); pc.push_back (tl::to_string (*p));
} }