Skip to content

Commit

Permalink
feat: set application base infos
Browse files Browse the repository at this point in the history
Change-Id: I56433844bf169c836b29d53de61db0907e27c5a8
  • Loading branch information
justforlxz committed Jan 31, 2018
1 parent e985fc2 commit 6701186
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
23 changes: 20 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,30 @@
*/

#include "mainwindow.h"
#include <QApplication>

#include <DApplication>
#include <QDebug>

DWIDGET_USE_NAMESPACE

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
DApplication::loadDXcbPlugin();
DApplication a(argc, argv);
a.setApplicationName("dde-introduction");

if (!a.setSingleInstance(a.applicationName(), DApplication::UserScope)) {
qWarning() << QString("There is a %1 running!!").arg(a.applicationName());
return -1;
}

a.setOrganizationName("deepin");
a.setApplicationVersion(DApplication::buildVersion("1.0"));
a.loadTranslator();

MainWindow w;
w.show();
w.moveToCenter();
w.exec();

return a.exec();
}
4 changes: 3 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
*/

#include "mainwindow.h"
#include <QHBoxLayout>

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
: DDialog(parent)
{

}

MainWindow::~MainWindow()
Expand Down
6 changes: 4 additions & 2 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <ddialog.h>

class MainWindow : public QMainWindow
DWIDGET_USE_NAMESPACE

class MainWindow : public DDialog
{
Q_OBJECT

Expand Down

0 comments on commit 6701186

Please sign in to comment.