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. Is it possible to prevent hide popup in QComboBox?
QtWS25 Last Chance

Is it possible to prevent hide popup in QComboBox?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 319 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.
  • T Offline
    T Offline
    TomNow99
    wrote on 29 Oct 2020, 16:44 last edited by
    #1

    Hi,

    I would like to prevent hide popup in my subclass of QComboBox.

    I tried:

    view()->viewport()->installEventFilter(this);
    

    and in bool myComboBox::eventFilter(QObject *object, QEvent *event):

        else if(event->type() == QEvent::Hide && dialog->isVisible())
        {
            return true;
        }
    

    but it doesn't works.

    And one more information: I would like only prevent hide popup when dialog is visible, so something like above.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 29 Oct 2020, 17:31 last edited by
      #2

      Hi
      Try overwrite
      https://doc.qt.io/qt-5/qcombobox.html#hidePopup
      and see if that makes it controllable.

      1 Reply Last reply
      1

      1/2

      29 Oct 2020, 16:44

      • Login

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