Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of "?" buttons in windows titles #367

Open
Neustradamus opened this issue May 10, 2018 · 24 comments
Open

Get rid of "?" buttons in windows titles #367

Neustradamus opened this issue May 10, 2018 · 24 comments
Assignees

Comments

@Neustradamus
Copy link
Contributor

Neustradamus commented May 10, 2018

Some windows have "?" but it is nothing.

It is possible to remove it?

  • Useful Tips
  • About
  • About ... Plugin
  • Psi+: Proxy Profiles
  • Secret Key
  • Psi+ Import history
  • Psi+: Delete Profile
  • Psi+: Key Storage Diagnostic Text
  • Psi+: Manage Profiles
  • Psi+: New Profile
  • Psi+: Open Profile
  • Psi+: Proxy Profiles
  • Psi+: ReadMe
  • Psi+: Rename Profile
  • Psi+: Security Plugins Diagnostic Text
  • Iconset Details
  • ...
@Ri0n
Copy link
Member

Ri0n commented May 10, 2018

I guess it's about Qt::WindowContextHelpButtonHint

@Ri0n
Copy link
Member

Ri0n commented May 10, 2018

It seems removing this button is something complicated and not standard.
see this https://stackoverflow.com/questions/41585596/remove-windowsystemmenuhint-from-qdialog-in-qt for more details.

I'd prefer not to change anything until it really hurts someone.

@Ri0n Ri0n closed this as completed in 0e5b4ec May 10, 2018
@Ri0n
Copy link
Member

Ri0n commented May 29, 2018

It seems there is a bug in Qt which prevents Qt::AA_DisableWindowContextHelpButton to be working.
While we still can investigate it more deeply, it's a good idea to just report to Qt.

@Neustradamus
Copy link
Contributor Author

@Ri0n
Copy link
Member

Ri0n commented Dec 18, 2018

Last time I checked this Qt::WindowContextHelpButtonHint wa set properly everywhere.

@tehnick tehnick reopened this Dec 18, 2018
@tehnick tehnick changed the title Some windows have "?" but it is nothing Get rid of "?" buttons in windows titles Dec 18, 2018
@Ri0n
Copy link
Member

Ri0n commented Dec 18, 2018

@tehnick , note you will have to remove all WhatsThis also to do this properly.

@tehnick
Copy link
Member

tehnick commented Dec 18, 2018

I propose to move all help data from WhatsThis to ToolTips and get rid of "?" buttons in windows titles. Because WhatsThis functionality is unintuitive for end users and completely contradicts to modern UI ergonomics.

@Ri0n
Copy link
Member

Ri0n commented Dec 18, 2018

I'm fine with that.

@tehnick
Copy link
Member

tehnick commented Dec 20, 2018

BTW, a quotation from Qt docs:
Qt::AA_DisableWindowContextHelpButton -- Disables the WindowContextHelpButtonHint by default on Qt::Sheet and Qt::Dialog widgets. This hides the ? button on Windows, which only makes sense if you use QWhatsThis functionality. This value was added in Qt 5.10. In Qt 6, WindowContextHelpButtonHint will not be set by default.

So it is really time stop usage of WhatsThis.

@Neustradamus
Copy link
Contributor Author

Neustradamus commented Dec 22, 2018

Qt::AA_DisableWindowContextHelpButton disables the default option but not if it is configured in code like:

Normally after it, there will be no more "?".
Example: "About" window
If always here, the Qt::AA_DisableWindowContextHelpButton is not configured for all.

Qt.io doc: https://doc.qt.io/qt-5/qt.html
Qt::AA_DisableWindowContextHelpButton

  • 30
  • Disables the WindowContextHelpButtonHint by default on Qt::Sheet and Qt::Dialog widgets.
    This hides the ? button on Windows, which only makes sense if you use QWhatsThis functionality.
    This value was added in Qt 5.10.
    In Qt 6, WindowContextHelpButtonHint will not be set by default.

@tehnick tehnick mentioned this issue Jan 7, 2019
Closed
@Neustradamus
Copy link
Contributor Author

Please note that AA_DisableWindowContextHelpButton removes "?" from window which has by default but if Qt::WindowContextHelpButtonHint is specified, it does not remove it.

@Neustradamus
Copy link
Contributor Author

Any news after more 1,5 years?

@tehnick
Copy link
Member

tehnick commented Oct 31, 2019

Yep, this PR should be closed.

@Neustradamus
Copy link
Contributor Author

No, there are always "?" in dialog for nothing!

@tehnick
Copy link
Member

tehnick commented Feb 15, 2020

@tehnick
Copy link
Member

tehnick commented Feb 15, 2020

  1. c9f37c0

@tehnick tehnick closed this as completed Feb 15, 2020
@psi-im psi-im deleted a comment from Neustradamus Feb 15, 2020
@tehnick
Copy link
Member

tehnick commented Feb 18, 2020

Ok, some dialogs are not fixed yet...

[19:30:05] <Neustradamus> Tehnick: Examples:
About
Psi+: ReadMe
Psi+: Security Plugins Diagnostic Text
Psi+: Proxy Profiles
Secret Key
Psi+: Key Storage Diagnostic Text
About "Module Name" Plugin
Room configuration
Template editor
MUC room history (and always no minimize/maximize window buttons)

@tehnick tehnick reopened this Feb 18, 2020
@Neustradamus
Copy link
Contributor Author

@tehnick: Any news?

@tehnick
Copy link
Member

tehnick commented Mar 23, 2020

@Neustradamus No.

@Neustradamus
Copy link
Contributor Author

Neustradamus commented Apr 5, 2020

I forgot, several windows, all are:

  • About
  • About "Module Name" Plugin
  • Edit template
  • Execute Command
  • File Transfer
  • Iconset Details
  • MUC room log history (and always no minimize/maximize window buttons)
  • Psi+ Import history
  • Psi+: Delete Profile
  • Psi+: Key Storage Diagnostic Text
  • Psi+: Manage Profiles
  • Psi+: New Profile
  • Psi+: Open Profile
  • Psi+: Proxy Profiles
  • Psi+: ReadMe
  • Psi+: Rename Profile
  • Psi+: Security Plugins Diagnostic Text
  • Room configuration
  • Secret Key
  • Server Authentication
  • Server Settings (for Screenshot plugin)
  • Set GeoLocation
  • Set Mood
  • Stop Spam log history (and always no minimize/maximize window buttons)
  • User Activity
  • Template editor
  • XML Input

@Neustradamus
Copy link
Contributor Author

Neustradamus commented Apr 6, 2020

@tehnick:

By using following code, I can hide the HelpButton:
@ setWindowFlags(((this->windowFlags() | Qt::CustomizeWindowHint)
& ~Qt::WindowContextHelpButtonHint));@
This works fine, too.

dialog->setWindowFlags(dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);

setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

Search on GitHub:

Qt::AA_DisableWindowContextHelpButton

~Qt::WindowContextHelpButtonHint

"Qt::AA_DisableWindowContextHelpButton"

"flags = flags & (~helpFlag);"

"~Qt::WindowContextHelpButtonHint)"

Choices:
1/

// Don't show the context help '?' button in the window bar.
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

2/

Qt::WindowFlags flags = windowFlags();

// remove Help Button of window
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
flags = flags & ( ~helpFlag );
this->setWindowFlags( flags );

3/

Qt::WindowFlags flags = windowFlags();
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;

flags = flags & (~helpFlag);
setWindowFlags(flags);

4/

// remove the ? in the titlebar
Qt::WindowFlags flags = windowFlags();
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
flags = flags & (~helpFlag);
setWindowFlags(flags);

5/

Qt::WindowFlags flags = windowFlags();
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
flags = flags & ( ~helpFlag );
this->setWindowFlags( flags );

6/ Example with Minimize and Maximize buttons

Qt::WindowFlags flags = windowFlags() | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint;
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
flags = flags & (~helpFlag);
setWindowFlags(flags);

7/ Example with Minimize and Maximize buttons

Qt::WindowFlags flags = windowFlags() | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint;
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
flags = flags & ( ~helpFlag );
setWindowFlags( flags );

@Neustradamus
Copy link
Contributor Author

Neustradamus commented Apr 7, 2020

This issue is now solved for Qt 5.10.1 and more before Qt 6.0 with my PR: #508.

For Qt 5.0 >= 5.9.x, and Qt 5.10.0 (bug included) need:

// Don't show the context help '?' button in the window bar.
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants