I want to relay/concatenate a signal from an object I put into a QList to its parent to trigger a redraw of the parent object. But where to put the connect()?
void Desktop::addTray(Tray tray) {
trayList.append(tray);
}
void Tray
::setColor(int number,
QColor color
) { pointList[number].setColor(color);
emit dataChanged();
}
void Desktop::addTray(Tray tray) {
trayList.append(tray);
}
void Tray::setColor(int number, QColor color) {
pointList[number].setColor(color);
emit dataChanged();
}
To copy to clipboard, switch view to plain text mode
If I append a new tray object to the desktop I copy the object not a pointer to it. So If I would write the connect() after line 2, I wouldn’t connect to the object within the trayList.
Bookmarks