Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KXMLGUI
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • KXMLGUI
  • Merge requests
  • !139

Prevent duplicate "Whats This?" tooltips, and prevent closing non-expandable tooltips

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Joshua Goins requested to merge work/redstrate/remove-duplicate-whatsthis into master Jan 11, 2023
  • Overview 32
  • Commits 2
  • Pipelines 14
  • Changes 3

Some actions or widgets have useless "Whats This?" tooltips that are duplicated from their regular tooltips. New logic is added to hide these when detected.

I'm not familiar with KXMLGUI's codebase at all, so please see the "Tasks & Feedback" section.

Problem

Currently, some actions (and also now menu items, with !45 (merged)) have expandable tooltip text that is useless. A good example is libkdegames, which a lot of KDE games are based off of - set the "Whats This?" text of something like "New Game" with "Start a new game." with the tooltip text of "Start a new game"

Yeah, real helpful :-) We could manually patch every single place where this happens, but honestly we should just don't display them. We already work around QAction tooltips which are identical to their icon names, after all.

Explanation

  • We need some way to detect whether or not tooltip text and whats this text is the same, the process is identical as hasExplicitToolTip, hence hasExplicitWhatsThis
  • We also need to track whether or not the last tooltip was expandable before interrupting key inputs (for Shift to expand the tooltip) thus m_lastToolTipWasExpandable.
  • A workaround must be applied for QToolButton items, because we explicitly set their tooltip to include the shortcut. That's why hasUniqueTooltip is set again on line 213.

Tasks and Feedback

  • Consolidate hasExplicitToolTip and hasExplicitWhatsThis because they are just duplicate functions.
  • Is there a better way to determine whether or not the last tooltip was expandable at the handleKeyPressEvent call site? I couldn't find any, and you can even see pressing shift actually closes non-whats this tooltips without this MR.
  • The first non-whats this menu tooltip you hover can still be closed. I'm not sure why, just a minor nagging bug.
Edited Jan 14, 2023 by Joshua Goins
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/redstrate/remove-duplicate-whatsthis