Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Does QSettings Group check for redundant posts?

    General and Desktop
    3
    5
    1477
    Loading More Posts
    • 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
      JimKieger last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • J
          JimKieger last edited by

          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 Reply Quote 0
          • M
            MuldeR last edited by

            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 Reply Quote 0
            • J
              JimKieger last edited by

              [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 Reply Quote 0
              • First post
                Last post