

KoToolManager::instance()->registerTools( actionCollection(), d->canvasController ) ĭ->zoomController = new KoZoomController( d->canvasController, zoomHandler(), actionCollection()) Ĭonnect( d->zoomController, SIGNAL( zoomChanged( KoZoomMode::Mode, qreal ) ), KoToolManager::instance()->addController( d->canvasController ) KoCanvasControllerWidget *canvasController = new KoCanvasControllerWidget( this ) ĭ->canvasController->setCanvas( d->canvas ) Let me know if this works at all.Īs discovered by OP, the only call necessary for his desired outcome: win.setWindowFlags(QtCore.Qt.WindowMinimizeButtonHint)īut beware, since this will also remove the close button and potentially mess with other window flags.QGridLayout * gridLayout = new QGridLayout( this ) ĭ->canvas = new KoPACanvas( this, d->doc, this ) This would turn on the CustomizeWindowHint flag and turn off the WindowMaximizeButtonHint flag, I hope. Win.setWindowFlags(win.windowFlags() & ~QtCore.Qt.WindowMaximizeButtonHint)Īssuming your import is something like this from PyQt4 import QtCore Something like win.setWindowFlags(win.windowFlags() | QtCore.Qt.CustomizeWindowHint) Either way, you probably want this in addition to setFixedSize so that's a good start. In general it seems like you need to find a way to enable the Qt.CustomizeWindowHint flag and disable the Qt.WindowMaximizeButtonHint flag. Here is a reference for all of the flags. Here is the doc for the Qt.WindowFlags class. QWidget has a method called setWindowFlags. Haven't worked with it but research seems to point to messing with the window flags. Does anyone know how to achieve this with PyQt4? I am basically wanting to replicate the behaviour of the Windows calculator application, where the maximise icon is greyed out. I am at present using tFixedSize (self, QSize) to prevent user window resizing, however the maximise button is still enabled and when pressed causes the application to move to the top left corner of the screen. I would like to know how to disable the window Maximise button in pyqt4.
