summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2011-06-19 18:55:38 +0200
committerJonathan Bauer2011-06-19 18:55:38 +0200
commit4144df4c66922a077f9d4d539aea56b105285306 (patch)
treec2a7e1159ab086e3a58ec49d64c6f2ce1708e2b0
parentnew UI, old code cleanup (diff)
downloadfbsplash-4144df4c66922a077f9d4d539aea56b105285306.tar.gz
fbsplash-4144df4c66922a077f9d4d539aea56b105285306.tar.xz
fbsplash-4144df4c66922a077f9d4d539aea56b105285306.zip
simplified things
-rw-r--r--src/fbsplash.cpp12
-rw-r--r--src/fbsplash.h3
-rw-r--r--src/main.cpp9
3 files changed, 7 insertions, 17 deletions
diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp
index 314a597..e9592f9 100644
--- a/src/fbsplash.cpp
+++ b/src/fbsplash.cpp
@@ -2,11 +2,8 @@
#include "fbsplash.h"
#include "ui_fbsplash.h"
-
fbsplash::fbsplash(QWidget *parent) :
- QWidget(parent), ui(new Ui::fbsplash){
-
- qDebug() << "fbsplash init";
+ QWidget(parent), ui(new Ui::fbsplash) {
ui->setupUi(this);
@@ -14,7 +11,7 @@ fbsplash::fbsplash(QWidget *parent) :
//setupTheme();
}
-fbsplash::~fbsplash(){
+fbsplash::~fbsplash() {
delete ui;
}
//-----------------------------------------------------------------------------
@@ -24,9 +21,10 @@ void fbsplash::setupTheme() {
}
//-----------------------------------------------------------------------------
void fbsplash::createActions() {
- // Quit through CTRL + X
+ // For testing: quit through CTRL + X
_quit = new QAction(tr("&quit"), this);
_quit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X));
this->addAction(_quit);
- connect(_quit, SIGNAL(triggered()), parent(), SLOT(close()));
+ connect(_quit, SIGNAL(triggered()), this, SLOT(close()));
+ // per default, QT closes the app when the last widget is closed
}
diff --git a/src/fbsplash.h b/src/fbsplash.h
index 896916d..69ef69a 100644
--- a/src/fbsplash.h
+++ b/src/fbsplash.h
@@ -15,14 +15,11 @@
#define FBSPLASH_H
#include <QtGui>
-#include "ui_fbsplash.h"
-
namespace Ui {
class fbsplash;
}
-
class fbsplash: public QWidget {
Q_OBJECT
diff --git a/src/main.cpp b/src/main.cpp
index 442c3ea..13947fb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,13 +7,8 @@ int main(int argc, char *argv[]) {
app.setOrganizationName("OpenSLX");
app.setApplicationName("fbsplash");
- QMainWindow mw;
- fbsplash bs(&mw);
-
- mw.setCentralWidget(&bs);
- mw.setAttribute(Qt::WA_QuitOnClose, true);
- mw.setWindowFlags(Qt::FramelessWindowHint);
- mw.showFullScreen();
+ fbsplash bs;
+ bs.showFullScreen();
app.exec();
}