pyqt是否有可能抢占屏幕之外的区域?
这是我的代码,它的作用是捕获并显示它
# -*- coding: utf-8 -*-
import sys
import os
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2.QtCore import *
class test_widget(QWidget):
def __init__(self, parent=None):
super(test_widget, self).__init__(parent)
self.__ui__()
def __ui__(self):
t_lay_parent = QVBoxLayout()
self.pushButton_open = QPushButton("Screen")
self.label_image = QLabel()
t_lay_parent.addWidget(self.pushButton_open)
t_lay_parent.addWidget(self.label_image)
self.pushButton_open.clicked.connect(self.slt_open)
self.setLayout(t_lay_parent)
def slt_open(self):
self.full_screen = QGuiApplication.primaryScreen().grabWindow(long(0), self.x(), self.y(), self.width(), self.height())
self.label_image.setPixmap(self.full_screen)
if __name__ == '__main__':
app = QApplication(sys.argv)
win = test_widget()
win.show()
sys.exit(app.exec_())
它不能完全捕获自己,我希望它可以完全捕获自己,包括屏幕之外的区域