eric6/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardCharactersDialog.py

Wed, 30 Dec 2020 11:00:05 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:05 +0100
changeset 7923
91e843545d9a
parent 7775
4a1db75550bd
child 8143
2c730d5fd177
permissions
-rw-r--r--

Updated copyright for 2021.

2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7775
diff changeset
3 # Copyright (c) 2013 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog for entering character classes.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
10 from PyQt5.QtCore import QRegularExpression
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
11 from PyQt5.QtGui import QRegularExpressionValidator
7258
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
12 from PyQt5.QtWidgets import (
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
13 QWidget, QDialog, QVBoxLayout, QHBoxLayout, QScrollArea, QPushButton,
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
14 QSpacerItem, QSizePolicy, QComboBox, QLineEdit, QLabel
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
15 )
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
7258
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
17 from .Ui_QRegularExpressionWizardCharactersDialog import (
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Ui_QRegularExpressionWizardCharactersDialog
7258
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
19 )
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 class QRegularExpressionWizardCharactersDialog(
3037
a417a0670a36 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
23 QDialog, Ui_QRegularExpressionWizardCharactersDialog):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 Class implementing a dialog for entering character classes.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 def __init__(self, parent=None):
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 Constructor
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 @param parent reference to the parent widget (QWidget)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
2791
a9577f248f04 Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2770
diff changeset
33 super(QRegularExpressionWizardCharactersDialog, self).__init__(parent)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.setupUi(self)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.__initCharacterSelectors()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.comboItems = []
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 self.singleComboItems = [] # these are in addition to the above
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
40 self.comboItems.append((self.tr("Normal character"), "-c"))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
41 self.comboItems.append((self.tr(
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 "Unicode character in hexadecimal notation"), "-h"))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
43 self.comboItems.append((self.tr(
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 "ASCII/Latin1 character in octal notation"), "-o"))
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 self.singleComboItems.extend([
2770
fd5ee85f0450 Fixed a few PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
46 ("---", "-i"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
47 (self.tr("Bell character (\\a)"), "\\a"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
48 (self.tr("Escape character (\\e)"), "\\e"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
49 (self.tr("Page break (\\f)"), "\\f"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
50 (self.tr("Line feed (\\n)"), "\\n"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
51 (self.tr("Carriage return (\\r)"), "\\r"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
52 (self.tr("Horizontal tabulator (\\t)"), "\\t"),
2770
fd5ee85f0450 Fixed a few PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
53 ("---", "-i"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
54 (self.tr("Character Category"), "-ccp"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
55 (self.tr("Special Character Category"), "-csp"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
56 (self.tr("Character Block"), "-cbp"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
57 (self.tr("POSIX Named Set"), "-psp"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
58 (self.tr("Not Character Category"), "-ccn"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
59 (self.tr("Not Character Block"), "-cbn"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
60 (self.tr("Not Special Character Category"), "-csn"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
61 (self.tr("Not POSIX Named Set"), "-psn"),
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 ])
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
64 self.charValidator = QRegularExpressionValidator(
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
65 QRegularExpression(".{0,1}"), self)
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
66 self.hexValidator = QRegularExpressionValidator(
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
67 QRegularExpression("[0-9a-fA-F]{0,4}"), self)
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
68 self.octValidator = QRegularExpressionValidator(
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
69 QRegularExpression("[0-3]?[0-7]{0,2}"), self)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 # generate dialog part for single characters
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.singlesBoxLayout = QVBoxLayout(self.singlesBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.singlesBoxLayout.setObjectName("singlesBoxLayout")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 self.singlesBoxLayout.setSpacing(6)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
75 self.singlesBoxLayout.setContentsMargins(6, 6, 6, 6)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 self.singlesBox.setLayout(self.singlesBoxLayout)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.singlesView = QScrollArea(self.singlesBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.singlesView.setObjectName("singlesView")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.singlesBoxLayout.addWidget(self.singlesView)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 self.singlesItemsBox = QWidget(self)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 self.singlesView.setWidget(self.singlesItemsBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.singlesItemsBox.setObjectName("singlesItemsBox")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.singlesItemsBox.setMinimumWidth(1000)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 self.singlesItemsBoxLayout = QVBoxLayout(self.singlesItemsBox)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
86 self.singlesItemsBoxLayout.setContentsMargins(6, 6, 6, 6)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.singlesItemsBoxLayout.setSpacing(6)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self.singlesItemsBox.setLayout(self.singlesItemsBoxLayout)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 self.singlesEntries = []
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.__addSinglesLine()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 hlayout0 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
93 hlayout0.setContentsMargins(0, 0, 0, 0)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 hlayout0.setSpacing(6)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 hlayout0.setObjectName("hlayout0")
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3005
diff changeset
96 self.moreSinglesButton = QPushButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
97 self.tr("Additional Entries"), self.singlesBox)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.moreSinglesButton.setObjectName("moreSinglesButton")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 hlayout0.addWidget(self.moreSinglesButton)
3005
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
100 hspacer0 = QSpacerItem(
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
101 30, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 hlayout0.addItem(hspacer0)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self.singlesBoxLayout.addLayout(hlayout0)
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
104 self.moreSinglesButton.clicked.connect(self.__addSinglesLine)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 # generate dialog part for character ranges
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.rangesBoxLayout = QVBoxLayout(self.rangesBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 self.rangesBoxLayout.setObjectName("rangesBoxLayout")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.rangesBoxLayout.setSpacing(6)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
110 self.rangesBoxLayout.setContentsMargins(6, 6, 6, 6)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 self.rangesBox.setLayout(self.rangesBoxLayout)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 self.rangesView = QScrollArea(self.rangesBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 self.rangesView.setObjectName("rangesView")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 self.rangesBoxLayout.addWidget(self.rangesView)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 self.rangesItemsBox = QWidget(self)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 self.rangesView.setWidget(self.rangesItemsBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 self.rangesItemsBox.setObjectName("rangesItemsBox")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 self.rangesItemsBox.setMinimumWidth(1000)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 self.rangesItemsBoxLayout = QVBoxLayout(self.rangesItemsBox)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
121 self.rangesItemsBoxLayout.setContentsMargins(6, 6, 6, 6)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.rangesItemsBoxLayout.setSpacing(6)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.rangesItemsBox.setLayout(self.rangesItemsBoxLayout)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.rangesEntries = []
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.__addRangesLine()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 hlayout1 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
128 hlayout1.setContentsMargins(0, 0, 0, 0)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 hlayout1.setSpacing(6)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 hlayout1.setObjectName("hlayout1")
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3005
diff changeset
131 self.moreRangesButton = QPushButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
132 self.tr("Additional Entries"), self.rangesBox)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 self.moreSinglesButton.setObjectName("moreRangesButton")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 hlayout1.addWidget(self.moreRangesButton)
3005
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
135 hspacer1 = QSpacerItem(
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
136 30, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 hlayout1.addItem(hspacer1)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 self.rangesBoxLayout.addLayout(hlayout1)
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
139 self.moreRangesButton.clicked.connect(self.__addRangesLine)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 def __initCharacterSelectors(self):
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 Private method to initialize the W3C character selector entries.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 self.__characterCategories = (
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 # display name code
3539
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
147 (self.tr("Letter, Any"), "L"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
148 (self.tr("Letter, Lower case"), "Ll"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
149 (self.tr("Letter, Modifier"), "Lm"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
150 (self.tr("Letter, Other"), "Lo"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
151 (self.tr("Letter, Title case"), "Lt"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
152 (self.tr("Letter, Upper case"), "Lu"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
153 (self.tr("Letter, Lower, Upper or Title"), "L&"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
154 (self.tr("Mark, Any"), "M"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
155 (self.tr("Mark, Spacing"), "Mc"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
156 (self.tr("Mark, Enclosing"), "Me"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
157 (self.tr("Mark, Non-spacing"), "Mn"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
158 (self.tr("Number, Any"), "N"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
159 (self.tr("Number, Decimal"), "Nd"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
160 (self.tr("Number, Letter"), "Nl"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
161 (self.tr("Number, Other"), "No"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
162 (self.tr("Punctuation, Any"), "P"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
163 (self.tr("Punctuation, Connector"), "Pc"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
164 (self.tr("Punctuation, Dash"), "Pd"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
165 (self.tr("Punctuation, Close"), "Pe"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
166 (self.tr("Punctuation, Final"), "Pf"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
167 (self.tr("Punctuation, Initial"), "Pi"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
168 (self.tr("Punctuation, Other"), "Po"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
169 (self.tr("Punctuation, Open"), "Ps"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
170 (self.tr("Symbol, Any"), "S"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
171 (self.tr("Symbol, Currency"), "Sc"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
172 (self.tr("Symbol, Modifier"), "Sk"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
173 (self.tr("Symbol, Mathematical"), "Sm"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
174 (self.tr("Symbol, Other"), "So"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
175 (self.tr("Separator, Any"), "Z"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
176 (self.tr("Separator, Line"), "Zl"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
177 (self.tr("Separator, Paragraph"), "Zp"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
178 (self.tr("Separator, Space"), "Zs"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
179 (self.tr("Other, Any"), "C"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
180 (self.tr("Other, Control"), "Cc"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
181 (self.tr("Other, Format"), "Cf"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
182 (self.tr("Other, Unassigned"), "Cn"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
183 (self.tr("Other, Private Use"), "Co"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
184 (self.tr("Other, Surrogat"), "Cn"),
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 )
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 self.__specialCharacterCategories = (
3005
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
188 # display name code
3539
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
189 (self.tr("Alphanumeric"), "Xan"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
190 (self.tr("POSIX Space"), "Xps"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
191 (self.tr("Perl Space"), "Xsp"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
192 (self.tr("Universal Character"), "Xuc"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
193 (self.tr("Perl Word"), "Xan"),
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 )
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 self.__characterBlocks = (
3005
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
197 # display name code
3539
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
198 (self.tr("Arabic"), "Arabic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
199 (self.tr("Armenian"), "Armenian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
200 (self.tr("Avestan"), "Avestan"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
201 (self.tr("Balinese"), "Balinese"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
202 (self.tr("Bamum"), "Bamum"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
203 (self.tr("Batak"), "Batak"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
204 (self.tr("Bengali"), "Bengali"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
205 (self.tr("Bopomofo"), "Bopomofo"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
206 (self.tr("Brahmi"), "Brahmi"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
207 (self.tr("Braille"), "Braille"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
208 (self.tr("Buginese"), "Buginese"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
209 (self.tr("Buhid"), "Buhid"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
210 (self.tr("Canadian Aboriginal"), "Canadian_Aboriginal"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
211 (self.tr("Carian"), "Carian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
212 (self.tr("Chakma"), "Chakma"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
213 (self.tr("Cham"), "Cham"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
214 (self.tr("Cherokee"), "Cherokee"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
215 (self.tr("Common"), "Common"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
216 (self.tr("Coptic"), "Coptic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
217 (self.tr("Cuneiform"), "Cuneiform"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
218 (self.tr("Cypriot"), "Cypriot"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
219 (self.tr("Cyrillic"), "Cyrillic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
220 (self.tr("Deseret"), "Deseret,"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
221 (self.tr("Devanagari"), "Devanagari"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
222 (self.tr("Egyptian Hieroglyphs"), "Egyptian_Hieroglyphs"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
223 (self.tr("Ethiopic"), "Ethiopic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
224 (self.tr("Georgian"), "Georgian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
225 (self.tr("Glagolitic"), "Glagolitic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
226 (self.tr("Gothic"), "Gothic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
227 (self.tr("Greek"), "Greek"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
228 (self.tr("Gujarati"), "Gujarati"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
229 (self.tr("Gurmukhi"), "Gurmukhi"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
230 (self.tr("Han"), "Han"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
231 (self.tr("Hangul"), "Hangul"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
232 (self.tr("Hanunoo"), "Hanunoo"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
233 (self.tr("Hebrew"), "Hebrew"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
234 (self.tr("Hiragana"), "Hiragana"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
235 (self.tr("Imperial Aramaic"), "Imperial_Aramaic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
236 (self.tr("Inherited"), "Inherited"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
237 (self.tr("Inscriptional Pahlavi"), "Inscriptional_Pahlavi"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
238 (self.tr("Inscriptional Parthian"), "Inscriptional_Parthian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
239 (self.tr("Javanese"), "Javanese"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
240 (self.tr("Kaithi"), "Kaithi"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
241 (self.tr("Kannada"), "Kannada"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
242 (self.tr("Katakana"), "Katakana"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
243 (self.tr("Kayah Li"), "Kayah_Li"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
244 (self.tr("Kharoshthi"), "Kharoshthi"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
245 (self.tr("Khmer"), "Khmer"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
246 (self.tr("Lao"), "Lao"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
247 (self.tr("Latin"), "Latin"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
248 (self.tr("Lepcha"), "Lepcha"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
249 (self.tr("Limbu"), "Limbu"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
250 (self.tr("Linear B"), "Linear_B"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
251 (self.tr("Lisu"), "Lisu"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
252 (self.tr("Lycian"), "Lycian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
253 (self.tr("Lydian"), "Lydian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
254 (self.tr("Malayalam"), "Malayalam"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
255 (self.tr("Mandaic"), "Mandaic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
256 (self.tr("Meetei Mayek"), "Meetei_Mayek"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
257 (self.tr("Meroitic Cursive"), "Meroitic_Cursive"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
258 (self.tr("Meroitic Hieroglyphs"), "Meroitic_Hieroglyphs"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
259 (self.tr("Miao"), "Miao"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
260 (self.tr("Mongolian"), "Mongolian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
261 (self.tr("Myanmar"), "Myanmar"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
262 (self.tr("New Tai Lue"), "New_Tai_Lue"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
263 (self.tr("N'Ko"), "Nko"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
264 (self.tr("Ogham"), "Ogham"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
265 (self.tr("Old Italic"), "Old_Italic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
266 (self.tr("Old Persian"), "Old_Persian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
267 (self.tr("Old South Arabian"), "Old_South_Arabian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
268 (self.tr("Old Turkic"), "Old_Turkic,"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
269 (self.tr("Ol Chiki"), "Ol_Chiki"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
270 (self.tr("Oriya"), "Oriya"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
271 (self.tr("Osmanya"), "Osmanya"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
272 (self.tr("Phags-pa"), "Phags_Pa"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
273 (self.tr("Phoenician"), "Phoenician"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
274 (self.tr("Rejang"), "Rejang"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
275 (self.tr("Runic"), "Runic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
276 (self.tr("Samaritan"), "Samaritan"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
277 (self.tr("Saurashtra"), "Saurashtra"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
278 (self.tr("Sharada"), "Sharada"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
279 (self.tr("Shavian"), "Shavian"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
280 (self.tr("Sinhala"), "Sinhala"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
281 (self.tr("Sora Sompeng"), "Sora_Sompeng"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
282 (self.tr("Sundanese"), "Sundanese"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
283 (self.tr("Syloti Nagri"), "Syloti_Nagri"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
284 (self.tr("Syriac"), "Syriac"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
285 (self.tr("Tagalog"), "Tagalog"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
286 (self.tr("Tagbanwa"), "Tagbanwa"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
287 (self.tr("Tai Le"), "Tai_Le"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
288 (self.tr("Tai Tham"), "Tai_Tham"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
289 (self.tr("Tai Viet"), "Tai_Viet"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
290 (self.tr("Takri"), "Takri"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
291 (self.tr("Tamil"), "Tamil"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
292 (self.tr("Telugu"), "Telugu"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
293 (self.tr("Thaana"), "Thaana"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
294 (self.tr("Thai"), "Thai"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
295 (self.tr("Tibetan"), "Tibetan"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
296 (self.tr("Tifinagh"), "Tifinagh"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
297 (self.tr("Ugaritic"), "Ugaritic"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
298 (self.tr("Vai"), "Vai"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
299 (self.tr("Yi"), "Yi"),
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 )
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 self.__posixNamedSets = (
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 # display name code
3539
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
304 (self.tr("Alphanumeric"), "alnum"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
305 (self.tr("Alphabetic"), "alpha"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
306 (self.tr("ASCII"), "ascii"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
307 (self.tr("Word Letter"), "word"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
308 (self.tr("Lower Case Letter"), "lower"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
309 (self.tr("Upper Case Letter"), "upper"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
310 (self.tr("Decimal Digit"), "digit"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
311 (self.tr("Hexadecimal Digit"), "xdigit"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
312 (self.tr("Space or Tab"), "blank"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
313 (self.tr("White Space"), "space"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
314 (self.tr("Printing (excl. space)"), "graph"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
315 (self.tr("Printing (incl. space)"), "print"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
316 (self.tr("Printing (excl. alphanumeric)"), "punct"),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
317 (self.tr("Control Character"), "cntrl"),
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 )
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 def __populateCharTypeCombo(self, combo, isSingle):
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 Private method to populate a given character type selection combo box.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 @param combo reference to the combo box to be populated (QComboBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 @param isSingle flag indicating a singles combo (boolean)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 for txt, value in self.comboItems:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 combo.addItem(txt, value)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 if isSingle:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 for txt, value in self.singleComboItems:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 combo.addItem(txt, value)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 def __addSinglesLine(self):
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 Private slot to add a line of entry widgets for single characters.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 hbox = QWidget(self.singlesItemsBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 hboxLayout = QHBoxLayout(hbox)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
339 hboxLayout.setContentsMargins(0, 0, 0, 0)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 hboxLayout.setSpacing(6)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 hbox.setLayout(hboxLayout)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 cb1 = QComboBox(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 cb1.setEditable(False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 self.__populateCharTypeCombo(cb1, True)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 hboxLayout.addWidget(cb1)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 le1 = QLineEdit(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 le1.setValidator(self.charValidator)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 hboxLayout.addWidget(le1)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 cb1a = QComboBox(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 cb1a.setEditable(False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 cb1a.setSizeAdjustPolicy(QComboBox.AdjustToContents)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 hboxLayout.addWidget(cb1a)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 cb1a.hide()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 cb2 = QComboBox(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 cb2.setEditable(False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 self.__populateCharTypeCombo(cb2, True)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 hboxLayout.addWidget(cb2)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 le2 = QLineEdit(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 le2.setValidator(self.charValidator)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 hboxLayout.addWidget(le2)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 cb2a = QComboBox(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 cb2a.setEditable(False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 cb2a.setSizeAdjustPolicy(QComboBox.AdjustToContents)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 hboxLayout.addWidget(cb2a)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 cb2a.hide()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 self.singlesItemsBoxLayout.addWidget(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367
6116
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
368 cb1.activated[int].connect(
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
369 lambda i: self.__singlesCharTypeSelected(i, cb1))
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
370 cb2.activated[int].connect(
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
371 lambda i: self.__singlesCharTypeSelected(i, cb2))
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 hbox.show()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 self.singlesItemsBox.adjustSize()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 self.singlesEntries.append([cb1, le1, cb1a])
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 self.singlesEntries.append([cb2, le2, cb2a])
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 def __addRangesLine(self):
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 Private slot to add a line of entry widgets for character ranges.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 hbox = QWidget(self.rangesItemsBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 hboxLayout = QHBoxLayout(hbox)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2770
diff changeset
385 hboxLayout.setContentsMargins(0, 0, 0, 0)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 hboxLayout.setSpacing(6)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 hbox.setLayout(hboxLayout)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 cb1 = QComboBox(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 cb1.setEditable(False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 self.__populateCharTypeCombo(cb1, False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 hboxLayout.addWidget(cb1)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
392 l1 = QLabel(self.tr("Between:"), hbox)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 hboxLayout.addWidget(l1)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 le1 = QLineEdit(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 le1.setValidator(self.charValidator)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 hboxLayout.addWidget(le1)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
397 l2 = QLabel(self.tr("And:"), hbox)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 hboxLayout.addWidget(l2)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 le2 = QLineEdit(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 le2.setValidator(self.charValidator)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 hboxLayout.addWidget(le2)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 self.rangesItemsBoxLayout.addWidget(hbox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403
6116
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
404 cb1.activated[int].connect(
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
405 lambda i: self.__rangesCharTypeSelected(i, cb1))
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
406
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 hbox.show()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
408
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 self.rangesItemsBox.adjustSize()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 self.rangesEntries.append([cb1, le1, le2])
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
413 def __populateCharacterCombo(self, combo, formatIdentifier):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 Private method to populate a character selection combo.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 @param combo combo box to be populated (QComboBox)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
418 @param formatIdentifier format identifier (one of "-ccp", "-ccn",
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 "-cbp", "-cbn", "-csp", "-csn", "-psp", "-psn")
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 combo.clear()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
423 if formatIdentifier in ["-ccp", "-ccn"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 items = self.__characterCategories
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
425 elif formatIdentifier in ["-csp", "-csn"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 items = self.__specialCharacterCategories
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
427 elif formatIdentifier in ["-cbp", "-cbn"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 items = self.__characterBlocks
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
429 elif formatIdentifier in ["-psp", "-psn"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 items = self.__posixNamedSets
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 comboLen = 0
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 for txt, code in items:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 combo.addItem(txt, code)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 comboLen = max(comboLen, len(txt))
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 combo.setMinimumContentsLength(comboLen)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
438 def __performSelectedAction(self, formatIdentifier, lineedit, combo):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 Private method performing some actions depending on the input.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
442 @param formatIdentifier format of the selected entry (string)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 @param lineedit line edit widget to act on (QLineEdit)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 @param combo combo box widget to act on (QComboBox)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 """
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
446 if formatIdentifier == "-i":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 return
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
449 if formatIdentifier in ["-c", "-h", "-o"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 lineedit.show()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 lineedit.setEnabled(True)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 if combo is not None:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 combo.hide()
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
454 if formatIdentifier == "-c":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 lineedit.setValidator(self.charValidator)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
456 elif formatIdentifier == "-h":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 lineedit.setValidator(self.hexValidator)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
458 elif formatIdentifier == "-o":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 lineedit.setValidator(self.octValidator)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
460 elif formatIdentifier in ["-ccp", "-ccn", "-cbp", "-cbn", "-csp",
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
461 "-csn", "-psp", "-psn"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 lineedit.setEnabled(False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 lineedit.hide()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 if combo is not None:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 combo.show()
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
466 self.__populateCharacterCombo(combo, formatIdentifier)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 else:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 lineedit.setEnabled(False)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 lineedit.hide()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 if combo is not None:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 combo.hide()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 lineedit.clear()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473
6116
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
474 def __singlesCharTypeSelected(self, index, combo):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
475 """
3005
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
476 Private slot to handle the activated(int) signal of the single chars
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
477 combo boxes.
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478
6116
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
479 @param index selected list index
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
480 @type int
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
481 @param combo reference to the combo box
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
482 @type QComboBox
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 for entriesList in self.singlesEntries:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485 if combo == entriesList[0]:
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
486 formatIdentifier = combo.itemData(index)
3005
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
487 self.__performSelectedAction(
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
488 formatIdentifier, entriesList[1], entriesList[2])
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489 break
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490
6116
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
491 def __rangesCharTypeSelected(self, index, combo):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 """
3005
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
493 Private slot to handle the activated(int) signal of the char ranges
3953ddfb991d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2824
diff changeset
494 combo boxes.
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495
6116
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
496 @param index selected list index
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
497 @type int
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
498 @param combo reference to the combo box
f3d3c996c193 Continued removing the use of QObject.sender().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
499 @type QComboBox
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501 for entriesList in self.rangesEntries:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 if combo == entriesList[0]:
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
503 formatIdentifier = combo.itemData(index)
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
504 self.__performSelectedAction(formatIdentifier, entriesList[1],
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
505 None)
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
506 self.__performSelectedAction(formatIdentifier, entriesList[2],
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
507 None)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 break
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
510 def __formatCharacter(self, char, formatIdentifier):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 Private method to format the characters entered into the dialog.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 @param char character string entered into the dialog (string)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
515 @param formatIdentifier string giving a special format (-c, -h, -i or
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
516 -o) or the already formatted character (string)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517 @return formatted character string (string)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 """
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
519 if formatIdentifier == "-c":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 return char
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
521 elif formatIdentifier == "-i":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 return ""
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
523
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
524 if formatIdentifier == "-h":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
525 while len(char) < 2:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
526 char = "0" + char
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 if len(char) > 2:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528 return "\\x{{{0}}}".format(char.lower())
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 else:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530 return "\\x{0}".format(char.lower())
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
531 elif formatIdentifier == "-o":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 while len(char) < 3:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 char = "0" + char
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 if len(char) > 3:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 char = char[:3]
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 return "\\{0}".format(char)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
537 elif formatIdentifier in ["-ccp", "-cbp", "-csp"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 return "\\p{{{0}}}".format(char)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
539 elif formatIdentifier in ["-ccn", "-cbn", "-csn"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 return "\\P{{{0}}}".format(char)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
541 elif formatIdentifier == "-psp":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 return "[:{0}:]".format(char)
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
543 elif formatIdentifier == "-psn":
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 return "[:^{0}:]".format(char)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 else:
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
546 return formatIdentifier
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 def getCharacters(self):
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
550 Public method to return the character string assembled via the dialog.
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 @return formatted string for character classes (string)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
553 """
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
554 regexp = ""
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
555
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
556 # negative character range
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 if self.negativeCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558 regexp += "^"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560 # predefined character ranges
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
561 if self.wordCharCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 regexp += "\\w"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
563 if self.nonWordCharCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
564 regexp += "\\W"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 if self.digitsCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
566 regexp += "\\d"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 if self.nonDigitsCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 regexp += "\\D"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
569 if self.newlineCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 regexp += "\\R"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571 if self.nonNewlineCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 regexp += "\\N"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 if self.whitespaceCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
574 regexp += "\\s"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
575 if self.nonWhitespaceCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576 regexp += "\\S"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 if self.horizontalWhitespaceCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 regexp += "\\h"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
579 if self.nonHorizontalWhitespaceCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
580 regexp += "\\H"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581 if self.verticalWhitespaceCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
582 regexp += "\\v"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
583 if self.nonVerticalWhitespaceCheckBox.isChecked():
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
584 regexp += "\\V"
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
585
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
586 # single characters
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
587 for entrieslist in self.singlesEntries:
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
588 formatIdentifier = entrieslist[0].itemData(
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
589 entrieslist[0].currentIndex())
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
590 if formatIdentifier in ["-ccp", "-ccn", "-cbp", "-cbn", "-csp",
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
591 "-csn", "-psp", "-psn"]:
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
592 char = entrieslist[2].itemData(entrieslist[2].currentIndex())
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
593 else:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
594 char = entrieslist[1].text()
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
595 regexp += self.__formatCharacter(char, formatIdentifier)
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
596
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
597 # character ranges
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
598 for entrieslist in self.rangesEntries:
7258
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
599 if (
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
600 not entrieslist[1].text() or
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
601 not entrieslist[2].text()
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
602 ):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
603 continue
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
604 formatIdentifier = entrieslist[0].itemData(
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
605 entrieslist[0].currentIndex())
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
606 char1 = entrieslist[1].text()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
607 char2 = entrieslist[2].text()
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
608 regexp += "{0}-{1}".format(
5599
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
609 self.__formatCharacter(char1, formatIdentifier),
033967644b1f Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
610 self.__formatCharacter(char2, formatIdentifier))
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
611
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
612 if regexp:
7258
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
613 if (
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
614 (regexp.startswith("\\") and
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
615 regexp.count("\\") == 1 and
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
616 "-" not in regexp) or
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
617 len(regexp) == 1
aff39db4dacc Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
618 ):
2736
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
619 return regexp
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
620 else:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
621 return "[{0}]".format(regexp)
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622 else:
86cd4d14b58e Added a wizard for the Qt5 QRegularExpression class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 return ""

eric ide

mercurial