Results 1 to 4 of 4

Thread: Source code to *.ui

  1. #1
    Join Date
    Dec 2007
    Posts
    28
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Source code to *.ui

    Hi

    Is there any possibility to convert source code(generated from qt designer) to *.ui file? I m asking because I overwrote my ui file and i didn't find any backups... But I found ui_file.h which contains generated from qt designer source code. I want to continue my project so is there any possibility to convert this file back to *.ui or I have to rebuild my ui form again?

    Best regards
    Last edited by Zergi; 28th September 2011 at 15:53.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Source code to *.ui

    Is there any possibility to convert source code(generated from qt designer) to *.ui file?
    No, since designer does not generate source code, but ui files!

    But I found ui_file.h which contains generated from qt designer source code.
    the ui_file.h IS the source code generate from the ui file!
    so is there any possibility to convert this file back to *.ui
    No.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    Zergi (28th September 2011)

  4. #3
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Source code to *.ui

    .ui file is basically xml, so I guess you can write a generator for that. Anyway, it should be faster to design the ui again, based on the widget in your app (you can still use this ui_file.h to display ui in the app).

  5. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Source code to *.ui

    You don't need the .ui to make changes to your app anyway, you can just make them in code.

    It would be possible to write a flakey script to translate the generated code back to .ui, but it would be easier and quicker to just redesign the ui.

    And next time MAKE BACKUPS!

    I have a backup of every change I've made to all of my projects, so I can always revert overwritten files, deleted files and any other changes. Lookup 'version control' then install something like Subversion or GIT.

Similar Threads

  1. no source code
    By banlinhtienphong in forum General Programming
    Replies: 1
    Last Post: 25th July 2011, 18:19
  2. Where is the source code?
    By Fletcher in forum Newbie
    Replies: 1
    Last Post: 10th December 2009, 21:45
  3. Source code
    By afflictedd2 in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2008, 10:04
  4. source code
    By Colx007 in forum Newbie
    Replies: 5
    Last Post: 19th December 2007, 10:15
  5. Qte source code
    By Gaurav vyas in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 1st July 2007, 15:11

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.