5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog for entering character classes. |
7 Module implementing a dialog for entering character classes. |
8 """ |
8 """ |
9 |
9 |
10 |
10 from PyQt5.QtCore import QRegularExpression |
11 from PyQt5.QtCore import QRegExp |
11 from PyQt5.QtGui import QRegularExpressionValidator |
12 from PyQt5.QtGui import QRegExpValidator |
|
13 from PyQt5.QtWidgets import ( |
12 from PyQt5.QtWidgets import ( |
14 QWidget, QDialog, QVBoxLayout, QHBoxLayout, QScrollArea, QPushButton, |
13 QWidget, QDialog, QVBoxLayout, QHBoxLayout, QScrollArea, QPushButton, |
15 QSpacerItem, QSizePolicy, QComboBox, QLineEdit, QLabel |
14 QSpacerItem, QSizePolicy, QComboBox, QLineEdit, QLabel |
16 ) |
15 ) |
17 |
16 |
60 (self.tr("Not Character Block"), "-cbn"), |
59 (self.tr("Not Character Block"), "-cbn"), |
61 (self.tr("Not Special Character Category"), "-csn"), |
60 (self.tr("Not Special Character Category"), "-csn"), |
62 (self.tr("Not POSIX Named Set"), "-psn"), |
61 (self.tr("Not POSIX Named Set"), "-psn"), |
63 ]) |
62 ]) |
64 |
63 |
65 self.charValidator = QRegExpValidator(QRegExp(".{0,1}"), self) |
64 self.charValidator = QRegularExpressionValidator( |
66 self.hexValidator = QRegExpValidator(QRegExp("[0-9a-fA-F]{0,4}"), self) |
65 QRegularExpression(".{0,1}"), self) |
67 self.octValidator = QRegExpValidator(QRegExp("[0-3]?[0-7]{0,2}"), self) |
66 self.hexValidator = QRegularExpressionValidator( |
|
67 QRegularExpression("[0-9a-fA-F]{0,4}"), self) |
|
68 self.octValidator = QRegularExpressionValidator( |
|
69 QRegularExpression("[0-3]?[0-7]{0,2}"), self) |
68 |
70 |
69 # generate dialog part for single characters |
71 # generate dialog part for single characters |
70 self.singlesBoxLayout = QVBoxLayout(self.singlesBox) |
72 self.singlesBoxLayout = QVBoxLayout(self.singlesBox) |
71 self.singlesBoxLayout.setObjectName("singlesBoxLayout") |
73 self.singlesBoxLayout.setObjectName("singlesBoxLayout") |
72 self.singlesBoxLayout.setSpacing(6) |
74 self.singlesBoxLayout.setSpacing(6) |