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. What is QComboBoxPrivateContainer and why is it appearing in my top level widgets?
Forum Updated to NodeBB v4.3 + New Features

What is QComboBoxPrivateContainer and why is it appearing in my top level widgets?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qcombobox
2 Posts 2 Posters 611 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.
  • C Offline
    C Offline
    CJha
    wrote on 16 Nov 2021, 10:45 last edited by
    #1

    Hi, I have a .ui file with an editable QComboBox when I check the top qApp->topLevelWidgets() I get a top level widget with class name QComboBoxPrivateContainer and no object name or window title. This does not appear if I my QComboBox is not editable.

    To reproduce, just add a editable QComboBox to the .ui file, fill it with any values if you like and show the top level widgets (on something like push button clicked signal, that's what I am doing):

    void MainWindow::on_pushButton_clicked()
    {
    	QWidgetList widList = qApp->topLevelWidgets();
    	for (auto wid : widList)
    		qDebug() << wid->metaObject()->className() << wid->objectName() << wid->windowTitle();
    }
    

    The output:

    MainWindow "MainWindowClass" "MainWindow"
    QComboBoxPrivateContainer "" ""
    

    The only reference I could find for this class is from Qt 4.8: https://dreamswork.github.io/qt4/classQComboBoxPrivateContainer.html

    On Qt Documentation (https://doc.qt.io/) there is no reference to it.

    I am just curious as to what it is and if I should just ignore it or is there anything I can do to get it out of my qApp->topLevelWidgets() list?

    J 1 Reply Last reply 16 Nov 2021, 11:27
    0
    • C CJha
      16 Nov 2021, 10:45

      Hi, I have a .ui file with an editable QComboBox when I check the top qApp->topLevelWidgets() I get a top level widget with class name QComboBoxPrivateContainer and no object name or window title. This does not appear if I my QComboBox is not editable.

      To reproduce, just add a editable QComboBox to the .ui file, fill it with any values if you like and show the top level widgets (on something like push button clicked signal, that's what I am doing):

      void MainWindow::on_pushButton_clicked()
      {
      	QWidgetList widList = qApp->topLevelWidgets();
      	for (auto wid : widList)
      		qDebug() << wid->metaObject()->className() << wid->objectName() << wid->windowTitle();
      }
      

      The output:

      MainWindow "MainWindowClass" "MainWindow"
      QComboBoxPrivateContainer "" ""
      

      The only reference I could find for this class is from Qt 4.8: https://dreamswork.github.io/qt4/classQComboBoxPrivateContainer.html

      On Qt Documentation (https://doc.qt.io/) there is no reference to it.

      I am just curious as to what it is and if I should just ignore it or is there anything I can do to get it out of my qApp->topLevelWidgets() list?

      J Online
      J Online
      JonB
      wrote on 16 Nov 2021, 11:27 last edited by
      #2

      @CJha
      So it's obviously internal. Ignore it, and no you won't be able to alter what qApp->topLevelWidgets() returns, just remove any QComboBoxPrivateContainers.

      1 Reply Last reply
      1

      2/2

      16 Nov 2021, 11:27

      • Login

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