forked from yjg30737/pyqt-frameless-window
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.py
More file actions
36 lines (27 loc) · 1.04 KB
/
sample.py
File metadata and controls
36 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
# IMPORTANT!!!!!!!!!
# to prevent the "QWidget: Must construct a QApplication before a QWidget" error, you should put the code below
from PySide6.QtCore import Qt
from PySide6.QtGui import QFont
from pyqt_frameless_window import FramelessDialog, FramelessWidget, FramelessMainWindow
from PySide6.QtWidgets import QApplication, QTextEdit
class Window(FramelessDialog):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__initUi()
def __initUi(self):
self.setWindowTitle('Winter Is Coming')
self.setWindowIcon('./Stark-icon.png')
# titleBar = self.getTitleBar()
# titleBar.setTitleBarFont(QFont('Arial', 24))
# titleBar.setIconSize(32, 32)
lay = self.layout()
lay.addWidget(QTextEdit())
self.setLayout(lay)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = Window()
titlebar = window.getTitleBar()
titlebar.setTitleBarHint(['full_screen', 'min', 'close'])
window.show()
sys.exit(app.exec())