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. Retrieving REG_SZ value from Windows Registry
Forum Updated to NodeBB v4.3 + New Features

Retrieving REG_SZ value from Windows Registry

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 234 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.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by
    #1

    Given a registry value "SMTP Server" stored at:

    "HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000001"

    is this correct use of QSettings to retrieve it?

    QSettings sysSettings(QSettings::UserScope, "Microsoft");
    sysSettings.beginGroup("Internet Account Manager/Accounts/00000001");
    m_strSMTP = sysSettings.value("SMTP Server", "").toString();
    sysSettings.endGroup();
    

    Thanks
    D.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      I would have thought more like this:

      QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft",
                         QSettings::NativeFormat);
      sysSettings.beginGroup("Internet Account Manager/Accounts/00000001");
      m_strSMTP = sysSettings.value("SMTP Server", "").toString();
      sysSettings.endGroup();
      
      1 Reply Last reply
      2
      • PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote on last edited by
        #3

        Great, thank you

        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