Engauge Digitizer 2
Loading...
Searching...
No Matches
ButtonWhatsThis.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2020 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include "ButtonWhatsThis.h"
8#include <QStyleOptionButton>
9
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}
ButtonWhatsThis(QWidget *parent=0)
Single constructor.