python - how to disable the window maximize icon using PyQt4? -


i know how disable window maximise button in pyqt4. @ present using qwidget.setfixedsize (self, qsize) prevent user window resizing, maximise button still enabled , when pressed causes application move top left corner of screen. wanting replicate behaviour of windows calculator application, maximise icon greyed out. know how achieve pyqt4?

haven't worked research seems point messing window flags.

qwidget has method called setwindowflags.

here doc qt.windowflags class.

here reference of flags. qt.windowmaximizebuttonhint

in general seems need find way enable qt.customizewindowhint flag , disable qt.windowmaximizebuttonhint flag. either way, want in addition setfixedsize that's start.

edit:

something like

win.setwindowflags(win.windowflags() | qtcore.qt.customizewindowhint) win.setwindowflags(win.windowflags() & ~qtcore.qt.windowmaximizebuttonhint) 

assuming import this

from pyqt4 import qtcore 

this turn on customizewindowhint flag , turn off windowmaximizebuttonhint flag, hope. let me know if works @ all.

edit:

as discovered op, call necesarry was:

win.setwindowflags(qtcore.qt.windowminimizebuttonhint) 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -