Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#include "textedit.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QCommandLineOption>
|
||||
#include <QScreen>
|
||||
#include <QDebug>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//Q_INIT_RESOURCE(textedit);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
// QCoreApplication::setOrganizationName("QtProject");
|
||||
// QCoreApplication::setApplicationName("Rich Text");
|
||||
// QCoreApplication::setApplicationVersion(QT_VERSION_STR);
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QCoreApplication::applicationName());
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
parser.addPositionalArgument(QStringLiteral("file"), QStringLiteral("The file to open."));
|
||||
parser.process(a);
|
||||
|
||||
TextEdit mw;
|
||||
|
||||
const QRect availableGeometry = mw.screen()->availableGeometry();
|
||||
mw.resize(availableGeometry.width() / 2, (availableGeometry.height() * 2) / 3);
|
||||
mw.move((availableGeometry.width() - mw.width()) / 2,
|
||||
(availableGeometry.height() - mw.height()) / 2);
|
||||
|
||||
if (!mw.load(parser.positionalArguments().value(0, QStringLiteral(":/example.html"))))
|
||||
mw.fileNew();
|
||||
|
||||
mw.show();
|
||||
return a.exec();
|
||||
}
|
||||
Reference in new issue
Block a user