How to create dynamic drag and drop functionality
-
Hi @ketaki,
Yes that's already natively supported in QWidget.Some UI element are already implementing drag & drop, like QTableWidget for example.
But if you want to make your own widget with drag and drop, what you have to do is:
- Calling
setAcceptDrops(true);
(usually in the widget's constructor) for accepting drops - Re-implement dropEvent() and dragEnterEvent()
See the documentation for more details: https://doc.qt.io/qt-5/dnd.html
- Calling
-
Wanted to create simulator type of app where user can able to drag and drop components(images) from UI app. User should able to dynamically change those component images at real time.
Is this possible using PyQt5 designer?@ketaki said in How to create dynamic drag and drop functionality:
Is this possible using PyQt5 designer?
Designer is used to design the UI. You still have to write code for the actual functionality.
Please read the documentation (@Gojir4 gave you the link). -
@ketaki said in How to create dynamic drag and drop functionality:
Is this possible using PyQt5 designer?
Designer is used to design the UI. You still have to write code for the actual functionality.
Please read the documentation (@Gojir4 gave you the link). -
@ketaki said in How to create dynamic drag and drop functionality:
Is QT supports that?
What exactly?
Drag and drop? Yes, it does, just read the link... -
@ketaki said in How to create dynamic drag and drop functionality:
Is QT supports that?
What exactly?
Drag and drop? Yes, it does, just read the link... -
@jsulm Can we create UI having icons of different elements lets suppose electric components, and user should able to select component of his/her interest to design a sysetm?
-
@ketaki Qt is full of examples: https://doc.qt.io/qt-5/qtexamplesandtutorials.html
-
@ketaki
What about you reading through the documentation link you have been given? What about, say, the Draggable Icons Example referenced there? -
@ketaki
What about you reading through the documentation link you have been given? What about, say, the Draggable Icons Example referenced there?