Drag
Qt Base Class: QDrag
Signature: QDrag(self, dragSource: PySide6.QtCore.QObject) -> None
Base classes
Name |
Children |
Inherits |
ObjectMixin prettyqt.core.object
|
|
|
QDrag PySide6.QtGui QDrag(self, dragSource: PySide6.QtCore.QObject) -> None |
|
|
⋔ Inheritance diagram
graph TD
1473245526032["gui.Drag"]
1473299815024["core.ObjectMixin"]
140713234304496["builtins.object"]
1473289263248["QtGui.QDrag"]
1473288842240["QtCore.QObject"]
1473291690208["Shiboken.Object"]
1473299815024 --> 1473245526032
140713234304496 --> 1473299815024
1473289263248 --> 1473245526032
1473288842240 --> 1473289263248
1473291690208 --> 1473288842240
140713234304496 --> 1473291690208
🛈 DocStrings
Bases: ObjectMixin
, QDrag
Support for MIME-based drag and drop data transfer.
Source code in prettyqt\gui\drag.py
| class Drag(core.ObjectMixin, gui.QDrag):
"""Support for MIME-based drag and drop data transfer."""
def get_pixmap(self) -> gui.Pixmap:
return gui.Pixmap(self.pixmap())
def get_default_action(self) -> constants.DropActionStr:
return constants.DROP_ACTION.inverse[self.defaultAction()]
def get_drag_cursor(
self, action: constants.DropActionStr | constants.DropAction
) -> gui.Pixmap:
px = self.dragCursor(constants.DROP_ACTION.get_enum_value(action))
return gui.Pixmap(px)
def set_drag_cursor(
self,
cursor: gui.QPixmap,
action: constants.DropActionStr | constants.DropAction,
):
self.setDragCursor(cursor, constants.DROP_ACTION.get_enum_value(action))
def get_supported_actions(self) -> list[constants.DropActionStr]:
return constants.DROP_ACTION.get_list(self.supportedActions())
def main_loop(
self,
supported_actions: Iterable[constants.DropActionStr | constants.DropAction]
| None = None,
default_drop_action: constants.DropActionStr | constants.DropAction | None = None,
) -> constants.DropActionStr:
supported_actions = supported_actions or [constants.DROP_ACTION["move"]]
flag = constants.DropAction(0)
for i in supported_actions:
flag |= constants.DROP_ACTION.get_enum_value(i)
default_action = constants.DROP_ACTION.get_enum_value(default_drop_action)
result = super().exec(flag, default_action)
return constants.DROP_ACTION.inverse[result]
|
⌗ Property table
Qt Property |
Type |
Doc |
objectName |
QString |
|