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. QVariant type changes after round trip to Registry
Qt 6.11 is out! See what's new in the release blog

QVariant type changes after round trip to Registry

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

    I was somewhat surprised to find that if I harden a QVariant(bool) to the Windows Registry, and then read it back, the QVariant returned is a QVariant(string) with the value "false".

    Is that normal? Or have I messed up.

    Thanks
    David

    jsulmJ 1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by
      #3

      Windows Registry doesn't support bool type.
      So Qt would have to convert it to a supported type. I suppose toString() must be the simpliest.

      PerdrixP 1 Reply Last reply
      3
      • PerdrixP Perdrix

        I was somewhat surprised to find that if I harden a QVariant(bool) to the Windows Registry, and then read it back, the QVariant returned is a QVariant(string) with the value "false".

        Is that normal? Or have I messed up.

        Thanks
        David

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

        @Perdrix Can you show how you're writing/reading that value?

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

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Bonnie
          wrote on last edited by
          #3

          Windows Registry doesn't support bool type.
          So Qt would have to convert it to a supported type. I suppose toString() must be the simpliest.

          PerdrixP 1 Reply Last reply
          3
          • B Bonnie

            Windows Registry doesn't support bool type.
            So Qt would have to convert it to a supported type. I suppose toString() must be the simpliest.

            PerdrixP Offline
            PerdrixP Offline
            Perdrix
            wrote on last edited by
            #4

            @Bonnie That's fine - so long as its not a surprise, I am happy!

            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