Your problem seems related only to GUI, where is the data ??
I am not sure of the Model View architecture... but can suggest the following pseudo code for ur problem -
{
LabelWidget * m_pLabelWidget;
Screen * m_pScreen;
MyWindow()
{
connect(m_pLabelWidget,
SIGNAL(buttonClicked
(QString),
this,
SLOT(handleButtonClick
(QString));
}
}
void MyWindow
::handleButton(QString button
) {
if(button == "1")
{
m_pScreen->changeColor(green);
// pop dialog
// other things you want to do....
}
else ...
...
}
class MyWindow : public QMainWindow
{
LabelWidget * m_pLabelWidget;
Screen * m_pScreen;
MyWindow()
{
connect(m_pLabelWidget,SIGNAL(buttonClicked(QString),this,SLOT(handleButtonClick(QString));
}
}
void MyWindow::handleButton(QString button)
{
if(button == "1")
{
m_pScreen->changeColor(green);
// pop dialog
// other things you want to do....
}
else ...
...
}
To copy to clipboard, switch view to plain text mode
Hope it helps
Bookmarks