Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Password protect a tab
Forum Updated to NodeBB v4.3 + New Features

Password protect a tab

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 4 Posters 865 Views 1 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.
  • I Offline
    I Offline
    Igor86
    wrote on last edited by
    #1

    Hello all!

    My application has multiple tabs. some of them, like the "settings" tab should only be available after authentication as administrator.

    One way I found is to add a button to the any of the non locked pages, that requires the user to log in. once logged in the disabled tabs get enabled. but I dont like it.

    Is there a native way to request username and/or password when trying to access a tab?

    Thank you very much!

    Best regards

    jsulmJ 1 Reply Last reply
    0
    • I Igor86

      Hello all!

      My application has multiple tabs. some of them, like the "settings" tab should only be available after authentication as administrator.

      One way I found is to add a button to the any of the non locked pages, that requires the user to log in. once logged in the disabled tabs get enabled. but I dont like it.

      Is there a native way to request username and/or password when trying to access a tab?

      Thank you very much!

      Best regards

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Igor86 said in Password protect a tab:

      after authentication as administrator

      What kind of administrator? An existing user account on the machine where your app is running?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • I Offline
        I Offline
        Igor86
        wrote on last edited by
        #3

        nope, its just some sort of authentication to avoid that the average joe can change settings. it does not need to be super secure.. it can even be a hardcoded password written in plain text in the source code, that the user has to type in a password box before he can access it

        1 Reply Last reply
        0
        • Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          There is no other way than enabling/disabling the tab programmatically.

          Software Engineer
          The Qt Company, Oslo

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

            Hi,

            Then you should rather have an "advanced" section in your application settings.

            Use something like a QStackedWidget and show the "login" button on it and once the correct password is entered, switch to the other view with the settings. You can lock it again when the user changes the view or after a delay.

            For the password management, it depends on what level of protection you want to have and the OS you are using.

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

            1 Reply Last reply
            2

            • Login

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