mirror of
https://github.com/epasveer/seer.git
synced 2026-08-30 00:50:42 +08:00
79f243c198
Added icons for more buttons. Changed About dialog to load text from a resource. Incremented version number preparing for the next release.
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
#include "SeerAboutDialog.h"
|
|
#include "SeerUtl.h"
|
|
#include <QtGui/QColor>
|
|
#include <QtGui/QPalette>
|
|
#include <QtCore/QFile>
|
|
#include <QtCore/QTextStream>
|
|
|
|
SeerAboutDialog::SeerAboutDialog (QWidget* parent) : QDialog(parent) {
|
|
|
|
// Set up the UI.
|
|
setupUi(this);
|
|
|
|
// Setup the widgets
|
|
|
|
// Add the Version number to the beggining of the About text.
|
|
textEdit->moveCursor (QTextCursor::Start);
|
|
textEdit->setText ("\n");
|
|
textEdit->append ("Version: " + Seer::version());
|
|
|
|
// Add the About text from the resource.
|
|
QFile file(":/seer/resources/about.txt");
|
|
file.open(QFile::ReadOnly | QFile::Text);
|
|
|
|
QTextStream stream(&file);
|
|
textEdit->append(stream.readAll());
|
|
|
|
textEdit->moveCursor (QTextCursor::Start);
|
|
|
|
// Set the TextEdit's background to the same as the window's.
|
|
QColor windowColor = palette().color(QWidget::backgroundRole());
|
|
|
|
QPalette p = textEdit->palette();
|
|
p.setColor(QPalette::Base, windowColor);
|
|
textEdit->setPalette(p);
|
|
}
|
|
|
|
SeerAboutDialog::~SeerAboutDialog () {
|
|
}
|
|
|