-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not it is responsible for creating a main window.
- Loading branch information
Showing
5 changed files
with
56 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "application.h" | ||
|
||
#include "ui/mainwindow.h" | ||
|
||
using namespace Zeal; | ||
using namespace Zeal::Core; | ||
|
||
Application::Application(const QString &query, QObject *parent) : | ||
QObject(parent), | ||
m_mainWindow(new MainWindow()) | ||
{ | ||
if (!query.isEmpty()) | ||
m_mainWindow->bringToFrontAndSearch(query); | ||
else if (!m_mainWindow->startHidden()) | ||
m_mainWindow->show(); | ||
} | ||
|
||
Application::~Application() | ||
{ | ||
|
||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef APPLICATION_H | ||
#define APPLICATION_H | ||
|
||
#include <QObject> | ||
|
||
class MainWindow; | ||
|
||
namespace Zeal { | ||
namespace Core { | ||
|
||
class Application : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit Application(const QString &query = QString(), QObject *parent = nullptr); | ||
~Application() override; | ||
|
||
signals: | ||
|
||
public slots: | ||
|
||
private: | ||
MainWindow *m_mainWindow; | ||
}; | ||
|
||
} // namespace Core | ||
} // namespace Zeal | ||
|
||
#endif // APPLICATION_H |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
HEADERS += $$files($$PWD/*.h) | ||
SOURCES += $$files($$PWD/*.cpp) |
This file contains 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
This file contains 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