При уменьшении окна по горизонтали правый край начинает мерцать.
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QMainWindow, QSizeGrip, QSizePolicy,
QVBoxLayout, QWidget)
from sys import argv, exit
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.resize(1015, 560)
MainWindow.setStyleSheet(u"QWidget {\n"
" color: white;\n"
" background-color: #121212;\n"
" font: 16pt \"Lato\";\n"
" font-weight: 600;\n"
"}\n"
"\n"
"#centralwidget {\n"
" border-radius: 10px;\n"
" border: 2.5px solid white;\n"
"}")
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
self.verticalLayout = QVBoxLayout(self.centralwidget)
self.verticalLayout.setSpacing(0)
self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setContentsMargins(0, 0, 15, 15)
self.widget = QSizeGrip(self.centralwidget)
self.widget.setObjectName(u"widget")
self.widget.setMinimumSize(QSize(32, 32))
self.widget.setMaximumSize(QSize(32, 32))
self.widget.setStyleSheet(u"border: 1.5px solid white;\n"
"border-radius: 10px;")
self.verticalLayout.addWidget(self.widget, 0, Qt.AlignRight|Qt.AlignBottom)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QMetaObject.connectSlotsByName(MainWindow)
# setupUi
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
# retranslateUi
class Main(QMainWindow, Ui_MainWindow):
def __init__(self):
super(Main, self).__init__()
self.setupUi(self)
self.setWindowFlag(Qt.FramelessWindowHint)
self.setAttribute(Qt.WA_TranslucentBackground)
if __name__ == "__main__":
app = QApplication(argv)
window = Main()
window.show()
exit(app.exec())