Effective way to duplicate a widget display
-
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?
-
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?
@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.
-
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?
@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 -
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?
@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.