1

I want to test some code with older version of QtQuick, how can I import a specific version?

I read here that the import statement is only asking for a minimum version, but that the environment will provide the latest. I don't know how to verify this, nor to check which lib version my program is actually running with.

I am using QtCreator and .pro file.

ymoreau
  • 3,402
  • 1
  • 22
  • 60

2 Answers2

3

You can write the exact version of import libraries:

import QtQuick.Controls 1.1
 import QtQuick.Controls 2.0 as QC2
 MainWindow{
    Button {
        id: oldButton
    }
    QC2.Button {
        id: newButton
    }
}
  • Good idea, but I still don't know what version I am getting. Using the debug `QML_IMPORT_TRACE` shows me that both imports are using the same path in my Qt installation `...5.9.3/gcc_64/qml/QtQuick.2/qmldir` without any warning, and I have no clue if my imports of 2.0 and 2.9 have included different libs or not. This is working fine for QQuickControls apparently, because the major version is different. – ymoreau Feb 27 '19 at 14:25
0

I think you can not do that. Maybe it is because Qt runtime does not contains every version of QtQuick . So it just use the latest one. So the minor version number is ignored.