I notice that windows from QMdiarea needs to be style customized. I want to remove icon which appears on topleft of QMdiSubWindow widget and at the same time change this ugly blue color of window to something which look pretty good.
I have tried my setWindowsflag, but no effect.
The code:
class Mywindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super(Mywindow, self).__init__(parent)
self.setMinimumSize(QtCore.QSize(800,600))
self.setWindowTitle('Customized style')
self.mdiarea = QtWidgets.QMdiArea()
self.setCentralWidget(self.mdiarea)
self.mdiarea.setWindowTitle('Test')
self.window = QtWidgets.QWidget()
self.mdiarea.addSubWindow(self.window)
if __name__ == '__main__':
import sys
app = QtWidgets.QApplication(sys.argv)
app.setStyle('Fusion')
view = Mywindow()
view.showMaximized()
sys.exit(app.exec_())
Current Display:
Wants to obtain:
Any idea how to achieve that?



At least there are 2 solutions:
1. Use Qt StyleSheet
You must use the "background" property of QMdiSubWindow: title to change the color, and to remove the icon the trick is to pass it an icon with transparent color
As you can see in my operating system, it has a white color in the middle that is not desired that serves to color the title of the subwindow, maybe in another operating system it does not generate that problem.
2. Use a QProxyStyle
In this case you can modify the style so it should be a more robust solution than the previous one and should not have other styles. For a simple operation I have created a custom QMdiSubWindow.