| 152 | } |
| 153 | |
| 154 | void MainWidget::showAboutDialog() |
| 155 | { |
| 156 | QMessageBox about; |
| 157 | |
| 158 | about.setText(QString("Qcma ") + QCMA_VER); |
| 159 | about.setWindowTitle(tr("About Qcma")); |
| 160 | #ifndef QCMA_BUILD_HASH |
| 161 | about.setInformativeText(tr("Copyright (C) 2016 Codestation") + "\n"); |
| 162 | #else |
| 163 | about.setInformativeText(tr("Copyright (C) 2016 Codestation\n\nbuild hash: %1\nbuild branch: %2").arg(QCMA_BUILD_HASH).arg(QCMA_BUILD_BRANCH)); |
| 164 | #endif |
| 165 | about.setStandardButtons(QMessageBox::Ok); |
| 166 | about.setIconPixmap(QPixmap(":/main/resources/images/qcma.png")); |
| 167 | about.setDefaultButton(QMessageBox::Ok); |
| 168 | |
| 169 | // hack to expand the messagebox minimum size |
| 170 | QSpacerItem* horizontalSpacer = new QSpacerItem(300, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); |
| 171 | QGridLayout* widget_layout = (QGridLayout*)about.layout(); |
| 172 | widget_layout->addItem(horizontalSpacer, widget_layout->rowCount(), 0, 1, widget_layout->columnCount()); |
| 173 | |
| 174 | about.show(); |
| 175 | about.exec(); |
| 176 | } |
| 177 | |
| 178 | void MainWidget::showAboutQt() |
| 179 | { |