src/eric7/EricNetwork/EricHostnameInputWidget.py

branch
eric7
changeset 10167
0a62a4bf749c
parent 10153
ffe7432f716b
child 10439
21c28b0f9e41
equal deleted inserted replaced
10166:a55bc571e023 10167:0a62a4bf749c
14 14
15 class EricHostnameInputWidget(QLineEdit): 15 class EricHostnameInputWidget(QLineEdit):
16 """ 16 """
17 Class implementing an input widget for network host names. 17 Class implementing an input widget for network host names.
18 """ 18 """
19
19 def __init__(self, parent=None): 20 def __init__(self, parent=None):
20 """ 21 """
21 Constructor 22 Constructor
22 23
23 @param parent reference to the parent widget (defaults to None) 24 @param parent reference to the parent widget (defaults to None)
27 28
28 self.setClearButtonEnabled(True) 29 self.setClearButtonEnabled(True)
29 30
30 self.setValidator( 31 self.setValidator(
31 QRegularExpressionValidator( 32 QRegularExpressionValidator(
32 QRegularExpression( 33 QRegularExpression(r"""([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])""")
33 r"""([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])"""
34 )
35 ) 34 )
36 ) 35 )
37 self.setMaxLength(63) 36 self.setMaxLength(63)

eric ide

mercurial