-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (36 loc) · 1.34 KB
/
main.cpp
File metadata and controls
49 lines (36 loc) · 1.34 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <QtGui>
#include <QtSql>
#include <QApplication>
#include <QDebug>
#include "mainwindow.h"
#include "strutil.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QApplication::setApplicationName("ExampleApp");
QApplication::setApplicationVersion("1.0");
QApplication::setOrganizationName("My Business");
QApplication::setOrganizationDomain("www.example.com.py");
QTranslator translator;
translator.load(app.applicationName() + "_" + QLocale::system().name(), ":/ts");
app.installTranslator(&translator);
app.setStyleSheet(QString(
" QLineEdit,QSpinBox"
" { background-color: #fff; color: #808080; }"
" QLineEdit:focus,QSpinBox:focus"
" { background-color: #FFFACD; color: #222222; }"
));
QStringList lista = QSqlDatabase::drivers();
if(!lista.contains("QPSQL"))
{
QMessageBox::critical(0,
QString("%1 %2").arg(app.applicationName()).arg(app.applicationVersion()),
QObject::tr("El controlador PostgreSQL no esta disponible.\nNo es posible continuar."));
exit(1);
}
MainWindow *w = new MainWindow;
w->show();
int ret = app.exec();
delete w;
return ret;
}