Frage

I'm using QtQuick2 of QT 5.1.1

When I try to include and use the QML Elem FileDialog like described here I just get Unkown component (M300)

If I hover over import QtQuick.Dialogs 1.0 it says "library at: OS-PATH/qml/QtQuick/Dialogs" but in this folder is only a DefaultFileDialog.qml some other stuff but no FileDialog.qml.

So is there any reason why my QT installation doesn't provide this QML type? How can I import it?

Thanks in advance.

War es hilfreich?

Lösung

have a look here, just ignore the error message. it works for me! https://qt-project.org/doc/qt-5.1/qtquickdialogs/systemdialogs-filedialogs-qml.html

Andere Tipps

There is no "FileDialog.qml" at all in QtQuick since the FileDialog is implemented in C++ and exported to QML.

Make sure to

import QtQuick 2.0
import QtQuick.Dialogs 1.0

Last but not least, ignore the warning given by QT Creator. In my case, FileDialog works perfctly but QTCreator does not know about it.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top