1 - Are you sure the URL is correct? What is the return value from QQuickView::status()?
2 - You may also need to call view->show() in addition to container->show().
1 - Are you sure the URL is correct? What is the return value from QQuickView::status()?
2 - You may also need to call view->show() in addition to container->show().
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Qt Code:
qDebug() << "status: " << view->status();To copy to clipboard, switch view to plain text mode
is giving me
Qt Code:
status: QQuickView::Status(Error)To copy to clipboard, switch view to plain text mode
I do not know how to print a errors() list. Can you tell me that first?
Obviously your root QML element should also not be a Window type, as that is explicitly for creating a stand alone window.
Btw, there is also QQuickWidget.
Cheers,
_
Having Item{} as qml rootitem works. But I also have a
in main.qml. How to show these buttons using QQuickView?
ToolBar is just a normal element type, you can also position it in your item using anchors.
Cheers,
_
Inside the root Item{} I cannot even show a regular Button. It is not clear to me how to do it. Can you explain a little bit more?
What's the content item of you "ApplicationWindow" element?
Cheers,
_
My ApplicationWindow {} did not have a contentItem, but it is Item {} now, and "contentItem:" is a non-existent property of Item {}. So how to show a Button?
Ok, so you had an empty window with just the ToolBar, I though that you maybe already had some content in your window.
In QtQuick, to show something you only need to instantiate it, potentially provide values for size if it doesn't have an implicit one.
Qt Code:
import QtQuick 2.0 Rectangle { width: 100 height: 100 color: "blue" }To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks