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. Best approach to for a dock widget registry?

Best approach to for a dock widget registry?

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

    Does anyone have a suggestion for a 'dock widget registry'? While I could do this myself, I first wanted to find out whether there was anything offered by Qt or a commonly used class implementation?

    As background: I am currently dealing with an application where all the dock widgets are hard coded into the main window, with calls to each of them made explicitly. I would like to evolve the application such the dock widgets are added to a registry and then at each phase of the lifecycle calls made to the entries, based on the interfaces they implement. The idea is that this would make it easier to add a new dock widget as needed, without needing to modify code in n different places.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What do you mean by "calls to each of them" ? Are you calling one dock widget function insider another dock ? If so the first step would be to use signals and slots to avoid that.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ajmas
        wrote on last edited by
        #3

        The code currently has a main window that creates and instance of each dock widget and then for each will make a call to each specific widget, based on the action. I'll look at the signals and slots for the the message passing and see if that reduces the need for a registry.

        mrjjM 1 Reply Last reply
        0
        • A ajmas

          The code currently has a main window that creates and instance of each dock widget and then for each will make a call to each specific widget, based on the action. I'll look at the signals and slots for the the message passing and see if that reduces the need for a registry.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ajmas said:
          Hi
          Can you say a little about what this registry would do?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ajmas
            wrote on last edited by
            #5

            The idea would be a place to 'register' all the dock widgets the available to the application and then access them based on functionality.

            I ended up just using a list and cycling through the entries. It is not as sophisticated, but it actually fills the need, especially for the current small number, rather than over-engineering the problem. If the need changes down the road, then I'll re-evaluate at that point. - Thanks

            I can probably mark this question as solved.

            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