Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

QtQuickView doesn't work inside of a QtCreator plugin

$
0
0
Hello, I am trying to insert a QQuickView that is mapped in a QWidget after calling createWindowContainer into a QVBoxLayout which is used after that in a DesignWidget. This DesignWidget will be displayed when Design button from QtCreator is pressed for a specific file. The code is like this: QSplitter * const outputPaneSplitter = new Core::MiniSplitter(this); outputPaneSplitter->setOrientation(Qt::Vertical);   QWidget * const centralWidget = new QWidget(outputPaneSplitter); QVBoxLayout *const centralWidgetLayout = new QVBoxLayout(centralWidget); centralWidgetLayout->setMargin(0); centralWidgetLayout->setSpacing(0);   QQuickView *view = new QQuickView(QUrl("qrc:///resources/example.qml"),0);   QWidget root;   QWidget *container = QWidget::createWindowContainer(view,&root);   container->setGeometry(50,50,200,300);   container->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);   container->setFocusPolicy(Qt::StrongFocus);   centralWidgetLayout->addWidget(container); Is it possible to do something like this, I mean to have at first a new instance for QQuickView inside of a class derived from QWidget and after that to add the widget where the view is mapped inside of a QVBoxLayout? The errors are displayed bellow and from what I can see it is not possible to create a QQuickView inside of a class that is derived from QWidget. I have taken the last commit from gitorius regarding the static QWidget *createWindowContainer(QWindow *window, QWidget *parent=0, Qt::WindowFlags flags=0) https://codereview.qt-project.org/#change,44285 [codereview.qt-project.org] and placed it inside of Qt5.0.0 and build it. Simple examples that use the QQuickView are working only this part where QQuickView is created inside of a QWidget class is not. Should I take all the sources from development branch of gitorious for Qt5.1? Did I miss something if I have taken only the task with createWIndowContainer? These are the errors received when plugin is loading: 0 QQmlNotifierEndpoint::isNotifying qqmlnotifier_p.h 219 0xaf2aee64 1 QQmlNotifier::emitNotify qqmlnotifier.cpp 69 0xaf35bb41 2 QQmlData::signalEmitted qqmlengine.cpp 597 0xaf2b2cd6 3 QMetaObject::activate qobject.cpp 3334 0xb70411ae 4 QMetaObject::activate qobject.cpp 3316 0xb70410e4 5 QDeclarativeRepeater::delegateChanged moc_qdeclarativerepeater_p.cpp 299 0xb52cf96b 6 QDeclarativeRepeater::setDelegate qdeclarativerepeater.cpp 291 0xb525f6ec 7 QDeclarativeRepeater::qt_metacall moc_qdeclarativerepeater_p.cpp 266 0xb52cf86e 8 QMetaObject::metacall qmetaobject.cpp 307 0xb700ed8a 9 QDeclarativeVME::run qdeclarativevme.cpp 653 0xb50c7366 10 QDeclarativeVME::run qdeclarativevme.cpp 133 0xb50c4ee8 11 QDeclarativeComponentPrivate::begin qdeclarativecomponent.cpp 872 0xb50bbc6d 12 QDeclarativeCompiledData::TypeReference::createInstance qdeclarativevme.cpp 1079 0xb50c978a 13 QDeclarativeVME::run qdeclarativevme.cpp 228 0xb50c5405 14 QDeclarativeVME::run qdeclarativevme.cpp 133 0xb50c4ee8 15 QDeclarativeComponentPrivate::begin qdeclarativecomponent.cpp 872 0xb50bbc6d 16 QDeclarativeComponentPrivate::beginCreate qdeclarativecomponent.cpp 837 0xb50bbad1 17 QDeclarativeComponent::beginCreate qdeclarativecomponent.cpp 799 0xb50bb837 18 QDeclarativeComponent::create qdeclarativecomponent.cpp 768 0xb50bb7c0 19 QDeclarativeView::continueExecute qdeclarativeview.cpp 552 0xb519b163 20 QDeclarativeViewPrivate::execute qdeclarativeview.cpp 175 0xb519a205 21 QDeclarativeView::setSource qdeclarativeview.cpp 339 0xb519a6af 22 Welcome::Internal::WelcomeMode::initPlugins welcomeplugin.cpp 283 0xaddbe66d 23 Welcome::Internal::WelcomePlugin::extensionsInitialized welcomeplugin.cpp 378 0xaddbee5a 24 ExtensionSystem::Internal::PluginSpecPrivate::initializeExtensions pluginspec.cpp 1008 0xb7fe0c69 25 ExtensionSystem::Internal::PluginManagerPrivate::loadPlugin pluginmanager.cpp 1090 0xb7fd64a5 26 ExtensionSystem::Internal::PluginManagerPrivate::loadPlugins pluginmanager.cpp 973 0xb7fd5644 27 ExtensionSystem::PluginManager::loadPlugins pluginmanager.cpp 326 0xb7fd2695 28 main main.cpp 486 0×8053215 I am using Qt5.0.0 with createWindowContainer commit inside of QT and QtCreator.2.6.1 Thank you very much for your help!

Viewing all articles
Browse latest Browse all 4972

Trending Articles