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 last edited by
    #1

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

    raven-worxR 1 Reply Last reply
    0
    • S Sanjeev Gudisagar

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

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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 last edited by
        #3

        @raven-worx Yes

        aha_1980A 1 Reply Last reply
        0
        • S Sanjeev Gudisagar

          @raven-worx Yes

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 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 last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • S Offline
              S Offline
              Sanjeev Gudisagar
              wrote on 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();
              

              }

              aha_1980A 1 Reply Last reply
              0
              • S Sanjeev Gudisagar

                @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();
                

                }

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by aha_1980
                #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

                • Login

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