Important: Please read the Qt Code of Conduct -

How do I "pass" or "transfer" mouse events from a QToolButton to a QSlider handle in a popup QWidget?

  • I made a custom widget for use in a custom delegate which is composed of a QLineEdit and a QToolButton. The QToolButton acts much like the button in a combobox but instead of showing a dropdown list it shows a popup QSlider.

    The implementation seems to work now but I want to make it so that when you press the mouse on the QToolButton, you can just drag the mouse to drag the QSlider's handle without releasing the mouse button or having to click on the handle again.

    I've managed to move the cursor somewhere inside the QSlider's handle. I also tried using grabMouse()/releaseMouse() but without success.

    The source code: "Download the source":
    Created with Qt Creator 2.4.1
    Source code built with Qt 4.8.0 for Desktop MinGW/MSVC2010

    I'm a novice to both c++ and Qt so I may be asking the wrong question . Please don't hesitate to point out lines of code that you think is wrong.

Log in to reply