How to Remove "?" button from QWidget Window titlebar?
-
wrote on 26 Nov 2018, 19:35 last edited by
Using QT 5.9 ... code below works if using QDialog but not QWidget
I have experimented with various window type and flags combinations and can't seem to remove the infamous "What's this button"constructor is
QWidget(parent, (Qt::Window | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint))...
// Remove the context help button (?).
Qt::WindowFlags flags = windowFlags();
flags = (flags & ~Qt::WindowContextHelpButtonHint);
b = flags.testFlag(Qt::WindowContextHelpButtonHint);
setWindowFlags(flags);Any help (no pun intended) appreciated
-
When does this "?" button comes ? I tried on the Windows and MAC with default Qt Widget application. I did not see the "?" button. I'm curious.
-
Using QT 5.9 ... code below works if using QDialog but not QWidget
I have experimented with various window type and flags combinations and can't seem to remove the infamous "What's this button"constructor is
QWidget(parent, (Qt::Window | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint))...
// Remove the context help button (?).
Qt::WindowFlags flags = windowFlags();
flags = (flags & ~Qt::WindowContextHelpButtonHint);
b = flags.testFlag(Qt::WindowContextHelpButtonHint);
setWindowFlags(flags);Any help (no pun intended) appreciated
hi @esther
have you also set the Qt::CustomizeWindowHint flag in your attemps ? I don't know if it will accept any flag changing without that one set first. -
@J-Hilk just curious. Where is this button ? It may be my oversight.
-
@J-Hilk just curious. Where is this button ? It may be my oversight.
@dheerendra
afaik it's not part of the default window, but it exists.
Example: -
hi @esther
have you also set the Qt::CustomizeWindowHint flag in your attemps ? I don't know if it will accept any flag changing without that one set first.
1/6