2

I am trying to learn Qt version 6, and I'm at a point where my book has me importing QtQuick Controls. The book says to click on the "Imports tab" in the Library pane, and shows a screenshot containing the tab. (Virtually every web source I've been able to find says the same thing, with a similar screenshot.)

Unfortunately, my installation of Qt-Creator, version 4.15.1, installed with Qt 6, does not have an Imports tab on the library pane. This is what my Library pane looks like: Screenshot of Library pane

Yes, it appears that the controls have been imported, but I didn't do it through the UI, it happened during an experiment. What got the controls imported was:

  1. I hand-edited the .ui.qml file to add the line
import QtQuick.Controls 2.4
  1. I built the project

This resulted in the QtQuick controls appearing in the Library pane.

Surely this is not the normal way of importing controls, is it?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
jkb
  • 2,376
  • 1
  • 9
  • 12

1 Answers1

0

If I'm understanding correctly, you want Qt Design Studio to import modules for you from the UI.

Simply click here then:
enter image description here


Also, if your project was made with Qt6, there's no need to add the version in the import statement.

I hope I was of any help :)

E-Berry
  • 45
  • 4
  • Thanks for your response. I would indeed like to import modules through the UI. The mechanism laid out in the book I was using clearly does not work since there is no "Imports" tab in the UI. Unfortunately clicking on the plus sign you reference simply results in a components window that is empty except for the text __Select a Module to Add__, There are no listed modules from which to select. – jkb Mar 30 '22 at 19:56