Show the same Widget at different places
I am trying to archive the following:
Every time that the user clicks in some item from "Basin Model" a different widget("Property Widget") should be shown at the bottom left place:
However should be also possible to the user edit the "Property Widget" clicking in some action("Edit action"), as shown:
The problem is that I have to able to shown both at same time and any change in one widget have to be implemented at the other, since both represents the same "Property Widget". There any tricky to do this? or any example in how to do this? or any book that gives some hints?
You probably have the data that are shown at the two places separated from the two widgets (or widget instances) that show it.
Then, if you change the data in one widget the data can send a signal that they have just changed and the other widget would re-act in a slot re-initializing itself with the changed data and v.v.
Since you can't have the same widget be shown twice (QObject class can't be copied) and the widgets do have a parent class (MainWindow?) it is as msue says, use a signal/slot connection between them. An update from the one will trigger an update to the other. If the widgets use a 'base' set of values you could create a dataclass and use that in the signal/slot (use Q_DECLARE_METATYPE) connection as an argument to transport the data from one class to the other.
If the widgets update setting in the Mainwindow class, you could use the MainWindow (parent) class as a collector/distribute connection between the widgets, but to avoid that the MainWindow gets bulky I would recommend the first option.
As an experiment, you could use QGraphicsView with several viewports, but the suggestions posted by msue and Jeroentje are probably better.
To add to the suggestions, depending on your data, the Model/View paradigm might also be an interesting alternative