-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from clci/accept-itemdatarole-and-flags
Accept Qt.ItemDataRole, GraphicsItemFlag and QPainter.RenderHint
- Loading branch information
Showing
4 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from PySide2.QtCore import Qt | ||
from PySide2.QtWidgets import QGraphicsItem | ||
|
||
class TestItem(QGraphicsItem): | ||
pass | ||
|
||
a = TestItem() | ||
a.setData(Qt.UserRole, {1: 11, 2: 22}) | ||
_ = a.data(Qt.UserRole) | ||
|
||
a.setFlags(QGraphicsItem.ItemSendsScenePositionChanges) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from PySide2.QtCore import Qt | ||
from PySide2.QtGui import QPainter | ||
from PySide2.QtWidgets import QGraphicsView | ||
|
||
a = QGraphicsView() | ||
a.setRenderHints(QPainter.Antialiasing) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from PySide2.QtCore import Qt | ||
from PySide2.QtWidgets import QListWidgetItem | ||
|
||
a = QListWidgetItem() | ||
a.setData(Qt.UserRole, {1: 11, 2: 22}) | ||
_ = a.data(Qt.UserRole) | ||
|