I am totally new to Qt development. Infact today's my first day! I installed Qt 5.3.1 open source (LGPL license). I was looking around in the Qt Creator and accidentally closed several sub-windows and not able to view the actual code, other list of opened files, etc. But it does load the project and also executes when I click the green 'Run' button. How do I recover the default layout? There is no window layout/View option in the menu. Can't see anything online! Please help...
Qt Creator creates some files to save the settings. These files are in different location in different operating systems.
On Windows Vista and Windows 7 :
<drive>:\Users\<username>\AppData\Roaming\QtProject and <drive>:\Users\<username>\AppData\Local\QtProject
On Linux :
~/.config/QtProject and ~/.local/share/data/QtProject/qtcreator
Try to delete QtCreator.ini and many settings including the layout are reset to default when you reopen Qt Creator.
Alt+0 will show project tree. Use ctrl+k to open search window.
Regards
Related
In Qt Creator it is possible to run the program clicking the green play button (using PySide6), but not edit the qml file in Design mode, where it gives the error "Line 0: The Design Mode requires a valid Qt kit" inside the design view. I created a project and selected Qt for Python (qml).
But I have installed several gb of the newest Qt version during installation? I have also selected the correct python env in the options.
When I create a non-qml project, but add a .qml file later a popup error says:
"The QML emulation layer (QML Puppet) cannot be built because the Qt version is too old or it cannot run natively on your computer. The fallback emulation layer, which does not support all features, will be used"
The Qt version is 6.2.2 and the OS is Windows 11. It is possible to use design mode in Qt Design Studio.
I meet the same problem and my environment is similar, choose Edit → Preferences and enter the Kits. Then select a Qt version and a kit you like (the type of qmake shall be the same, for instance, both of them is msvc), and remember to apply the changes.
After that, go back to the form editor and it works well. What confused me is that I must repeat the steps above each time I want to use Qt, the config seems to not be saved correctly. (The Qt version is 5.1.2 and the OS is Windows 11)
PS: After selecting the kit, you need to restart Qt.
I am using Qt Creator 3.3.2 and I wonder if it is possible to completely delete a project from within the Creator. Of course I could use my windows explorer and manually delete the files, but for convenience I would like to do it from the IDE. Is it possible?
The closest I could find is this question, but if I understand it correctly it is about removing the project from Qt Creator while keeping the source files.
No, there is no such feature. You can ask to delete a specific file of your project by right-clicking it in the project explorer, but you can't delete a whole project, you'll have to do it from your OS's file browser.
How can I import these code examples into QT Creator 3.4.0 ? I tried the available import options but they don't work.
I tried to create an empty QML project and add the rectangle.qml file to it. When I tried to run it, nothing showed up.
The book examples contain files .qmlproject - which seems to be a project descriptor. I wonder if it is somehow possible to import these .qmlproject files into QT Creator, click and run the examples.
I think this link might help in finding the solution : https://forum.qt.io/topic/27525/what-is-qmlproject-file/3 .
Usually I'd say that you should go to File > Open File or Project... and select the .qmlproject and you're done, but support for this type of project file was disabled by default. If you try to do this now (I believe the change is in Creator 3.4), you'll just get an error message about Creator not supporting the mime type of the file, or something. Unfortunately, this is not a very useful error message for a beginner, and it won't tell you how to fix the problem.
If you want to use .qmlproject files in newer versions of Creator, you have to navigate to Help > About Plugins... and enable the QmlProjectManager plugin (it's under the Qt Quick section) by checking the box.
So this is how you should normally open project files in Qt Creator. As for the window not showing up, that's also commonly encountered and can be fixed by making the root item in your scene a Window:
Unlike QQuickView, QQmlApplicationEngine does not automatically create a root window. If you are using visual items from Qt Quick, you will need to place them inside of a Window.
Qt Creator's new project wizard handles this for you when you create a new Qt Quick project, as you saw when you got the "Hello World" window to open in your video. It was when you loaded concepts/rectangle.qml which had a Rectangle as its root item, that it stopped showing up. That QML file was likely used in a project where a QQuickView was displaying it.
I'm using Qt Creator for several months now and from time to time, I get a problem dragging widgets like buttons, line edits and so from the toolbox to the window.
I try by removing the layouts but still get the same issue.
I use Qt Creator 2.4.0 on OS X 10.7.2
Thanks for helping
I fixed this problem by upgrading Qt Creator to version 2.4.1 on OS X
The solution described above by #spyke might also be helpful for Windows users.
It case there is a dead link, the solution for Windows says :
I was using Qt Designer for Qt Jambi built with Qt 4.6.4 on Windows 7 ×64 when this problem occurred. After a while I realized that the problem was not only in Qt designer, but in Windows in general: Explorer, FileZilla and more.
The solution was then found by searching for general Windows 7 drag and drop problems [answers.microsoft.com].
In short: Select a file in Windows Explorer with click and hold left mouse button. While holding the button down, hit the Esc key. Then drag and drop starts working again.
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.
in the QtCreator, go to Help -> About plugins -> Select "QT Quick".
Restart QtCreator and then select the ui.qml files. It should work now
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.
Solved it while writing the question.
To make a long story short: this appears to be a known issue in general with installing Qt Creator through the ubuntu repositories as opposed to using the Qt SDK Installer from Nokia:
http://qt.nokia.com/downloads
(That installer seems to do the work of making sure the proper SDK elements are installed, while the linux package repositories lag in getting things right.)
Another option seems to be building Qt from sources. But uninstalling the Qt Creator I got through KPackageKit and instead using the installer from Nokia was less involved, and worked for me in this case.