Pyqt5 창 전체 화면이 표시되지 않경

0

질문

을 만들 pyqt 지 않고 창의 제목 표시줄 및 투명합니다. 또한 추가 파란색 테두리를 위해 창 하지만 때에는 응용 프로그램을 실행를 볼 수 없습니다 파란색 테두리에 대한 창입니다.

from PyQt5.QtWidgets import * 
from PyQt5.QtGui import * 
from PyQt5.QtCore import Qt
import sys
  
class Window(QMainWindow):
    def __init__(self):
        super().__init__()
  
        # this will hide the title bar
        self.setWindowFlag(Qt.FramelessWindowHint)
        self.setStyleSheet("border : 3px solid blue;")
        self.setWindowOpacity(0.01)
        # setting  the geometry of window
        self.setGeometry(100, 100, 400, 300)
        self.showFullScreen()
  
  
  
# create pyqt5 app
App = QApplication(sys.argv)
  
# create the instance of our Window
window = Window()
window.show()
# start the app
sys.exit(App.exec())

할 수 있는 방법을 보여 테두리에 대한 답하시오.

desktop-application pyqt pyqt5 python
2021-11-16 15:52:17
1

최고의 응답

1

사용할 수 있습니다 TranslucentBackground 특성 페인트 국경/에서 배경 paintEvent.

class Window(QMainWindow):
    def __init__(self):
        super().__init__()
  
        # this will hide the title bar
        self.setWindowFlag(Qt.FramelessWindowHint)
        self.setAttribute(Qt.WA_TranslucentBackground)
        
        # setting  the geometry of window
        self.setGeometry(100, 100, 400, 300)
        self.showFullScreen()

    def paintEvent(self, event):
        qp = QPainter(self)
        qp.setPen(QPen(Qt.blue, 6))
        qp.drawRect(self.rect())
        
        qp.setOpacity(0.01)
        qp.setPen(Qt.NoPen)
        qp.setBrush(self.palette().window())
        qp.drawRect(self.rect())
2021-11-17 00:22:53

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................