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. How to read windows Registry Values in Qt?
Forum Updated to NodeBB v4.3 + New Features

How to read windows Registry Values in Qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 5.6k Views 2 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.
  • S Offline
    S Offline
    Sanjeev Gudisagar
    wrote on 6 Oct 2018, 07:00 last edited by
    #1

    i am able to read registry keys, but i am not getting how to read registry values

    R 1 Reply Last reply 6 Oct 2018, 07:21
    0
    • S Sanjeev Gudisagar
      6 Oct 2018, 07:00

      i am able to read registry keys, but i am not getting how to read registry values

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 6 Oct 2018, 07:21 last edited by
      #2

      @Sanjeev-Gudisagar
      did you already read the QSettings docs?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      4
      • S Offline
        S Offline
        Sanjeev Gudisagar
        wrote on 6 Oct 2018, 07:36 last edited by
        #3

        @raven-worx Yes

        A 1 Reply Last reply 6 Oct 2018, 08:07
        0
        • S Sanjeev Gudisagar
          6 Oct 2018, 07:36

          @raven-worx Yes

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 6 Oct 2018, 08:07 last edited by
          #4

          @Sanjeev-Gudisagar

          can you show the code you have so far?

          Qt has to stay free or it will die.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            Sanjeev Gudisagar
            wrote on 6 Oct 2018, 09:13 last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • S Offline
              S Offline
              Sanjeev Gudisagar
              wrote on 6 Oct 2018, 09:23 last edited by
              #6

              @aha_1980
              int main(int argc, char *argv[])
              {
              QApplication a(argc, argv);
              QSettings m("HKEY_LOCAL_MACHINE\SOFTWARE\Dell",
              QSettings::Registry64Format);

              QString val = m.value("HKEY_LOCAL_MACHINE\\SOFTWARE\\Dell").toString();
              qDebug()<<val<<endl;
              
              return a.exec();
              

              }

              A 1 Reply Last reply 6 Oct 2018, 11:36
              0
              • S Sanjeev Gudisagar
                6 Oct 2018, 09:23

                @aha_1980
                int main(int argc, char *argv[])
                {
                QApplication a(argc, argv);
                QSettings m("HKEY_LOCAL_MACHINE\SOFTWARE\Dell",
                QSettings::Registry64Format);

                QString val = m.value("HKEY_LOCAL_MACHINE\\SOFTWARE\\Dell").toString();
                qDebug()<<val<<endl;
                
                return a.exec();
                

                }

                A Offline
                A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on 6 Oct 2018, 11:36 last edited by aha_1980 10 Jun 2018, 11:37
                #7

                @Sanjeev-Gudisagar

                can you show how this path looks in the regedit?

                regarding your code:

                • the path in the ctor should have double backslash '\\' or forward slash '/'
                • value() does not get a path, but a single key name

                Qt has to stay free or it will die.

                1 Reply Last reply
                3

                1/7

                6 Oct 2018, 07:00

                • Login

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