Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Which is more efficient ? use .ui file with QDesigner VS all by code
Qt 6.11 is out! See what's new in the release blog

Which is more efficient ? use .ui file with QDesigner VS all by code

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    which way is more commom and efficient ?
    i normally create my Qt app all by code, and not use .ui & QDesigner at all. and the layout plays an important role here.
    Here, i want to know what do u guys usually do ? use .ui & QDesigner is better or not & all by code ?
    thank you

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      At runtime, the performance is exactly the same.

      Using UI files makes the compilation slightly longer (uic needs to create a header out of .ui file, then C++ compiler needs to compile it), but it's not a big difference.

      Using UI files makes the UI implementation much faster than coding everything by hand.

      (Z(:^

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        I usually do either all in code, or (rarely) do the initial layout in designer and then grab the ui_*.h and "convert" it to "handwritten" code (mostly by throwing out all the unneeded setObjectName, QMetaObject::connectSlotsByName etc calls).

        I personally find refactoring code spanning both .ui and .cpp files (like renaming subwidgets, replacing a Foo class subwidget by a similar Bar class, or activities that require subclassing standard widgets to override event handlers or similar) more time consuming in the long run than using a pure .cpp setup.

        1 Reply Last reply
        0
        • IamSumitI Offline
          IamSumitI Offline
          IamSumit
          wrote on last edited by
          #4

          Hi..
          it's actually depends.
          AFAIK ..Both ways are efficient .But through coding developer can have flexibility and less dependency on Designer.

          Be Cute

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved