21 #include <QPushButton>
22 #include <QVBoxLayout>
26 QLabel* createLinkLabel()
28 auto result =
new QLabel();
29 result->setTextFormat(Qt::RichText);
30 result->setTextInteractionFlags(Qt::TextBrowserInteraction);
31 result->setText(
"<a href=\"http://www.bornagainproject.org\">www.bornagainproject.org</a>");
32 result->setOpenExternalLinks(
true);
36 QLabel* createCopyrightLabel()
38 QDate date = QDate::currentDate();
40 QString(
"Copyright: Forschungszentrum Jülich GmbH ").append(date.toString(
"yyyy"));
42 auto result =
new QLabel(copyright);
43 result->setContentsMargins(0, 0, 0, 15);
47 QLabel* createLogoLabel()
49 QPixmap logo(
":/images/about_icon.awk",
"JPG");
50 auto result =
new QLabel;
51 result->setPixmap(logo.scaled(656, 674, Qt::KeepAspectRatio));
58 QColor bgColor(240, 240, 240, 255);
60 palette.setColor(QPalette::Window, bgColor);
61 setAutoFillBackground(
true);
64 setWindowTitle(
"About BornAgain");
65 setWindowFlags(Qt::Dialog);
67 QHBoxLayout* detailsLayout =
new QHBoxLayout;
71 QVBoxLayout* mainLayout =
new QVBoxLayout;
72 mainLayout->addLayout(detailsLayout);
75 setLayout(mainLayout);
80 auto result =
new QVBoxLayout;
82 QPixmap logo(
":/images/about_icon.png");
83 auto label =
new QLabel;
84 label->setPixmap(logo.scaled(120, 120, Qt::KeepAspectRatio));
86 result->addWidget(label);
87 result->addStretch(1);
88 result->setContentsMargins(5, 5, 5, 5);
95 auto result =
new QVBoxLayout;
99 titleFont.setBold(
true);
103 normalFont.setBold(
false);
106 auto aboutTitleLabel =
108 aboutTitleLabel->setFont(titleFont);
109 aboutTitleLabel->setContentsMargins(0, 0, 0, 15);
112 auto copyrightLabel = createCopyrightLabel();
113 copyrightLabel->setFont(normalFont);
116 QString description =
"A software to simulate and fit grazing-incidence small-angle "
117 "scattering (GISAS) using distorted wave Born approximation (DWBA).";
118 auto descriptionLabel =
new QLabel(description);
119 descriptionLabel->setFont(normalFont);
120 descriptionLabel->setWordWrap(
true);
122 result->addWidget(aboutTitleLabel);
123 result->addWidget(descriptionLabel);
124 result->addStretch(1);
125 result->addWidget(copyrightLabel);
126 result->addWidget(createLinkLabel());
127 result->addStretch(1);
128 result->setContentsMargins(0, 5, 5, 5);
135 auto result =
new QHBoxLayout;
137 auto closeButton =
new QPushButton(
"Close");
138 connect(closeButton, &QPushButton::clicked,
this, &QDialog::reject);
140 result->addStretch(1);
141 result->addWidget(closeButton);
143 static const char mydata[] = {0x64, 0x65, 0x76, 0x73};
144 QByteArray b = QByteArray::fromRawData(mydata,
sizeof(mydata));
147 installEventFilter(f);
Defines classes releted to event filtering.
Defines class DesignerHelper.
Defines class GUIHelpers functions.
Defines class AboutApplicationDialog.
QBoxLayout * createButtonLayout()
AboutApplicationDialog(QWidget *parent=0)
QBoxLayout * createLogoLayout()
QBoxLayout * createTextLayout()
static int getLabelFontSize()
Event filter for global tracking of shortcodes.
QString getBornAgainVersionString()