Problems with using Creator



  • When I launch Qt Creator, and I open or create a project, I can't see what I'm coding, what I mean with this is the following picture:

    This is a gif that I record

    But that's not all, when I try to code, the mouse pointer disappear and I have to enter to the Welcome Page to reload what I'm doing, and I find that useless.
    Maybe I have installed in the wrong way, but I followed all the steps; by the way I have the Qt creator 4.2.1 based on Qt 5.8.0 (MSVC 2015, 32 bit) Built on Jan 20 2017 01:29:39, From revision 7071b61e02.


  • Moderators

    @pintovillamar

    Hi and welcome to devnet forum

    I am not sure what the issue is, since I do not do qml.

    The window says that "This file should be only edited in design mode".
    Standard gui requires also the designer for edîting. However, it should switch automatically.

    May be you should try to go on the left to "Design" instead of "Edit".

    Hope that helps.


  • Qt Champions 2016

    Hi
    Click the ..ui.qml file.
    Or just close the "can only edit in Design Mode"

    If you are in a UI file and click edit. it does this.
    Just close it to get back to code. (right click name over it)
    or simply click on the file u want to edit.

    Edit does NOT flip between code and UI files. You are cannot edit UI files as text.
    Only via Design. (as it says)



  • May be you should try to go on the left to "Design" instead of "Edit".
    This ^ =) - use Design

    To be correct - "This file should only be edited in Design mode." - doesn't mean cannot.
    Creator indeed does flip between the code and design of the same UI file you are editing... and yes you can happily edit them as text.

    I personally find that message a bit patronizing - no reason or examples of why you'd not want to is ever given.
    I've never broken anything by setting things in text... please correct me of my treason/blasphemy if there's actually a valid reason.

    If the editor ever actually locked me out of text editing UI files I'd just use QML files... and that would suck because this would be a great disservice losing the script / expression blocking guards *.UI provides to keep you on the straight an narrow.

    Anyhow, just saying... I edit the text of UI files all the time because sometimes just doing what you want is easier to type than it is to try and wrangle a gui. Especially with all the power of block text editing... use UI files for visual for sure but is that message even there for any real reason?


  • Qt Champions 2016

    @6thC

    • is that message even there for any real reason?

    Well, i think its there because not all cases are supported allowing editing as text.
    Like if you open it BOTH as text and Designer form and so on.
    And it would see strange if "Edit" would just close it.

    Anyway, im just guessing , i dont know the historical reason.


  • Moderators

    @mrjj I think the reason is simple: you can edit these files manually if you really want to. Same for ui files.


  • Qt Champions 2016

    @jsulm
    Yes, its just XML files. I changed them many times from outside.
    But Im just wondering on Why it tells you, instead if just close Designer if
    you press Edit. And if you open UI in Designer and change it from outside
    Designer will just overwrite your manual changes etc. So i assume that is the
    reason for the message.



  • To add my 2 cents to this discussion. One techincally does not need a *.ui.qml file, if you open any QML file in the editor and than click on Design the file is loaded into the QML-Designer with preview and everything, and you can than use it to make changes in your code.

    Works fine, I personaly find the special ui.qml file thing confusing.


  • Qt Champions 2016

    @J.Hilk
    Oh, good info.
    With widgets, the UI files are need for wysiwyg design
    but it sounds good if any QML file also can be visually edited regardless of an .ui file was created to start with.


  • Moderators

    @jsulm said in Problems with using Creator:

    @mrjj I think the reason is simple: you can edit these files manually if you really want to. Same for ui files.

    @mrjj said in Problems with using Creator:

    @jsulm
    Yes, its just XML files. I changed them many times from outside.
    But Im just wondering on Why it tells you, instead if just close Designer if
    you press Edit. And if you open UI in Designer and change it from outside
    Designer will just overwrite your manual changes etc. So i assume that is the
    reason for the message.

    IMHO it is mere a question of consistency. As we apparently have all done already,you can change a ui with an external editor, but not from inside of creator. The question is certainly obvious why not being able to change directly as suggested by closing the designer and starting to allow edit.
    With editing you can easily mess up things, when you do not understand, ignore warnings and probably a couple of other cases. When suddenly the designer "explodes" on a file because of such changes, recovery in designer might not be possible respectively, the required implementations for a recovery mode are extremely complex.
    Therefore it is a logical decision to block editing of designer files and in consequence display the warning.



  • @J.Hilk this is true. I'm guilty of having everything of mine a *.qml apart from the select few.

    UI files make for a nice clean separation of the visuals and they disable scripts. You can't toss business logic in the middle.

    Designers ... meh, it's often quicker to just do what you know you want. There's nothing crazy happening - I want spacing or margin? The only difference is setting the value from a combo / spinner vs typing the name:number/bind

    I should use them more - I already do limit the amount of script shenanigans but the controls I have made with UI have been nice to work with.

    @koahnig said in Problems with using Creator:

    IMHO it is mere a question of consistency. As we apparently have all done already,you can change a ui with an external editor, but not from inside of creator.

    Your creator version must behave differently to mine then? I'm just using .qml and .qml.ui files and I'm not stopped by the application at all... in fact seems common now for the puppet to go crashing - even in design mode it throws me back to the editor. This has been happening for a few revisions now...

    My ui files so far are very basic, pretty common to have an Item for root, a grid/row/colum Layout and children ... but they look good and simple is best.

    I wasn't advocating break all the rules all the time, I think everyone knows when you push past warning barriers the risk is all on you [read me]. I was just kinda wondering ... is that a thing, really?


  • Moderators

    @6thC

    Sorry I was not trying to blame you for anything nor anybody else. My reply is to mrjj at that point, but I am not blaming him for anything either. Therefore, this is merely the summary of the rational behind the current behaviour of creator and why it is better that way IMHO.

    When allowing the direct editing we would probably have "tons" of complaints in here when designer cannot recover. The problem are typically not with those users understanding the opportunities and nogos with xml. A bit copy and pasting can great a mess in there fast. Also allowing the direct editing raises the issue of documentation of the .ui files.

    I am not using qml as stated in my first reply. With designer I did not have a crashing experience in creator yet. Certainly I had changed the ui-file outside and designer was not happy when I had messed up things. However, I cannot blame for creator nor designer when I am changing things outside.



  • @koahnig
    I understand why you'd not push users towards it or even advertise you can. The most endeavouring users might still actually go outside Creators bounds.

    I was just pointing out that within Creator you can edit ui.qml files when in text mode. Are we not talking about the same files?

    I notice you've mentioned changing XML? I'd probably not touch QML if it was syntactically XML.
    All the duplication, so much text to say so little! QML is much better.

    Not trying to pick any fights or recommend going around systems :-) but I know I lay my files out to maximize block editing which is much faster if I need to change everything at once.


  • Moderators

    @6thC said in Problems with using Creator:

    I was just pointing out that within Creator you can edit ui.qml files when in text mode. Are we not talking about the same files?

    Definitely no!

    Refer to my first post in this thread:
    @koahnig said in Problems with using Creator:

    @pintovillamar
    I am not sure what the issue is, since I do not do qml.


Log in to reply
 

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