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. [Solved]How to count childGroups()
Forum Updated to NodeBB v4.3 + New Features

[Solved]How to count childGroups()

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • R Offline
    R Offline
    roach03
    wrote on last edited by
    #1

    Hi,

             I need to return the number of groups in a ini file.
    

    Example:

    [1]
    a=apple
    b=banana
    c=cat
    [2]
    d=dog
    e=elepant
    c=cat

    The return that I need is 2 because I have 2 groups. How can I do This?

    Thanks in Advance

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jan-Willem
      wrote on last edited by
      #2

      Is it a settings file for your application?
      Then i would suggest something like this:
      @QSettings settings;
      QStringList groups = settings.childGroups();
      return groups.count();@

      1 Reply Last reply
      0
      • R Offline
        R Offline
        roach03
        wrote on last edited by
        #3

        Thank you Jan-Willem this works :)

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jan-Willem
          wrote on last edited by
          #4

          You're welcome.
          Glad I could help.

          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