Results 1 to 10 of 10

Thread: How to convert ui file to cpp file in QtCreator?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to convert ui file to cpp file in QtCreator?

    Quote Originally Posted by chipper View Post
    I did that. But after that, I still don't know how to invoke uic... I didn't find the uic in the QtCreator and I looked at the bin directory, there was no binary file called "uic".
    Sorry, I didn't quite get it. Do you mean that by "run qmake" or "build all", uic will be invoked automatically? When I did that, I didn't see the cpp or h file changed according to the ui file...

  2. #2
    Join Date
    Aug 2010
    Posts
    107
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to convert ui file to cpp file in QtCreator?

    By default the ui file is hidden as it is a generated file and you shouldn't make changes to that file. The reason for this is each time you build/compile the ui file is regenerated to reflect any changes you might have made, so any changes that you made to the file will be lost. If you really want to see the file then in the creator file menu (right under the word Projects) is a directory tree with your files. Above this is and next to the Project frame is a frame with what looks like a funnel. On the arrow next to the right of the funnel thing (filter tree), click on this and uncheck show generated files. The book is a bit difficult to follow, it starts out with code generated forms and widgets and later on briefly describes QT Designer. I think it does this because the Designer part of creator is pretty straight forward and some people like hand coding their forms so it starts there. (one thing to remember, QT Creator is a program that contains several programs so when someone(or the book) is talking about Designer, that is the Designer part of Creator.) Read the book and things might make a little more sense as you get further in.
    Sorry, I didn't quite get it. Do you mean that by "run qmake" or "build all", uic will be invoked automatically? When I did that, I didn't see the cpp or h file changed according to the ui file...
    The header or cpp file will not be generated, there will be a file that is generated called ui_yourProjectName. This contains the file to generate the "form" that you created in Designer. QT will integrate this into your program automatically. Your .h and .cpp file will not change.
    I hope this helps!
    Good luck!

Similar Threads

  1. QtCreator add a pri file without compiling it
    By bunjee in forum Qt Tools
    Replies: 1
    Last Post: 3rd May 2009, 13:35
  2. Convert doc into txt file using Qt
    By live_07 in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2009, 14:27
  3. Read binary file and convert to QString
    By jaca in forum Qt Programming
    Replies: 12
    Last Post: 13th June 2008, 23:05
  4. Replies: 3
    Last Post: 25th May 2007, 07:49
  5. How to convert QTextDocument to PNG file?
    By Gonzalez in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2006, 14:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.