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. How to check if the contents of QComboBox are empty or not?
Forum Updated to NodeBB v4.3 + New Features

How to check if the contents of QComboBox are empty or not?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 2.2k 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.
  • S Offline
    S Offline
    Surabhi
    wrote on last edited by
    #1

    I am a beginner in Qt and probably this is a very easy task but i wanted to know how to find if a QCombobox is empty or not?
    I tried to do something like this
    if(ui.ComboBox->currentIndex(-1))
    But this is not working for me and gives me an error that "too many arguments in function call"

    1 Reply Last reply
    0
    • GerhardG Offline
      GerhardG Offline
      Gerhard
      wrote on last edited by
      #2

      if (ui.ComboBox->count() == 0)

      Gerhard

      1 Reply Last reply
      6

      • Login

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