Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Design" button grayed out in Qt Creator for QML Project

I'm on a Kubuntu 11 system and trying out my first Qt Quick project. As this is Kubuntu I'm just running with the Qt that came with it, which has worked fine so far.

I asked Qt Creator to create the sample "Hello World" project from Qt Quick. But the design button was grayed out, as were the run buttons.

At first when I went into the Projects menu under "Run Settings" it said Qt version: [Invalid Qt Version]. Pushing the "Manage Qt versions" button brings up a tree control that looks like this:

v -- Auto-detected
|     |
|     +---Qt in PATH /usr/bin/qmake-qt4
|
+--- Manual

At the bottom of the dialog it says "Found Qt version 4.7.2, using mkspec linux-g++ (Desktop)"

I found out that I could get the "Invalid Qt version" message to go away by manually choosing to install QmlViewer from the app repositories. You'd think it would say something more like "Qml Viewer not found, please install it" but...oh well. Now it says Qt Version: [Qt in PATH].

So that's fixed, and the Qml app runs. But the "Design" button is still grayed out. Qt Designer is installed as an application, and its plugin shows in the "About Plugins..." list. The design button is enabled in ordinary (non-Qt-Quick) projects when I click on a form file, just not for .qml files.

like image 589
HostileFork says dont trust SE Avatar asked Dec 13 '11 18:12

HostileFork says dont trust SE


People also ask

How do I enable Design in Qt?

To switch between forms (Design mode) and code (Edit mode), press Shift+F4. You can use Qt Creator to create stub implementations of slot functions.

Is Qt Designer part of Qt Creator?

Qt Creator includes a code editor and integrates Qt Designer for designing and building graphical user interfaces (GUIs) from Qt widgets. The code editor in Qt Creator supports syntax highlighting for various languages.

How do I add QML to QT?

Creating and Running QML Projects For simple UI files such as this one, select File > New File or Project > Application (Qt Quick) > Qt Quick Application - Empty from within Qt Creator. Pressing the green Run button runs the application. You should see the text Hello, World! in the center of a red rectangle.

What is difference between Qt Designer and Qt Creator?

Qt Creator is Qt's IDE. You don't have to use it, but it greatly simplifies Qt development. Qt Designer is a graphical tool that lets you build QWidget GUIs. Qt Quick Designer is similar, but for building QML GUIs.


2 Answers

in the QtCreator, go to Help -> About plugins -> Select "QT Quick". Restart QtCreator and then select the ui.qml files. It should work now

like image 158
ankit Avatar answered Sep 17 '22 11:09

ankit


In my case it wasn't showing up because I had my cpp file open. When I double clicked on the .ui file, the design button became active.

like image 20
Philip Kirkbride Avatar answered Sep 19 '22 11:09

Philip Kirkbride