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. Scrolling QComboBox's parent widget while combo's popup is shown
Forum Updated to NodeBB v4.3 + New Features

Scrolling QComboBox's parent widget while combo's popup is shown

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.5k 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.
  • napajejenunedk0N Offline
    napajejenunedk0N Offline
    napajejenunedk0
    wrote on last edited by
    #1

    @
    #include <QApplication>
    #include <QComboBox>
    #include <QScrollArea>
    #include <QVBoxLayout>
    #include <QWidget>

    int main( int argc, char* argv[] )
    {
    QApplication a(argc, argv);

    const QStringList choiceTexts =
            QStringList() << "Choice 1"
                          << "Choice 2"
                          << "Choice 3";
    
    QWidget* const combosContainer = new QWidget;
    QVBoxLayout* const combosLayout = new QVBoxLayout( combosContainer );
    for ( int i = 0; i < 30; ++ i )
    {
        QComboBox* const combo = new QComboBox;
        combo->addItems( choiceTexts );
        combosLayout->addWidget( combo );
    }
    
    QScrollArea scrollArea;
    scrollArea.setWidget( combosContainer );
    scrollArea.show();
    
    return a.exec&#40;&#41;;
    

    }
    @

    Steps to reproduce:

    1. Run the app and resize the scroll area, so that the vertical scrollbar appears.
    2. Click on any of the combos, so that their popup is shown.
    3. Now, no matter whether the mouse's cursor is over the combo's popup or outside it, if one scrolls with the mouse wheel the scroll area moves its contents but the combo's popup does not move and is somehow detached from the combo itself.

    Any suggestions how to make the combo's popup be always "attached" to the combo when scrolling?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That sound like a bug. Did you take a look at the "bug report system":http://bugreports.qt-project.org ? If there's nothing, you could consider opening a new bug report providing all the informations you have (what you wrote here)

      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
      0
      • napajejenunedk0N Offline
        napajejenunedk0N Offline
        napajejenunedk0
        wrote on last edited by
        #3

        I've used it many times. I will file a bug but I am sure it won't get resolved as all the others I've filed. And moreover I need a solution now not after years.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You should also post the link to your bug report here, it might be useful for others.

          If you need a fix in a timely fashion you could consider becoming a client of Digia or hire a good developer to fix the bug(s) in question

          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
          0
          • napajejenunedk0N Offline
            napajejenunedk0N Offline
            napajejenunedk0
            wrote on last edited by
            #5

            No, I post the problem here, rather than in the bug report system because the possibility of getting a solution is much greater.

            Anyway, if there is workaround solution, it would be welcome.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mlimber
              wrote on last edited by
              #6

              I have reported this as a bug: https://bugreports.qt-project.org/browse/QTBUG-40656

              Note that it doesn't happen on Linux, only Windows, because the parent scroll area doesn't respond to mouse wheel events while the combo is open there.

              I tried several work-arounds to force Windows to behave like Linux (see the comments at the bug report), but none of them worked.

              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