In Qt creator whenever you open a ui.qml file by double clicking or CTRL + TAB the file normally opens in design mode. To see the code, you need to hit ESC to go the text editor. I want that the ui.qml files should open by default in the editor. How can I do that in settings?
2 Answers
In Qt Creator:
- Tools >>> Options;
- Open Environment;
- Go to MIME Types;
- Find (by filter, for ex.)
application/x-qt.ui+qml; - Delete or change Pattern field in Details.
7 Comments
Akash Agarwal
In details there are no pattern fields. I tried the solution before posting the question.
Akash Agarwal
I'm on QT Creator 3.6.1, what version are you using?
Akash Agarwal
As I can see you don't have anything in the Details box too.
Shtol Krakov
Cause I deleted a pattern already. Don't you forget select a MIME type firsly?
Akash Agarwal
I followed all 4 steps and 5th is the one which I can't because there never existed one. I'll try to update and see if that works.
|
If you want to edit .ui.qml files by hand, don't use .ui.qml files?
These are made to be edited by the designer and are limited to a small subset of QML because of that.
Just use the normal .qml extension in this case.
More info on QML UI files here.
1 Comment
Akash Agarwal
Couldn't find a better answer, thanks for your guide in comments as well!
.ui.qmlfiles are "new",.qml.files have existed since the beginning of QML. For more information, see doc.qt.io/qtcreator/creator-quick-ui-forms.html.