3

I want to build simple Qt Quick application that access filesystem and do some work with files. But Qt Creator behaves strangely.

I used Qt Designer and added a couple of elements in window

Project canvas

Yellow ! sign says: designer warning

But project compiles and runs succesfully. Also i need imports like QtQuick.Dialogs which is imported too, but they do not appear in Designer at all.

I think the reason might be case i described in my answer to own question, but i cannot understand how Maintenance Tool did not install everything.

Maybe i forgot something to check?

I run Ubuntu 16 LTS and use

Qt 5.13.0 and Qt Creator 4.9.2

Qt Maintenance tool

1 Answers1

2

I think you have a Typo in the version number of your import line. Be aware that not all QML modules follow the version numbers of Qt. It's not because you installed Qt5.13 that you will need "import QtQuick.Controls 2.13" You can even use lower version numbers to make your code usable for people with older versions of Qt.

I'm currently on Qt 5.12 LTS and can't check if QtQuick.Controls 2.13 exists. But there is an easy way for you to find out yourself: Go to the import line in the QML file, put the cursor behind the 2. and type CTRL+SPACEBAR All available versions will show up. Pick one that is available and you should be good to go.

Eddy Alleman
  • 1,096
  • 2
  • 10
  • 21
  • Eddy, thank you very much! Problem with `QtQuick.Controls 2.13` is gone (i set it to `2.0` and warning dissapeared). But `QtQuick.Dialogs` still do not appear in toolbox and Qt is silent about it (Ctrl+Space here shows nothing). – nonForgivingJesus Aug 02 '19 at 13:53
  • 1
    Do you have import QtQuick.Dialogs 1.2 ? as a side note if you choose the lowest version number available, you will miss some new functionality. – Eddy Alleman Aug 02 '19 at 14:02
  • yes, i do. I wrote `FileDialog { ... }` in QML itself and Qt chomped file without a choke. But i suppose i should be able to place it on the Form, do i? – nonForgivingJesus Aug 02 '19 at 14:06
  • I suggest to open a new question, because this isn't related to the original question. That will make it easier later on for others to find a solution when they have a similar problem. – Eddy Alleman Aug 02 '19 at 14:12
  • " But i suppose i should be able to place it on the Form, do i?" It is supposed to pop up, let you select a file and remember the filename + path, so you can do your thing with it and then the FileDialog closes. – Eddy Alleman Aug 02 '19 at 14:19
  • Since Qt 5.12 / QtQuick 2.12, the minor version numbers *do* proceed in sync ([source](https://doc.qt.io/qt-5/qtquickcontrols-index.html#versions)). Still, your answer helped – but how and why, I don't know. – tanius Jun 03 '20 at 23:16