Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. GUI design - how to properly activate "whats this" help
Forum Update on Monday, May 27th 2025

GUI design - how to properly activate "whats this" help

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PetQter
    wrote on last edited by
    #1

    Hello,
    I have GUI app with standard menus and context menus - activated by right-click. No toolbars.
    I want to add some help in form of tooltips or statusTips or "whats this":. I think the last one is the most suitable for this app.
    I can do it with help of enterWhatsThis() .
    Question is:
    I cannot use standard Whats This button in title bar because it is designed only for dialogs and problem to add it in QMainWindow derivates or in docks.
    But in some Windows applications I see small blue button with question mark near of minimize in main window title, probably it is not multiplatform standard.

    How you design activation of "Whats This" help in QMainWindow derived class ?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Well shift+F1 hovering mouse cursor over a widget Widgets will shows its WhatisThis property.
      Also works on QMenu items so should also works on context menu although i didnt test it.

      You can use
      setWindowFlags(Qt::Window | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint);
      to set it on a MainWindow type window, but it wont have min/max then.
      Its not supported on/by Windows.

      alternatively , add it to status bar.

      auto button = new QPushButton("?");
        button->setMaximumSize(32, 32);
        connect( button, &QPushButton::clicked, []() {
          QWhatsThis::enterWhatsThisMode();
        } );
        ui->statusBar->addPermanentWidget( button );
      

      Works quite well.

      alt text

      --

      Normally people use tooltips which is supported in most places/types of windows.
      Adding a button to the titlebar is not possible with Qt. (alone)

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved