Results 1 to 4 of 4

Thread: use UI or create widget in source code?

  1. #1
    Join Date
    Apr 2014
    Posts
    53
    Thanks
    9

    Default use UI or create widget in source code?

    In my app, I am creating all the widgets in the source code (like the AddressBook example in QT Examples) instead of using ui->setupUi() from widgets.ui file created by the QT Designer (like the Markdown editor in QT Examples). I just like it this way because it seems more cleaner to me. Does this make me less professional that those who use the .ui files ? What does the majority of developers use ? Do they use .ui files or write widgets in the .cpp source file directly ?

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use UI or create widget in source code?

    Most professional would use such a method that in a particular case is better. There is no general answer which is better.

  3. #3
    Join Date
    Mar 2016
    Posts
    16
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: use UI or create widget in source code?

    As stated, it depends on what you're doing. Using Designer is going to be a lot faster than writing it in code, so you should use it whenever you can.
    "People who get offended should be offended" -- Linus Torvalds

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: use UI or create widget in source code?

    There is already a huge thread where people state their respective preferences.

    If your approach works for you then that is what you should continue to use.

    Cheers,
    _

Similar Threads

  1. Source code to *.ui
    By Zergi in forum Qt Tools
    Replies: 3
    Last Post: 28th September 2011, 19:12
  2. no source code
    By banlinhtienphong in forum General Programming
    Replies: 1
    Last Post: 25th July 2011, 18:19
  3. Replies: 4
    Last Post: 5th November 2008, 19:24
  4. Source code
    By afflictedd2 in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2008, 10:04
  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.