Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. User authentication / User restrictions for Qt-Gui
Forum Updated to NodeBB v4.3 + New Features

User authentication / User restrictions for Qt-Gui

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.2k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sven_RS Offline
    Sven_RS Offline
    Sven_R
    wrote on last edited by
    #1

    Hallo,
    I’m new on qt and in the forum.
    At the moment I’m developing a HMI for a machine. For the HMI it’s necessary to have different users and user-levels. Another requirement is to have configurable restrictions for each widget(buttons, tables, … ). For each user-level I like to configure which widget is enabled or disabled.
    My first idea was to use the object name (Qobject::objectName) of the widgets. In my approach there should be a list where the options (enable/disable) for each widget and each user-level is stored. On startup and when the user changed I look into the list and search the objectName of each gui-widget. Than I set the enable-property of each gui-widget.
    At the moment I collect some ideas and make some drafts.
    My Question:
    What is the usual approach to handle users, user-level and user-accounts?
    What would you recommend how I should handle the enable/disable property for the widgets?
    Is there is a built-in mechanism in qt?
    Do you know some good examples?

    Thanks for helping.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      No there's no builtin mechanism for that.

      As for users, user-level and accounts, that's usually done using a database where you have all that information.

      As for handling of the widgets state you can e.g. use a custom event that you generate when the user changes and it's the responsibility of each widget to know what to enable disable based on the level of the new user.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Sven_RS 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        No there's no builtin mechanism for that.

        As for users, user-level and accounts, that's usually done using a database where you have all that information.

        As for handling of the widgets state you can e.g. use a custom event that you generate when the user changes and it's the responsibility of each widget to know what to enable disable based on the level of the new user.

        Sven_RS Offline
        Sven_RS Offline
        Sven_R
        wrote on last edited by
        #3

        @SGaist
        Thanks for you tips.
        I will do some work on my user-authentication. If I find some time i will post a short overview of my approch, if anyone is interested.

        Best regards

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JulienMaille
          wrote on last edited by
          #4

          I'm definitely interested in what you come up with!

          1 Reply Last reply
          0
          • kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            Me as well, especially the implications of disabling/hiding some widgets for some users and how you work around it.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved