Hiding context button in Qt 5.15
-
wrote on 22 Feb 2023, 13:28 last edited by
Hi. I'm building a QInputDialog in Qt 5.15, and have the following code.
QInputDialog passwordBox(this, Qt::Dialog); bool ok; passwordBox.exec();
I would like to remove the context help button, aka the "?" button and am unsure how to do so. The Qt 5.15 documentation for QInputDialog doesn't have any suggestions, and I attempted the following based on the application attribute documentation.
QInputDialog passwordBox(this, Qt::Dialog); bool ok; passwordBox.setAttribute(Qt::AA_DisableWindowContextHelpButton); passwordBox.exec();
I got the following error.
error: cannot initialize a parameter of type 'Qt::WidgetAttribute' with an rvalue of type 'Qt::ApplicationAttribute'
I am unsure how to proceed on hiding the context button. Please let me know if more info is required.
-
Hi. I'm building a QInputDialog in Qt 5.15, and have the following code.
QInputDialog passwordBox(this, Qt::Dialog); bool ok; passwordBox.exec();
I would like to remove the context help button, aka the "?" button and am unsure how to do so. The Qt 5.15 documentation for QInputDialog doesn't have any suggestions, and I attempted the following based on the application attribute documentation.
QInputDialog passwordBox(this, Qt::Dialog); bool ok; passwordBox.setAttribute(Qt::AA_DisableWindowContextHelpButton); passwordBox.exec();
I got the following error.
error: cannot initialize a parameter of type 'Qt::WidgetAttribute' with an rvalue of type 'Qt::ApplicationAttribute'
I am unsure how to proceed on hiding the context button. Please let me know if more info is required.
wrote on 22 Feb 2023, 13:44 last edited by@Dummie1138 said in Hiding context button in Qt 5.15:
Qt::AA_DisableWindowContextHelpButton
is to disable it application-wide, to be used on theQApplication
object. If you want it only on this dialog try removing Qt::WindowContextHelpButtonHint instead? Something like:passwordBox.setAttribute(Qt::WindowContextHelpButtonHint, false);
1/2