Hi,

whats the smartest way to enable or disable controls (control groups) in Qt?
I want to use something like an ACL (Access Controll List) in combination with QStateMachine to realize this.
Or is there a way to directly connect an ACL to controls? I.e. if a signal is emited like signalUserRoleChanged that I can connect this signal to a ControlGroup and this control group has a property with roles allowed to access this control group (Whitelist) and if the new role matches the whitelist so the controls should be enabled otherwise the controls should be disabled.

Aktually Iam using the verry messy method like this:
Qt Code:
  1. if(member()->isAdmin()) {
  2. m_ui->actionUserManager->setEnabled(true);
  3. m_ui->actionModuleControl->setEnabled(true);
  4. m_ui->actionProgramControl->setEnabled(true);
  5. m_ui->actionReportControl->setEnabled(true);
  6. } else {
  7. m_ui->actionUserManager->setEnabled(false);
  8. m_ui->actionModuleControl->setEnabled(false);
  9. m_ui->actionProgramControl->setEnabled(false);
  10. m_ui->actionReportControl->setEnabled(false);
  11. }
To copy to clipboard, switch view to plain text mode 

Regards