Radium Engine  1.5.20
Loading...
Searching...
No Matches
AboutDialog.cpp
1#include <Gui/AboutDialog/AboutDialog.hpp>
2#include <QFile>
3#include <QPushButton>
4
5#include "ui_AboutDialog.h"
6
7namespace Ra {
8namespace Gui {
9AboutDialog::AboutDialog( QWidget* parent ) : QDialog( parent ), ui( new Ui::AboutDialog ) {
10 ui->setupUi( this );
11 ui->radiumText->setFocusPolicy( Qt::NoFocus );
12 auto file = QFile( ":/about.html" );
13 if ( file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
14 auto text = file.readAll();
15 ui->radiumText->setText( text );
16 }
17 auto btn = ui->aboutbuttons->button( QDialogButtonBox::Close );
18 btn->setFocus();
19 btn->setAutoDefault( true );
20 btn->setDefault( true );
21 auto settingsBtn = new QPushButton( "Settings", ui->aboutbuttons );
22 ui->aboutbuttons->addButton( settingsBtn, QDialogButtonBox::RejectRole );
23 settingsBtn->setAutoDefault( false );
24 settingsBtn->setDefault( false );
25 connect( settingsBtn, &QPushButton::pressed, this, &AboutDialog::settings );
26 btn = ui->aboutbuttons->button( QDialogButtonBox::Help );
27 btn->setAutoDefault( false );
28 btn->setDefault( false );
29 connect( btn, &QPushButton::pressed, this, &AboutDialog::help );
30}
31
32AboutDialog::~AboutDialog() {
33 delete ui;
34}
35
36} // namespace Gui
37} // namespace Ra
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3