本文整理汇总了Python中PyQt5.QtQuick.QQuickView.setFlags方法的典型用法代码示例。如果您正苦于以下问题:Python QQuickView.setFlags方法的具体用法?Python QQuickView.setFlags怎么用?Python QQuickView.setFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtQuick.QQuickView
的用法示例。
在下文中一共展示了QQuickView.setFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QQuickView
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import setFlags [as 别名]
view = QQuickView()
context = view.rootContext()
view.engine().setOfflineStoragePath(".")
exutil = LauncherEXUtils()
qmlRegisterType(LauncherEXUtils, 'ExUtils', 1, 0, 'ExUtils')
qmlRegisterType(Bozorgrah,'Bozorgrah',1,0,'Bozorgrah')
context.setContextProperty('exutils',exutil)
view.setResizeMode(QQuickView.SizeRootObjectToView)
try:
approot = os.path.dirname(os.path.abspath(__file__))
except NameError: # We are the main py2exe script, not a module
approot = os.path.dirname(os.path.abspath(sys.argv[0]))
print(approot)
view.setSource(
QUrl.fromLocalFile(
os.path.join(approot,'qml\\app.qml')))
view.setFlags(Qt.Dialog or Qt.WindowStaysOnBottomHint);
view.setTitle("ميزکار")
view.show()
view.engine().quit.connect(app.quit)
sys.exit(app.exec_())
示例2: QApplication
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import setFlags [as 别名]
from PyQt5.QtWidgets import QApplication, qApp
from PyQt5.QtQuick import QQuickView
from PyQt5.QtGui import QSurfaceFormat, QColor
from read_conf import confList, create_qml
from PyQt5 import Qt
from tray_icon import TrayIcon
from settingWindow import SettingWindow
import subprocess
if __name__=="__main__":
app = QApplication(sys.argv)
signal.signal(signal.SIGINT, signal.SIG_DFL)
view = QQuickView()
view.setFlags(Qt.Qt.FramelessWindowHint)
surface_format = QSurfaceFormat()
surface_format.setAlphaBufferSize(8)
view.setFormat(surface_format)
view.setColor(QColor(0, 0, 0, 0))
view.setResizeMode(QQuickView.SizeRootObjectToView)
create_qml()
t_icon=TrayIcon()
sw=SettingWindow()
def show_window():
path='screen.qml'
view.engine().quit.connect(app.quit)
view.setSource(QUrl(path))