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. Create windows registry SubKey using QSettings
Qt 6.11 is out! See what's new in the release blog

Create windows registry SubKey using QSettings

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 902 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.
  • T Offline
    T Offline
    Taytoo
    wrote on last edited by aha_1980
    #1

    Trying to figure out how to add a subkey to registry path but can't find any method in QSettings?

    Example Path: "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

    I want to add a subkey/path "Acme", so the full path becomes:

    "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Acme"

    and then in this path I can add string values using SetValue (this part is straightforward)

    JonBJ 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      I would try with QSettings::beginGroup()

      T Offline
      T Offline
      Taytoo
      wrote on last edited by
      #4

      @Christian-Ehrlicher said in Create windows registry SubKey using QSettings:

      I would try with QSettings::beginGroup()

      It works, however, only if there is a setValue call between beginGroup and endGroup.

      @JonB Tried your suggestion, it didn't work (silent failure). Also tried calling setValue with subkey name empty Variant or String, that didn't create a subkey either.

      1 Reply Last reply
      1
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        I would try with QSettings::beginGroup()

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        T 1 Reply Last reply
        2
        • T Taytoo

          Trying to figure out how to add a subkey to registry path but can't find any method in QSettings?

          Example Path: "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

          I want to add a subkey/path "Acme", so the full path becomes:

          "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Acme"

          and then in this path I can add string values using SetValue (this part is straightforward)

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #3

          @Taytoo
          I was going to say have you just tried QSettings::setValue("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Acme\something")? But certianly try @Christian-Ehrlicher's.

          1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            I would try with QSettings::beginGroup()

            T Offline
            T Offline
            Taytoo
            wrote on last edited by
            #4

            @Christian-Ehrlicher said in Create windows registry SubKey using QSettings:

            I would try with QSettings::beginGroup()

            It works, however, only if there is a setValue call between beginGroup and endGroup.

            @JonB Tried your suggestion, it didn't work (silent failure). Also tried calling setValue with subkey name empty Variant or String, that didn't create a subkey either.

            1 Reply Last reply
            1

            • Login

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