Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit fd8283c

Browse files
committed
add notes for QTBUG-69963
1 parent 133664d commit fd8283c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

ProjectTemplate/quick_main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ int main(int argc, char *argv[])
1010
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
1111
// If you want to support file dialogs on platforms other then android, use a QApplication instead (and add QT += widgets to the pro file)
1212
QGuiApplication app(argc, argv);
13-
13+
14+
QtMvvm::QuickPresenter::getInputViewFactory(); //Workaround for QTBUG-69963
1415
qmlRegisterUncreatableType<%{VmCn}>("com.example.%{ProjectLowerName}", 1, 0, "%{VmCn}", "ViewModels cannot be created!");
1516

1617
QQmlApplicationEngine engine;

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ Follow the setup to create the project. You can select the GUI-frontends you wan
115115

116116
For more Details on these classes, check the [Documentation](https://skycoder42.github.io/QtMvvm/).
117117

118+
**Important:** Due to [QTBUG-69963](https://bugreports.qt.io/browse/QTBUG-69963), you must always link to QtMvvmQuick when creating a QtQuick application for windows (See Issue #1). Since windows optimizes library and only links them if referenced at least once, simply add the line
119+
```.cpp
120+
QtMvvm::QuickPresenter::getInputViewFactory(); //Workaround for QTBUG-69963
121+
```
122+
to your `main.cpp` and it should work as expected
123+
118124
### Adding new ViewModels and Views
119125
The most important part is to know how to add new ViewModels and Views.
120126

examples/mvvmquick/SampleQuick/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ int main(int argc, char *argv[])
2828
QApplication app(argc, argv);
2929
qDebug() << QQuickStyle::availableStyles() << QQuickStyle::name();
3030

31+
QtMvvm::QuickPresenter::getInputViewFactory(); //Workaround for QTBUG-69963
3132
coreApp->setShowDrawer(true);
3233

3334
qmlRegisterUncreatableType<SampleViewModel>("de.skycoder42.QtMvvm.Sample", 1, 1, "SampleViewModel", QStringLiteral("ViewModels cannot be created"));

0 commit comments

Comments
 (0)