PDA

View Full Version : Is there a way to say QtCreator to rebuild the .ui file from .h?



tonnot
24th November 2010, 09:03
I have changed the .h file 'linked' to the .ui file
(because I have deleted the statusbar and now I want it again)
1.- Is there a way to say QTcreator 'rebuild .ui from .h ?'
2.- Is there a way to add a statusbar in QTCreator?

franz
24th November 2010, 09:31
I have changed the .h file 'linked' to the .ui file
(because I have deleted the statusbar and now I want it again)
1.- Is there a way to say QTcreator 'rebuild .ui from .h ?'
Not that I'm aware of. Did you delete the status bar using the designer?



2.- Is there a way to add a statusbar in QTCreator?
QMainWindow has one by default. You can just use that one. Else call statusBar() in your code.

Revision control (http://en.wikipedia.org/wiki/Revision_control) for the win ;)

tonnot
24th November 2010, 09:48
Yes, I delete it from designer.
And, I want to use it at the designer, not in code.

wysota
24th November 2010, 09:55
Open the .h file generated from the ui file, scroll to the top and read the line containing the word "WARNING" as many times as you need until you understand it. Then go to the documentation and read the Using a Designer UI File in Your Application chapter. Pay special attention to sentences containing the word "subclass".

tonnot
24th November 2010, 10:06
Wysota, I know to read...
This is the reason to make this 2 questions.
1.- Is there a way to say QTcreator 'rebuild .ui from .h ?'
2.- Is there a way to add a statusbar in QTCreator?

It can be interesting to say QT People that include this functionality in next versions.
For example, in this way a copy - paste operations could allow to build a menu from code. (for example). But I understand that it can be very difficult.

high_flyer
24th November 2010, 10:16
It can be interesting to say QT People that include this functionality in next versions.
For example, in this way a copy - paste operations could allow to build a menu from code. (for example). But I understand that it can be very difficult.
No, it wont be interesting for them.
The designer is a help tool to help rapid ui design.
The ui file is just a way to convey that information to your C++ code.
ui's do not have any importance on their own.
If you changed something in your code that changes the way your GUI looks like, then there is no need to change the ui back form the code, since your code is your application and it does what you want.
Many people don't bother with ui's at all, but code everything manually.

tonnot
24th November 2010, 10:29
Yes, but If they want to have a century XXI's tool and win users, later or sooner they have to integrate code with UI in biunivocal way.

high_flyer
24th November 2010, 10:31
ok, you win.

wysota
24th November 2010, 10:34
2.- Is there a way to add a statusbar in QTCreator?
Yes, right click the form and choose "Add status bar". Not that you'll be able to do anything with the status bar from within Designer apart setting its properties...


It can be interesting to say QT People that include this functionality in next versions.
For example, in this way a copy - paste operations could allow to build a menu from code. (for example). But I understand that it can be very difficult.
I don't think there are tools for painters to decompose paintings into blobs of paint and stuff that paint back into tubes.

It's written numerous times in numerous places - never modify files that are generated on the fly (ever, not only in Qt). You are given mechanisms for modifying the looks and behaviour of UIs generated from .ui files in your code so use them. If you stride sideways and go your own way then you will be on your own. Deal with it.