Files
regexgui/Qt_ui/generator.ui
Sven Riwoldt 13d5229c3b Init
2025-02-09 10:32:49 +01:00

251 lines
9.6 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CodeGenerator</class>
<widget class="QMainWindow" name="CodeGenerator">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>333</height>
</rect>
</property>
<property name="windowTitle">
<string>PyRex Code Generaotr</string>
</property>
<property name="windowIcon">
<iconset resource="src.qrc">
<normaloff>:/icons/icons/icon.ico</normaloff>:/icons/icons/icon.ico</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<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>
<widget class="QTextEdit" name="textEdit">
<property name="styleSheet">
<string notr="true">border-bottom: 2px;
border-style: solid;
border-bottom-color: rgb(255, 85, 0);</string>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;import re&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;regex = r&amp;quot;&amp;lt;CHANGE_ME&amp;gt;pattern&amp;lt;CHANGE_ME&amp;gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;test_str = &amp;quot;&amp;lt;CHANGE_ME&amp;gt;string&amp;lt;CHANGE_ME&amp;gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;matches = re.finditer(regex, test_str, re.MULTILINE)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;for matchNum, match in enumerate(matches, start=1):&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; print (&amp;quot;Match {matchNum} was found at {start}-{end}: {match}&amp;quot;.format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; for groupNum in range(0, len(match.groups())):&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; groupNum = groupNum + 1&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; print (&amp;quot;Group {groupNum} found at {start}-{end}: {group}&amp;quot;.format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QPushButton" name="CopyPushButton">
<property name="styleSheet">
<string notr="true">QPushButton#CopyPushButton {
min-width:60px;
max-width:60px;
min-height:35;
max-height:35;
color: #495057;
background: rgba(255,255,255,100%);
border-bottom: 2px;
border-style: solid;
border-bottom-color: rgba(0,0,0,.3);
border-top-left-radius: 0px;
border-top-right-radius: 3px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
}
QPushButton#CopyPushButton:hover {
background: rgba(255,255,255,50%);
border-bottom-color:rgb(255, 85, 0);
}
QPushButton#CopyPushButton:pressed {
background: rgba(255,255,255,100%);
border-bottom-color:rgb(255, 85, 0);
}
QPushButton#CopyPushButton:disabled {
background: rgba(0,0,0,.04);
border-bottom-color: rgba(0,0,0,.15);
}</string>
</property>
<property name="text">
<string>Copy</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QPushButton" name="ClosePushButton">
<property name="styleSheet">
<string notr="true">QPushButton#ClosePushButton {
min-width:60px;
max-width:60px;
min-height:35;
max-height:35;
color: #495057;
background: rgba(255,255,255,100%);
border-bottom: 2px;
border-style: solid;
border-bottom-color: rgba(0,0,0,.3);
border-top-left-radius: 0px;
border-top-right-radius: 3px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
}
QPushButton#ClosePushButton:hover {
background: rgba(255,255,255,50%);
border-bottom-color:rgb(255, 85, 0);
}
QPushButton#ClosePushButton:pressed {
background: rgba(255,255,255,100%);
border-bottom-color:rgb(255, 85, 0);
}
QPushButton#ClosePushButton:disabled {
background: rgba(0,0,0,.04);
border-bottom-color: rgba(0,0,0,.15);
}</string>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources>
<include location="src.qrc"/>
</resources>
<connections>
<connection>
<sender>ClosePushButton</sender>
<signal>clicked()</signal>
<receiver>CodeGenerator</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>432</x>
<y>560</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
<connection>
<sender>CopyPushButton</sender>
<signal>clicked()</signal>
<receiver>textEdit</receiver>
<slot>selectAll()</slot>
<hints>
<hint type="sourcelabel">
<x>366</x>
<y>560</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>280</y>
</hint>
</hints>
</connection>
<connection>
<sender>CopyPushButton</sender>
<signal>clicked()</signal>
<receiver>textEdit</receiver>
<slot>copy()</slot>
<hints>
<hint type="sourcelabel">
<x>366</x>
<y>560</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>280</y>
</hint>
</hints>
</connection>
</connections>
</ui>