Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Mouse drag and Select Event in Qt
sankarapandiyan last edited by
Is it possible to drag and select the number of pushbuttons and set to enable in Qt GUI
Give me some link for this guys..
Thanks in advance.
@sankarapandiyan Do you want to do this in Qt Designer or in your app?
sankarapandiyan last edited by sankarapandiyan
@jsulm I want to do this in my Application..
I have lot of pushbuttons in ui . So ,here i want to select the pushbuttons by clicking and draging with the help of mouse and make the selected pushbuttons to enabled (SET ENABLED)...
@sankarapandiyan To select the buttons use https://doc.qt.io/qt-5/qwidget.html#mousePressEvent and https://doc.qt.io/qt-5/qwidget.html#mouseReleaseEvent events. Use the start coordinates (from mousePressEvent) and end coordinates (from mouseRelease Event) to calculate the rectangle and then check which widgets (buttons) are inside this rectangle.
You also can use https://doc.qt.io/qt-5/qrubberband.html to show the user the selection rectangle.