Created
March 30, 2017 08:58
-
-
Save jdu/3ab0989f30928875b10ff6cab8aa9a46 to your computer and use it in GitHub Desktop.
Window issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "loginwindow.h" | |
#include "ui_loginwindow.h" | |
LoginWindow::LoginWindow(QWidget *parent) : | |
QMainWindow(parent), | |
ui(new Ui::LoginWindow) | |
{ | |
ui->setupUi(this); | |
} | |
LoginWindow::~LoginWindow() | |
{ | |
delete ui; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LOGINWINDOW_H | |
#define LOGINWINDOW_H | |
#include <QMainWindow> | |
namespace Ui { | |
class LoginWindow; | |
} | |
class LoginWindow : public QMainWindow | |
{ | |
Q_OBJECT | |
public: | |
explicit LoginWindow(QWidget *parent = 0); | |
~LoginWindow(); | |
private: | |
Ui::LoginWindow *ui; | |
}; | |
#endif // LOGINWINDOW_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mainwindow.h" | |
#include "loginwindow.h" | |
#include <QApplication> | |
#include <QSplashScreen> | |
#include <QSettings> | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
// QPixmap pixmap(":/logo-ewars-android-icon.png"); | |
// QSplashScreen splash(pixmap); | |
// splash.show(); | |
QCoreApplication::setOrganizationName("JDU"); | |
QCoreApplication::setOrganizationDomain("ewars-project.org"); | |
QCoreApplication::setApplicationName("EWARS"); | |
QSettings settings; | |
QString userToken = settings.value("user_token", "NO_USER").toString(); | |
if (userToken == "NO_USER") { | |
LoginWindow w; | |
w.show(); | |
// splash.finish(&w); | |
} else { | |
MainWindow w; | |
w.show(); | |
// splash.finish(&w); | |
} | |
return a.exec(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mainwindow.h" | |
#include "ui_mainwindow.h" | |
#include <QWebEngineView> | |
MainWindow::MainWindow(QWidget *parent) : | |
QMainWindow(parent), | |
ui(new Ui::MainWindow) | |
{ | |
// TODO: Check if there is a token available | |
// TODO: Load up initial data like configuration, etc... | |
// QWebEngineView *view = new QWebEngineView(this); | |
// view->load(QUrl("qrc:/index.html")); | |
// connect(view, SIGNAL(loadFinished(bool)), SLOT(adjustLocation())); | |
// connect(view, SIGNAL(titleChanged(QString)), SLOT(adjustTitle())); | |
// connect(view, SIGNAL(loadProgress(int)), SLOT(setProgress(int))); | |
// connect(view, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool))); | |
// this->setWindowTitle("EWARS"); | |
// setCentralWidget(view); | |
ui->setupUi(this); | |
} | |
MainWindow::~MainWindow() | |
{ | |
delete ui; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MAINWINDOW_H | |
#define MAINWINDOW_H | |
#include <QMainWindow> | |
#include <QWebEngineView> | |
namespace Ui { | |
class MainWindow; | |
} | |
class MainWindow : public QMainWindow | |
{ | |
Q_OBJECT | |
public: | |
explicit MainWindow(QWidget *parent = 0); | |
~MainWindow(); | |
private: | |
Ui::MainWindow *ui; | |
}; | |
#endif // MAINWINDOW_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment