Mouse drag and Select Event in Qt
-
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.
-
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 Do you want to do this in Qt Designer or in your app?
@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)...
-
@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.