PDA

View Full Version : Force dialog to have WhatsThis title bar button



hvengel
10th January 2013, 20:33
I would like a dialog to display the "?" whats this button in the title bar. This is a Windows app and I am currently running Windows 7 on my dev machine. I have tried

MyDialog::MyDialog(QWidget* parent)
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint | Qt::WindowContextHelpButtonHint)

but the "?" button does not appear. I know that this is OS dependent and that the WindowFlags are hints and not commands and I suspect that this button not appearing has something to do with the OS (version?). But there has to be a way to force it to appear so that users have a visible way to go into What This mode. How is this done?

Santosh Reddy
11th January 2013, 07:32
QDialog, by default has the Context Help button (or WhatIsThis), do not set any flags, it will appear.

If you are looking for Context Help button and Maximize button to co-exist then that is not possible, Windows does not support it.

Refer Here (https://bugreports.qt-project.org/browse/QTBUG-8049)

hvengel
11th January 2013, 22:39
Thanks that helped. I keep forgetting the the window hints behave differently on different OS/Windowing systems. IE. with X11 you can have min/max buttons along with the What's This button in the title bar but not on Windows.