Engauge Digitizer 2
Loading...
Searching...
No Matches
ButtonWhatsThis Class Reference

Unobtrusive button to trigger QWhatsThis since some operating systems (Linux Mint) do not show WhatsThis button in title bar. More...

#include <ButtonWhatsThis.h>

Inheritance diagram for ButtonWhatsThis:
Inheritance graph
Collaboration diagram for ButtonWhatsThis:
Collaboration graph

Public Member Functions

 ButtonWhatsThis (QWidget *parent=0)
 Single constructor.

Detailed Description

Unobtrusive button to trigger QWhatsThis since some operating systems (Linux Mint) do not show WhatsThis button in title bar.

A complication is that the size must be minimized explicitly to remove a large amount of padding, but in a manner that reliably works with various system font sizes

Definition at line 15 of file ButtonWhatsThis.h.

Constructor & Destructor Documentation

◆ ButtonWhatsThis()

ButtonWhatsThis::ButtonWhatsThis ( QWidget * parent = 0)

Single constructor.

Definition at line 10 of file ButtonWhatsThis.cpp.

10 :
11 QPushButton ("?", parent)
12{
13 auto textSize = fontMetrics().size (Qt::TextShowMnemonic,
14 text());
15 QStyleOptionButton opt;
16 opt.initFrom (this);
17 opt.rect.setSize (textSize);
18 setMinimumSize (style()->sizeFromContents (QStyle::CT_PushButton,
19 &opt,
20 textSize,
21 this));
22 setMaximumSize (style()->sizeFromContents (QStyle::CT_PushButton,
23 &opt,
24 textSize,
25 this));
26}

The documentation for this class was generated from the following files: