Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Structuring code for gui apps

    General and Desktop
    4
    5
    687
    Loading More Posts
    • 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.
    • nuke
      nuke last edited by

      Hi,

      I would like to ask you what is the best way to organize hand coded GUI. I am new to Qt and I need to start building large app
      . I was thinking of making classes (as containers) for each toolbar or menu but than I would have object which consist objects (for example buttons or it can be buttons and another container with buttons than it would be another object inside) and I have no idea how can I connect all of them together because they don't have access to each other. I am just asking about the proper method for that.

      Thanks for your help

      K kshegunov ? nuke 4 Replies Last reply Reply Quote 0
      • K
        koahnig @nuke last edited by

        @nuke

        Hi and welcome to devnet forum

        Your questions are pretty general. Probably the best for you is to go through the different examples. This will you an impression and probably also the plan for your plan.
        For connecting different buttons and other GUI elements you need to use Qt's signal-slot mechanism.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply Reply Quote 0
        • kshegunov
          kshegunov Moderators @nuke last edited by kshegunov

          @nuke
          Hello,

          I would like to ask you what is the best way to organize hand coded GUI. I am new to Qt and I need to start building large app.

          If you're about to build a large application, my best warm-hearted advice is to not hand-code your GUI. Use the designer for that.

          1. It will spare you hours upon hours of tweaking of margins and other such minor things.
          2. The code is more easily maintained.
          3. You can see what you're doing, especially relevant if you're new to Qt.

          Kind regards.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply Reply Quote 1
          • ?
            A Former User @nuke last edited by

            @nuke Hi! From "The Art of Unix Programming", Eric S. Raymond, (summary from wikipedia):

            Rule of Generation:
            Developers should avoid writing code by hand and instead write abstract high-level programs that generate code. This rule aims to reduce human errors and save time.

            Or, like @kshegunov already said: Use Qt Designer ;-)

            1 Reply Last reply Reply Quote 0
            • nuke
              nuke @nuke last edited by

              @nuke Thanks guys for your help but still i would like to know basic concept of writing GUIs without that.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post