defined PROJECT_NAME_ROLE

This commit is contained in:
iLLiCiTiT 2021-09-23 14:02:30 +02:00
parent 2921bc6c46
commit fd7438c2ac
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,6 @@
__all__ = (
"IDENTIFIER_ROLE",
"PROJECT_NAME_ROLE",
"HierarchyView",
@ -20,7 +21,8 @@ __all__ = (
from .constants import (
IDENTIFIER_ROLE
IDENTIFIER_ROLE,
PROJECT_NAME_ROLE
)
from .widgets import CreateProjectDialog
from .view import HierarchyView

View file

@ -17,6 +17,9 @@ ITEM_TYPE_ROLE = QtCore.Qt.UserRole + 5
# Item has opened editor (per column)
EDITOR_OPENED_ROLE = QtCore.Qt.UserRole + 6
# Role for project model
PROJECT_NAME_ROLE = QtCore.Qt.UserRole + 7
# Allowed symbols for any name
NAME_ALLOWED_SYMBOLS = "a-zA-Z0-9_"
NAME_REGEX = re.compile("^[" + NAME_ALLOWED_SYMBOLS + "]*$")