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. Structuring code for gui apps
QtWS25 Last Chance

Structuring code for gui apps

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.0k Views
  • 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.
  • nukeN Offline
    nukeN Offline
    nuke
    wrote on last edited by
    #1

    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 kshegunovK ? nukeN 4 Replies Last reply
    0
    • nukeN nuke

      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 Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @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
      0
      • nukeN nuke

        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

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by kshegunov
        #3

        @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
        1
        • nukeN nuke

          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

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @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
          0
          • nukeN nuke

            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

            nukeN Offline
            nukeN Offline
            nuke
            wrote on last edited by
            #5

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

            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