Add Minimize & Maximize buttons to TK App?

Hello group,

I am trying to add minimize and maximize buttons(just like sg desktop) to a tk app,
sg_desktop_min_max_buttons

starterapp_no_buttons

Added these lines inside the constructor

self.setWindowFlag(QtCore.Qt.WindowMinimizeButtonHint, True)
self.setWindowFlag(QtCore.Qt.WindowMaximizeButtonHint, True)

but nothing happened …

What am I doing wrong here …?

Did you happen to find a solution to this?

you have to edit global toolkit definition…

in tk-core/python/tank/platform/tankqdialog.py

line aprox 192:

add these:

self.setWindowFlags(self.windowFlags() |
                    QtCore.Qt.WindowTitleHint |
                    QtCore.Qt.WindowMaximizeButtonHint |
                    QtCore.Qt.WindowMinimizeButtonHint |
                    QtCore.Qt.WindowCloseButtonHint
                    | QtCore.Qt.Window
                    )
1 Like

Thanks so much for this!

1 Like

Awsome! I’d be so happy if you made a PR for this so it becomes included in the standard apps!

2 Likes

Yeah that might be cool to include as app settings.

enable_dialog_maximize or something.

2 Likes