with pyside(qt4) I can use QDeclarativeView make character be transparent easily .
like this image
I can also drag these text by click the character accurately
from PySide.QtCore import Qt
from PySide.QtGui import QApplication, QWidget, QMenu, QSystemTrayIcon
from PySide.QtDeclarative import QDeclarativeView
app = QApplication([])
tray = QSystemTrayIcon()
menu = QMenu()
menu.addAction("Quit").triggered.connect(app.quit)
tray.setContextMenu(menu)
view = QDeclarativeView()
view.setSource('main.qml')
view.setAttribute(Qt.WA_TranslucentBackground)
view.setStyleSheet("background-color:transparent")
view.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
view.showFullScreen()
tray.show()
app.exec_()
the qml code here
I tried to use QQuickView and QQuickWidget in Pyside2 with the same code.And I can't make the mouse event pass through the window.
Edit:
still not solved. related to
QQuickView (QML) transparent for mouse events
How to make a "True Transparent" window to cursor, preferably on a pure QML? (Qt 5.7)
I also tried Qt.WA_TransparentForMouseEvents
but this will transparent every thing of the qml file.