Answer the question
In order to leave comments, you need to log in
How to add flags for a window?
Conditionally I have a code
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(611, 318)
MainWindow.setMinimumSize(QtCore.QSize(611, 318))
MainWindow.setMaximumSize(QtCore.QSize(611, 318))
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
MainWindow.setFont(font)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
MainWindow.setStyleSheet("background-color: rgb(108, 108, 162);")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.Lable_Name = QtWidgets.QLabel(self.centralwidget)
self.Lable_Name.setEnabled(True)
self.Lable_Name.setGeometry(QtCore.QRect(50, 10, 591, 31))
...
class Main(QMainWindow):
def __init__(self):
super(Main, self).__init__()
self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question