.qmlproject question



  • Hi Folks,

    I've been kicking the tires on Qt Creator 2.6 rc and Qt5 Beta1, and I've noticed one curious Qt Creator behavior, but I'm not sure if it's a bug.

    First, I created a QtQuickUI project in QT Creator 2.6 rc. That worked well.

    However, after opening my .qmlproject in Qt Creator, I found out that I also must double-click on the .qmlproject file in the Edit pane before the green "Run" triangle appears which allows me to have Qt Creator run my app in QML Scene.

    Is there a good reason one is required to double-click to open the .qmlproject file in the Edit pane before Qt Creator can be able to run it in QML Scene? I don't understand why it is required to open the .qmlproject file in the Edit pane first.

    If there's not a reasonable explanation for this, I'll file a bug. I did not see this issue listed on the Qt bugreports site when I searched for Qt Creator bugs there yesterday. I'm just wondering if I'm missing something or if there's a good reason for this seemingly non-intuitive behavior.



  • I noticed that too.

    I also noticed that what control-R actually does is to run the currently open qml file in the viewer. I suppose you could claim that it is a feature because it allows you to choose which file to treat as the root object. This could be useful when prototyping because it lets you have multiple root objects in the same project and quickly switch from one to the other. This is more convenient than creating separate projects if it is only the main UI file that is different.

    In reality I find it irritating because I am more often working on the business rules part of the program than the UI so having to focus the main file every time is a nuisance.

    Edit: Forgot to say that this is on Win7, QtCreator 2.4.1, and on Ubuntu 10.04 (can't remember Qt version).

    I vote for regarding it as a bug. Or asking for a setting that can switch to the more obvious behaviour.



  • Hi kwhitefoot,

    Thanks for your comments.

    In my setup, the control-R (actually for me, it's Cmd-R on Mac) doesn't exhibit the same behavior; it doesn't allow me to choose which open QML file to treat as the root object. For me, Cmd-R always simply invokes qmlscene using the QML file of the same name as the .qmlproject. Perhaps you and I observe different behavior because we are on different Qt versions. Qt versions < 5 support QML Viewer, whereas I am using Qt 5 Beta 1, and there is no "QML Viewer" only "QML Scene" a.k.a. qmlscene.

    I will look at the current documentation to see if all these behaviors are described or not. If not, I think it's a documentation bug, at minimum. Maybe the requirement to open the .qmlproject in the Edit Pane first for Qt 5.0+ can be removed, especially if choosing a different open QML file doesn't change the root object for qmlscene.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.