Jan-02-2025, 05:16 PM
Hi All
I have never had this issue before, but I am opening a Window with a QLabel on and setting the text to a paricular value. However, when I open the window a few different times, the text seems to not clear before updating itself with the new text in. See image.
'lblTEST' is the name of the label I've been trying to get working because lblUsersWorkflow wasn't working
I have never had this issue before, but I am opening a Window with a QLabel on and setting the text to a paricular value. However, when I open the window a few different times, the text seems to not clear before updating itself with the new text in. See image.
'lblTEST' is the name of the label I've been trying to get working because lblUsersWorkflow wasn't working
def updateUsersPermissionsControls(self): # First filter by the users role permissionsDF = self.maintainResourcesWt.dfUserPermissions.copy() roleDf = self.maintainResourcesWt.dfRoles.copy() # Get the RoleID where the role is Unallocated roleDf = roleDf[roleDf['RoleShortName'] == 'Unallocated'] roleDf.reset_index(drop=True, inplace=True) unallocatedRoleID = roleDf.at[0, 'RoleID'] if not self.lblSessionRoleID.text().isnumeric(): roleID = unallocatedRoleID else: roleID = int(self.lblSessionRoleID.text()) permissionsDF = permissionsDF[permissionsDF['RoleID'] == roleID] permissionsDF.reset_index(drop=True, inplace=True) # Users_EditUsers Permission permissionLevelDf = permissionsDF[permissionsDF['PermissionType'] == 'Users_EditUsers'] permissionLevelDf.reset_index(drop=True, inplace=True) permissionLevel = permissionLevelDf.at[0, 'PermissionTypeLevel'] permissionRole = permissionLevelDf.at[0, 'PermissionRole'] if permissionLevel == 'Denied': self.maintainUsersWindow.close() self.msgBox.setWindowTitle('Permission Required') self.msgBox.setText('Permissions are required to access this area') self.msgBox.setStandardButtons(QMessageBox.Abort) ret = self.msgBox.exec() return else: if permissionLevel == 'Viewer': self.maintainUsersUi.btnMaintainUsersUpdate.setEnabled(False) #self.maintainUsersUi.lblUsersWorkflow.setText('Read-Only') self.maintainUsersUi.lblTEST.setText('Read-Only') elif permissionLevel == 'Editor': if 'SelfApproval' in permissionRole: #self.maintainUsersUi.lblUsersWorkflow.setText('Editor') self.maintainUsersUi.lblTEST.setText('Editor') self.maintainUsersUi.btnMaintainUsersUpdate.setEnabled(True) elif 'Requestor' in permissionRole: #self.maintainUsersUi.lblUsersWorkflow.setText('Request') self.maintainUsersUi.lblTEST.setText('Request') self.maintainUsersUi.btnMaintainUsersUpdate.setEnabled(True) else: #self.maintainUsersUi.lblUsersWorkflow.setText('Read-Only') self.maintainUsersUi.lblTest.setText('Red-Only') self.maintainUsersUi.btnMaintainUsersUpdate.setEnabled(False)