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. Effective way to duplicate a widget display
Forum Updated to NodeBB v4.3 + New Features

Effective way to duplicate a widget display

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 580 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.
  • L Offline
    L Offline
    Loc888
    wrote on last edited by
    #1

    I am trying to make a simplified actions window in my software, so the most important actions and settings are over there, but the problem i am encountering is the fact, that in order to do that, i have to make significant amount of slots and signals, so i wanted to ask if there's any better way to do that?

    I am not aware of any way to duplicate the display of a widget, so it's drawn at 2 places, but the actual pointer/widget is actually the same, so the most effective way i know would be new widget, and connect them together, but is it the only way to do that?

    jsulmJ J.HilkJ Pl45m4P 3 Replies Last reply
    0
    • L Loc888

      I am trying to make a simplified actions window in my software, so the most important actions and settings are over there, but the problem i am encountering is the fact, that in order to do that, i have to make significant amount of slots and signals, so i wanted to ask if there's any better way to do that?

      I am not aware of any way to duplicate the display of a widget, so it's drawn at 2 places, but the actual pointer/widget is actually the same, so the most effective way i know would be new widget, and connect them together, but is it the only way to do that?

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Loc888 said in Effective way to duplicate a widget display:

      I am not aware of any way to duplicate the display of a widget, so it's drawn at 2 places

      You can simply create two instances of that widget.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • L Loc888

        I am trying to make a simplified actions window in my software, so the most important actions and settings are over there, but the problem i am encountering is the fact, that in order to do that, i have to make significant amount of slots and signals, so i wanted to ask if there's any better way to do that?

        I am not aware of any way to duplicate the display of a widget, so it's drawn at 2 places, but the actual pointer/widget is actually the same, so the most effective way i know would be new widget, and connect them together, but is it the only way to do that?

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by J.Hilk
        #3

        @Loc888 said in Effective way to duplicate a widget display:

        I am not aware of any way to duplicate the display of a widget, so it's drawn at 2 places, but the actual pointer/widget is actually the same,

        displayed at the same time ? no thats not possible, afaik

        but you can take your widget, remove it from its layout and insert it in an other layout, no problem at all.

        https://doc.qt.io/qt-5/qlayout.html#removeWidget
        https://doc.qt.io/qt-5/qlayout.html#addWidget


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        1
        • L Loc888

          I am trying to make a simplified actions window in my software, so the most important actions and settings are over there, but the problem i am encountering is the fact, that in order to do that, i have to make significant amount of slots and signals, so i wanted to ask if there's any better way to do that?

          I am not aware of any way to duplicate the display of a widget, so it's drawn at 2 places, but the actual pointer/widget is actually the same, so the most effective way i know would be new widget, and connect them together, but is it the only way to do that?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @Loc888 said in Effective way to duplicate a widget display:

          so it's drawn at 2 places, but the actual pointer/widget is actually the same

          The "same" (same memory) widget can't be at 2 places at the same time. QObjects are also not copyable.
          You would need to create a new instance, but you can connect them to the same slot, without writing the same code more than once.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          3

          • Login

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