diff options
author | Topi Reinio <topi.reinio@digia.com> | 2014-01-29 11:20:03 +0100 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@digia.com> | 2014-01-30 13:30:51 +0200 |
commit | b2957ef0efbf55872d36762705b62822cc828cf3 (patch) | |
tree | 84315730ce266b35360b7bc5730df1b05922c366 /basicsuite/shared/main.cpp | |
parent | 274baa15819458003555749d4e0509ac665f8526 (diff) |
Enable virtual keyboard when building demos stand-alone
Add a shared QML file that defines an InputPanel and loads
the main QML for each demo. Also,
- Do not define QT_IM_MODULE (set already in the system)
- Improved exclude file parsing to match b2qt-launcher
Change-Id: Ibdd0371a57878ef7bc585aa67fcd148377f54bc6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'basicsuite/shared/main.cpp')
-rw-r--r-- | basicsuite/shared/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp index 748b22a..ac2fba4 100644 --- a/basicsuite/shared/main.cpp +++ b/basicsuite/shared/main.cpp @@ -22,6 +22,7 @@ #include <QtGui/QFontDatabase> #include <QtGui/QScreen> #include <QtGui/QPalette> +#include <QtCore/QRegExp> #include <QtQuick/QQuickView> @@ -34,7 +35,7 @@ int main(int argc, char **argv) { - qputenv("QT_IM_MODULE", QByteArray("b2qtinputcontext")); + //qputenv("QT_IM_MODULE", QByteArray("qtvkb")); QGuiApplication app(argc, argv); QString path = app.applicationDirPath(); @@ -49,7 +50,7 @@ int main(int argc, char **argv) QString target = qgetenv("B2QT_BASE") + "-" + qgetenv("B2QT_PLATFORM"); QFile excludeFile(path + QStringLiteral("/exclude.txt")); if (excludeFile.open(QFile::ReadOnly)) { - const QStringList excludeList = QString::fromUtf8(excludeFile.readAll()).split(":"); + const QStringList excludeList = QString::fromUtf8(excludeFile.readAll()).split(QRegExp(":|\\s+")); if (excludeList.contains(target)) qDebug("Warning: This example may not be fully functional on this platform"); excludeFile.close(); @@ -73,7 +74,7 @@ int main(int argc, char **argv) view.rootContext()->setContextProperty("engine", &engine); view.setColor(Qt::black); view.setResizeMode(QQuickView::SizeRootObjectToView); - view.setSource(QUrl::fromLocalFile(path + QStringLiteral("/main.qml"))); + view.setSource(QUrl::fromLocalFile(path + QStringLiteral("/loader.qml"))); view.show(); app.exec(); |