Resolved issue #774. New feature. Matching Parentheses.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-11-14 13:46:28 +02:00
parent c347d97e12
commit 5f0d4ea586
36 changed files with 712 additions and 135 deletions

View File

@ -31,6 +31,7 @@
- [#771] Improve tool Point at intersection of arc and line. - [#771] Improve tool Point at intersection of arc and line.
- [#772] New tool Duplicate detail. - [#772] New tool Duplicate detail.
- [#726] Improve Move tool. Add optional rotate option. - [#726] Improve Move tool. Add optional rotate option.
- [#774] New feature. Matching Parentheses.
# Version 0.5.1 # Version 0.5.1
- [#683] Tool Seam allowance's dialog is off screen on small resolutions. - [#683] Tool Seam allowance's dialog is off screen on small resolutions.

View File

@ -227,7 +227,7 @@
<item row="5" column="1"> <item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayoutValue"> <layout class="QHBoxLayout" name="horizontalLayoutValue">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -340,7 +340,7 @@
</widget> </widget>
</item> </item>
<item row="10" column="1"> <item row="10" column="1">
<widget class="QPlainTextEdit" name="plainTextEditDescription"> <widget class="VPlainTextEdit" name="plainTextEditDescription">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -803,7 +803,7 @@
</widget> </widget>
</item> </item>
<item row="9" column="1"> <item row="9" column="1">
<widget class="QPlainTextEdit" name="plainTextEditNotes"> <widget class="VPlainTextEdit" name="plainTextEditNotes">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -827,7 +827,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>835</width> <width>835</width>
<height>25</height> <height>22</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
@ -1184,6 +1184,13 @@
</action> </action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="share/resources/tapeicon.qrc"/> <include location="share/resources/tapeicon.qrc"/>
</resources> </resources>

View File

@ -247,7 +247,7 @@
<item row="5" column="1"> <item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayoutValue"> <layout class="QHBoxLayout" name="horizontalLayoutValue">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -354,7 +354,7 @@
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="QPlainTextEdit" name="plainTextEditDescription"> <widget class="VPlainTextEdit" name="plainTextEditDescription">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -432,9 +432,16 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
<include location="../../../libs/vmisc/share/resources/theme.qrc"/> <include location="../../../libs/vmisc/share/resources/theme.qrc"/>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>960</width> <width>960</width>
<height>497</height> <height>517</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -39,7 +39,7 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tabIncrements"> <widget class="QWidget" name="tabIncrements">
<attribute name="title"> <attribute name="title">
@ -175,12 +175,6 @@
<verstretch>4</verstretch> <verstretch>4</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>236</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Details</string> <string>Details</string>
</property> </property>
@ -331,7 +325,7 @@
<item row="5" column="1"> <item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayoutValue"> <layout class="QHBoxLayout" name="horizontalLayoutValue">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -360,12 +354,6 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="maximumSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="sizeIncrement"> <property name="sizeIncrement">
<size> <size>
<width>0</width> <width>0</width>
@ -432,7 +420,7 @@
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="QPlainTextEdit" name="plainTextEditDescription"> <widget class="VPlainTextEdit" name="plainTextEditDescription">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -442,6 +430,12 @@
<verstretch>1</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item row="10" column="1"> <item row="10" column="1">
@ -609,12 +603,6 @@
<verstretch>4</verstretch> <verstretch>4</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>236</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Details</string> <string>Details</string>
</property> </property>
@ -765,7 +753,7 @@
<item row="5" column="1"> <item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayoutValue_2"> <layout class="QHBoxLayout" name="horizontalLayoutValue_2">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaPC"> <widget class="VPlainTextEdit" name="plainTextEditFormulaPC">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -794,12 +782,6 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="maximumSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="sizeIncrement"> <property name="sizeIncrement">
<size> <size>
<width>0</width> <width>0</width>
@ -866,7 +848,7 @@
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="QPlainTextEdit" name="plainTextEditDescriptionPC"> <widget class="VPlainTextEdit" name="plainTextEditDescriptionPC">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -876,6 +858,12 @@
<verstretch>1</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item row="10" column="1"> <item row="10" column="1">
@ -1148,6 +1136,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>tableWidgetIncrement</tabstop> <tabstop>tableWidgetIncrement</tabstop>
<tabstop>toolButtonAdd</tabstop> <tabstop>toolButtonAdd</tabstop>
@ -1156,8 +1151,8 @@
<tabstop>tableWidgetSplines</tabstop> <tabstop>tableWidgetSplines</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
<include location="../../../libs/vmisc/share/resources/theme.qrc"/> <include location="../../../libs/vmisc/share/resources/theme.qrc"/>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>655</width> <width>655</width>
<height>532</height> <height>547</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -21,7 +21,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -107,7 +107,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditDescription"> <widget class="VPlainTextEdit" name="plainTextEditDescription">
<property name="documentTitle"> <property name="documentTitle">
<string/> <string/>
</property> </property>
@ -174,7 +174,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditTechNotes"/> <widget class="VPlainTextEdit" name="plainTextEditTechNotes"/>
</item> </item>
</layout> </layout>
</item> </item>
@ -1381,6 +1381,11 @@
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
<customwidget> <customwidget>
<class>VLineEdit</class> <class>VLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>

View File

@ -149,7 +149,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -428,6 +428,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop> <tabstop>toolButtonPutHere</tabstop>

View File

@ -149,7 +149,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -195,8 +195,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -345,6 +344,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -323,7 +323,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditF1"> <widget class="VPlainTextEdit" name="plainTextEditF1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -503,7 +503,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditF2"> <widget class="VPlainTextEdit" name="plainTextEditF2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -666,6 +666,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -140,7 +140,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="horizontalLayout_12">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditRadius"> <widget class="VPlainTextEdit" name="plainTextEditRadius">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -320,7 +320,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditF1"> <widget class="VPlainTextEdit" name="plainTextEditF1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -500,7 +500,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <layout class="QHBoxLayout" name="horizontalLayout_10">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditLength"> <widget class="VPlainTextEdit" name="plainTextEditLength">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -655,6 +655,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/> <include location="../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -334,6 +333,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -140,7 +140,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -325,6 +324,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLengthAngle</tabstop> <tabstop>pushButtonGrowLengthAngle</tabstop>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_formula"> <layout class="QHBoxLayout" name="horizontalLayout_formula">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -260,6 +259,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -260,6 +259,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -260,6 +259,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -150,7 +150,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditRadius1"> <widget class="VPlainTextEdit" name="plainTextEditRadius1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -336,7 +336,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditRadius2"> <widget class="VPlainTextEdit" name="plainTextEditRadius2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -522,7 +522,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditF1"> <widget class="VPlainTextEdit" name="plainTextEditF1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -708,7 +708,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditF2"> <widget class="VPlainTextEdit" name="plainTextEditF2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -894,7 +894,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditRotationAngle"> <widget class="VPlainTextEdit" name="plainTextEditRotationAngle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1038,6 +1038,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/> <include location="../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -164,7 +164,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -210,8 +210,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -360,7 +359,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <layout class="QHBoxLayout" name="horizontalLayout_10">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditAngle"> <widget class="VPlainTextEdit" name="plainTextEditAngle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -406,8 +405,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -531,6 +529,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -140,7 +140,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <layout class="QHBoxLayout" name="horizontalLayout_10">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -352,6 +351,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLengthAngle</tabstop> <tabstop>pushButtonGrowLengthAngle</tabstop>

View File

@ -140,7 +140,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditAngle"> <widget class="VPlainTextEdit" name="plainTextEditAngle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -320,7 +320,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditLength"> <widget class="VPlainTextEdit" name="plainTextEditLength">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -500,7 +500,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditRotationAngle"> <widget class="VPlainTextEdit" name="plainTextEditRotationAngle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -590,6 +590,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/> <include location="../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_formula"> <layout class="QHBoxLayout" name="horizontalLayout_formula">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -525,6 +524,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -140,7 +140,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditRadius"> <widget class="VPlainTextEdit" name="plainTextEditRadius">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -183,8 +183,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -309,6 +308,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/> <include location="../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_formula"> <layout class="QHBoxLayout" name="horizontalLayout_formula">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -343,6 +342,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -140,7 +140,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditCircle1Radius"> <widget class="VPlainTextEdit" name="plainTextEditCircle1Radius">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -320,7 +320,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditCircle2Radius"> <widget class="VPlainTextEdit" name="plainTextEditCircle2Radius">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -488,6 +488,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/> <include location="../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -140,7 +140,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -234,6 +234,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/> <include location="../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -143,7 +143,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_formula"> <layout class="QHBoxLayout" name="horizontalLayout_formula">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="VPlainTextEdit" name="plainTextEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -186,8 +186,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff/> <normaloff>.</normaloff>.</iconset>
</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -382,6 +381,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>

View File

@ -182,7 +182,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditLength1F"> <widget class="VPlainTextEdit" name="plainTextEditLength1F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -362,7 +362,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditAngle1F"> <widget class="VPlainTextEdit" name="plainTextEditAngle1F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -580,7 +580,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditLength2F"> <widget class="VPlainTextEdit" name="plainTextEditLength2F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -760,7 +760,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="horizontalLayout_12">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditAngle2F"> <widget class="VPlainTextEdit" name="plainTextEditAngle2F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -929,6 +929,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>comboBoxP1</tabstop> <tabstop>comboBoxP1</tabstop>
<tabstop>comboBoxP4</tabstop> <tabstop>comboBoxP4</tabstop>

View File

@ -169,7 +169,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditLength1F"> <widget class="VPlainTextEdit" name="plainTextEditLength1F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -349,7 +349,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditAngle1F"> <widget class="VPlainTextEdit" name="plainTextEditAngle1F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -542,7 +542,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditLength2F"> <widget class="VPlainTextEdit" name="plainTextEditLength2F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -722,7 +722,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="horizontalLayout_12">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditAngle2F"> <widget class="VPlainTextEdit" name="plainTextEditAngle2F">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -891,6 +891,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>buttonBox</tabstop> <tabstop>buttonBox</tabstop>
</tabstops> </tabstops>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>480</width> <width>480</width>
<height>490</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -260,7 +260,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidth"> <widget class="VPlainTextEdit" name="plainTextEditFormulaWidth">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -496,7 +496,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidthBefore"> <widget class="VPlainTextEdit" name="plainTextEditFormulaWidthBefore">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -695,7 +695,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_17"> <layout class="QHBoxLayout" name="horizontalLayout_17">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidthAfter"> <widget class="VPlainTextEdit" name="plainTextEditFormulaWidthAfter">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1016,6 +1016,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../../vmisc/share/resources/icon.qrc"/> <include location="../../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>
@ -1054,7 +1061,7 @@
</connection> </connection>
</connections> </connections>
<buttongroups> <buttongroups>
<buttongroup name="buttonGroupMarkType"/>
<buttongroup name="buttonGroupAngleType"/> <buttongroup name="buttonGroupAngleType"/>
<buttongroup name="buttonGroupMarkType"/>
</buttongroups> </buttongroups>
</ui> </ui>

View File

@ -88,7 +88,7 @@
<string notr="true">...</string> <string notr="true">...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../vmisc/share/resources/icon.qrc"> <iconset resource="../../../../vmisc/share/resources/icon.qrc">
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset> <normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -105,7 +105,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap> <pixmap resource="../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
@ -139,7 +139,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_formula"> <layout class="QHBoxLayout" name="horizontalLayout_formula">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidth"> <widget class="VPlainTextEdit" name="plainTextEditFormulaWidth">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -271,7 +271,7 @@
<string notr="true">...</string> <string notr="true">...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../vmisc/share/resources/icon.qrc"> <iconset resource="../../../../vmisc/share/resources/icon.qrc">
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset> <normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -288,7 +288,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap> <pixmap resource="../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
@ -322,7 +322,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_formula_2"> <layout class="QHBoxLayout" name="horizontalLayout_formula_2">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaHeight"> <widget class="VPlainTextEdit" name="plainTextEditFormulaHeight">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -454,7 +454,7 @@
<string notr="true">...</string> <string notr="true">...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../vmisc/share/resources/icon.qrc"> <iconset resource="../../../../vmisc/share/resources/icon.qrc">
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset> <normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -471,7 +471,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap> <pixmap resource="../../../../vmisc/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
@ -505,7 +505,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_formula_3"> <layout class="QHBoxLayout" name="horizontalLayout_formula_3">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaAngle"> <widget class="VPlainTextEdit" name="plainTextEditFormulaAngle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -615,8 +615,15 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/> <include location="../../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

View File

@ -173,7 +173,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="horizontalLayout_12">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditRotFormula"> <widget class="VPlainTextEdit" name="lineEditRotFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -362,7 +362,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_14"> <layout class="QHBoxLayout" name="horizontalLayout_14">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditLenFormula"> <widget class="VPlainTextEdit" name="lineEditLenFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -526,6 +526,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../../../vmisc/share/resources/icon.qrc"/> <include location="../../../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -400,7 +400,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_19"> <layout class="QHBoxLayout" name="horizontalLayout_19">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditDLWidthFormula"> <widget class="VPlainTextEdit" name="lineEditDLWidthFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -602,7 +602,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_21"> <layout class="QHBoxLayout" name="horizontalLayout_21">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditDLHeightFormula"> <widget class="VPlainTextEdit" name="lineEditDLHeightFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -888,7 +888,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_23"> <layout class="QHBoxLayout" name="horizontalLayout_23">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditDLAngleFormula"> <widget class="VPlainTextEdit" name="lineEditDLAngleFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1106,7 +1106,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_26"> <layout class="QHBoxLayout" name="horizontalLayout_26">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditPLWidthFormula"> <widget class="VPlainTextEdit" name="lineEditPLWidthFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1308,7 +1308,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_27"> <layout class="QHBoxLayout" name="horizontalLayout_27">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditPLHeightFormula"> <widget class="VPlainTextEdit" name="lineEditPLHeightFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1594,7 +1594,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_28"> <layout class="QHBoxLayout" name="horizontalLayout_28">
<item> <item>
<widget class="QPlainTextEdit" name="lineEditPLAngleFormula"> <widget class="VPlainTextEdit" name="lineEditPLAngleFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1683,6 +1683,11 @@
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
<customwidget> <customwidget>
<class>VLineEdit</class> <class>VLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>

View File

@ -283,7 +283,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidth"> <widget class="VPlainTextEdit" name="plainTextEditFormulaWidth">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -522,7 +522,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidthBefore"> <widget class="VPlainTextEdit" name="plainTextEditFormulaWidthBefore">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -712,7 +712,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_17"> <layout class="QHBoxLayout" name="horizontalLayout_17">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormulaWidthAfter"> <widget class="VPlainTextEdit" name="plainTextEditFormulaWidthAfter">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -929,6 +929,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header location="global">vplaintextedit.h</header>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../../../../../vmisc/share/resources/icon.qrc"/> <include location="../../../../../vmisc/share/resources/icon.qrc"/>
</resources> </resources>

View File

@ -0,0 +1,90 @@
/************************************************************************
**
** @file vhighlighter.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 14 11, 2017
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2017 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vhighlighter.h"
//---------------------------------------------------------------------------------------------------------------------
VTextBlockData::VTextBlockData()
: m_parentheses()
{
// Nothing to do
}
//---------------------------------------------------------------------------------------------------------------------
QVector<ParenthesisInfo *> VTextBlockData::Parentheses()
{
return m_parentheses;
}
//---------------------------------------------------------------------------------------------------------------------
void VTextBlockData::insert(ParenthesisInfo *info)
{
int i = 0;
while (i < m_parentheses.size() && info->position > m_parentheses.at(i)->position)
{
++i;
}
m_parentheses.insert(i, info);
}
//---------------------------------------------------------------------------------------------------------------------
VHighlighter::VHighlighter(QTextDocument *document)
: QSyntaxHighlighter(document)
{
}
//---------------------------------------------------------------------------------------------------------------------
void VHighlighter::highlightBlock(const QString &text)
{
QScopedPointer<VTextBlockData> data(new VTextBlockData);
int leftPos = text.indexOf('(');
while (leftPos != -1)
{
QScopedPointer<ParenthesisInfo> info(new ParenthesisInfo);
info->character = '(';
info->position = leftPos;
data->insert(info.take());
leftPos = text.indexOf('(', leftPos + 1);
}
int rightPos = text.indexOf(')');
while (rightPos != -1)
{
QScopedPointer<ParenthesisInfo> info(new ParenthesisInfo);
info->character = ')';
info->position = rightPos;
data->insert(info.take());
rightPos = text.indexOf(')', rightPos +1);
}
setCurrentBlockUserData(data.take());
}

View File

@ -0,0 +1,64 @@
/************************************************************************
**
** @file vhighlighter.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 14 11, 2017
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2017 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VHIGHLIGHTER_H
#define VHIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include <QVector>
class QString;
class QTextDocument;
struct ParenthesisInfo
{
char character;
int position;
};
class VTextBlockData : public QTextBlockUserData
{
public:
VTextBlockData();
QVector<ParenthesisInfo *> Parentheses();
void insert(ParenthesisInfo *info);
private:
QVector<ParenthesisInfo *> m_parentheses;
};
class VHighlighter : public QSyntaxHighlighter
{
public:
VHighlighter(QTextDocument *document);
protected:
virtual void highlightBlock(const QString &text);
};
#endif // VHIGHLIGHTER_H

View File

@ -0,0 +1,184 @@
/************************************************************************
**
** @file vplaintextedit.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 14 11, 2017
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2017 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vplaintextedit.h"
//---------------------------------------------------------------------------------------------------------------------
VPlainTextEdit::VPlainTextEdit(QWidget * parent)
: QPlainTextEdit(parent),
m_highlighter(document())
{
connect(this, &QPlainTextEdit::cursorPositionChanged, this, &VPlainTextEdit::MatchParentheses);
}
//---------------------------------------------------------------------------------------------------------------------
VPlainTextEdit::VPlainTextEdit(const QString & text, QWidget * parent)
: QPlainTextEdit(text, parent),
m_highlighter(document())
{
connect(this, &QPlainTextEdit::cursorPositionChanged, this, &VPlainTextEdit::MatchParentheses);
}
//---------------------------------------------------------------------------------------------------------------------
VPlainTextEdit::~VPlainTextEdit()
{
document()->blockSignals(true); // prevent crash
}
//---------------------------------------------------------------------------------------------------------------------
void VPlainTextEdit::MatchParentheses()
{
QList<QTextEdit::ExtraSelection> selections;
setExtraSelections(selections);
VTextBlockData *data = static_cast<VTextBlockData *>(textCursor().block().userData());
if (data)
{
QVector<ParenthesisInfo *> infos = data->Parentheses();
int pos = textCursor().block().position();
for (int i = 0; i < infos.size(); ++i)
{
ParenthesisInfo *info = infos.at(i);
int curPos = textCursor().position() - textCursor().block().position();
if ((info->position == curPos - 1 || info->position == curPos) && info->character == '(')
{
CreateParenthesisSelection(pos + info->position, MatchLeftParenthesis(textCursor().block(), i + 1, 0));
return;
}
else if ((info->position == curPos - 1 || info->position == curPos) && info->character == ')')
{
CreateParenthesisSelection(pos + info->position, MatchRightParenthesis(textCursor().block(), i - 1, 0));
return;
}
}
}
}
//---------------------------------------------------------------------------------------------------------------------
bool VPlainTextEdit::MatchLeftParenthesis(QTextBlock currentBlock, int i, int numLeftParentheses)
{
VTextBlockData *data = static_cast<VTextBlockData *>(currentBlock.userData());
QVector<ParenthesisInfo *> infos = data->Parentheses();
int docPos = currentBlock.position();
for (; i < infos.size(); ++i)
{
ParenthesisInfo *info = infos.at(i);
if (info->character == '(')
{
++numLeftParentheses;
continue;
}
if (info->character == ')' && numLeftParentheses == 0)
{
CreateParenthesisSelection(docPos + info->position);
return true;
}
else
{
--numLeftParentheses;
}
}
currentBlock = currentBlock.next();
if (currentBlock.isValid())
{
return MatchLeftParenthesis(currentBlock, 0, numLeftParentheses);
}
return false;
}
//---------------------------------------------------------------------------------------------------------------------
bool VPlainTextEdit::MatchRightParenthesis(QTextBlock currentBlock, int i, int numRightParentheses)
{
VTextBlockData *data = static_cast<VTextBlockData *>(currentBlock.userData());
QVector<ParenthesisInfo *> parentheses = data->Parentheses();
int docPos = currentBlock.position();
for (; i > -1 && parentheses.size() > 0; --i)
{
ParenthesisInfo *info = parentheses.at(i);
if (info->character == ')')
{
++numRightParentheses;
continue;
}
if (info->character == '(' && numRightParentheses == 0)
{
CreateParenthesisSelection(docPos + info->position);
return true;
}
else
{
--numRightParentheses;
}
}
currentBlock = currentBlock.previous();
if (currentBlock.isValid())
{
return MatchRightParenthesis(currentBlock, 0, numRightParentheses);
}
return false;
}
//---------------------------------------------------------------------------------------------------------------------
void VPlainTextEdit::CreateParenthesisSelection(int pos, bool match)
{
QList<QTextEdit::ExtraSelection> selections = extraSelections();
QTextEdit::ExtraSelection selection;
QTextCharFormat format = selection.format;
if (match)
{
format.setBackground(Qt::lightGray);
format.setForeground(Qt::yellow);
}
else
{
format.setForeground(Qt::red);
}
selection.format = format;
QTextCursor cursor = textCursor();
cursor.setPosition(pos);
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
selection.cursor = cursor;
selections.append(selection);
setExtraSelections(selections);
}

View File

@ -0,0 +1,53 @@
/************************************************************************
**
** @file vplaintextedit.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 14 11, 2017
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2017 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VPLAINTEXTEDIT_H
#define VPLAINTEXTEDIT_H
#include <QPlainTextEdit>
#include "vhighlighter.h"
class VPlainTextEdit : public QPlainTextEdit
{
Q_OBJECT
public:
VPlainTextEdit(QWidget * parent = nullptr);
VPlainTextEdit(const QString & text, QWidget * parent = nullptr);
virtual ~VPlainTextEdit();
private slots:
void MatchParentheses();
private:
VHighlighter m_highlighter;
bool MatchLeftParenthesis(QTextBlock currentBlock, int i, int numLeftParentheses);
bool MatchRightParenthesis(QTextBlock currentBlock, int i, int numRightParentheses);
void CreateParenthesisSelection(int pos, bool match = true);
};
#endif // VPLAINTEXTEDIT_H

View File

@ -22,7 +22,9 @@ SOURCES += \
$$PWD/global.cpp \ $$PWD/global.cpp \
$$PWD/vscenepoint.cpp \ $$PWD/vscenepoint.cpp \
$$PWD/scalesceneitems.cpp \ $$PWD/scalesceneitems.cpp \
$$PWD/vlineedit.cpp $$PWD/vlineedit.cpp \
$$PWD/vplaintextedit.cpp \
$$PWD/vhighlighter.cpp
*msvc*:SOURCES += $$PWD/stable.cpp *msvc*:SOURCES += $$PWD/stable.cpp
@ -48,4 +50,6 @@ HEADERS += \
$$PWD/global.h \ $$PWD/global.h \
$$PWD/vscenepoint.h \ $$PWD/vscenepoint.h \
$$PWD/scalesceneitems.h \ $$PWD/scalesceneitems.h \
$$PWD/vlineedit.h $$PWD/vlineedit.h \
$$PWD/vplaintextedit.h \
$$PWD/vhighlighter.h