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. UI Generation Question
Forum Updated to NodeBB v4.3 + New Features

UI Generation Question

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 5 Posters 359 Views 3 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello all, hope all is well. I just had a quick question regarding the code that is used to construct the UI elements of an application. If you are not using ui files, is it a better coding practice to generate the ui within the header file or within the source file?

    JKSHJ Pablo J. RoginaP 2 Replies Last reply
    0
    • ? A Former User

      Hello all, hope all is well. I just had a quick question regarding the code that is used to construct the UI elements of an application. If you are not using ui files, is it a better coding practice to generate the ui within the header file or within the source file?

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      @WesLow said in UI Generation Question:

      is it a better coding practice to generate the ui within the header file or within the source file?

      Source file. Probably in your constuctor.

      The header file should contain your class structure, not your logic.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      4
      • ? A Former User

        Hello all, hope all is well. I just had a quick question regarding the code that is used to construct the UI elements of an application. If you are not using ui files, is it a better coding practice to generate the ui within the header file or within the source file?

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        @WesLow said in UI Generation Question:

        If you are not using ui files

        Just curious, do you have a compelling reason not to use ui files?
        I mean for maintainability point of view, let's say you add a new programmer to the team, I guess it'll be easier and quicker for that person to use Qt Designer and change the GUI than dig into the GUI generation code...

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        1
        • JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          UI file is the view(V) of MVC model in GUI design. Better to use it for easier maintenance purpose.

          1 Reply Last reply
          1
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi
            Just so it's clear.
            Using UI files is only a Design feature.
            They are converted to code and hence there is no runtime cost or
            any hidden magic. You also get an automatic way of resetting the texts
            if a new Translator is loaded.

            1 Reply Last reply
            1

            • Login

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