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. Does QSettings Group check for redundant posts?
QtWS25 Last Chance

Does QSettings Group check for redundant posts?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.7k Views
  • 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.
  • J Offline
    J Offline
    JimKieger
    wrote on last edited by
    #1

    Okay, after going over my code again, I think I have it figured out now. However, I came upon something else. Does QSettings check for multiple posts automatically or do I have to use a compare operator?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by multiple posts ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JimKieger
        wrote on last edited by
        #3

        What I want to do is have something be compared inside a QSettings group, and if it is\isn't there, do something.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MuldeR
          wrote on last edited by
          #4

          If you just want to check whether a specif key is already set, simply use:
          bool QSettings::contains ( const QString & key ) const

          If your key is inside a group, then either use beginGroup() before contains() or specify the key as "myGroupName/myKeyName".

          Maybe you could also use QSettings::value() with an appropriate default value...

          My OpenSource software at: http://muldersoft.com/

          Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

          Go visit the coop: http://youtu.be/Jay...

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JimKieger
            wrote on last edited by
            #5

            [quote author="MuldeR" date="1366396739"]If you just want to check whether a specif key is already set, simply use:
            bool QSettings::contains ( const QString & key ) const

            If your key is inside a group, then either use beginGroup() before contains() or specify the key as "myGroupName/myKeyName".

            Maybe you could also use QSettings::value() with an appropriate default value...[/quote]

            Oh I checked the documentation with that and saw it there. Crap, how did I not see it. Thanks for showing me though.

            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