-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (28 loc) · 1.19 KB
/
Copy pathmain.cpp
File metadata and controls
35 lines (28 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <QApplication>
#include <QIcon>
#include "MainWindow.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
// QSettings (used to persist the Settings dialog's preferences)
// needs an organization/application name to know where to store
// its data (registry key on Windows, .conf file on Linux/macOS).
QApplication::setOrganizationName("WinSQLite");
QApplication::setApplicationName("WinSQLite");
// Sets the icon used for the title bar / taskbar / alt-tab switcher.
// Comes from app.qrc, which embeds resources/app_icon.png - on
// Windows, resources/winsqlite.rc separately embeds an .ico into the
// .exe itself, so Explorer shows the right icon before the app even
// runs.
app.setWindowIcon(QIcon(":/resources/app_icon.png"));
MainWindow window;
// Optional convenience: still allow launching with a database path
// as an argument (e.g. a file association or a shell script), but
// it's no longer required - Database > Open/New in the menu bar
// covers the interactive case.
if (argc > 1) {
window.openDatabase(QString::fromLocal8Bit(argv[1]));
}
window.show();
return app.exec();
}