salmanmanekia
5th August 2008, 09:47
class TrainNavigation:public QWidget
{
...
private:
QPushButton *recordButton;
public slots:void setDisableSlot();
signals:
void recordClicked();
..
};
void TrainNavigation::setDisable()
{
emit recordClicked();
}
void TrainNavigation::setDisableSlot()
{
if()
recordButton->setDisabled(TRUE);
}
}
#include "TrainNavigation.h"
class TrainingUI:public QWidget
{
Q_OBJECT
public:
TrainNavigation *navigate;
TrainingUI();
virtual ~TrainingUI();
};
TrainingUI::TrainingUI()
{
navigate = new TrainNavigation(this);
connect(navigate,SIGNAL(recordClicked()),navigate, SLOT(setDisableSlot()));
navigate->setDisable();
}
In the above code i was thinking that some how i should tell in the if condition in my
TrainNavigation::setDisableSlot() function that if a button is clicked then only emit the signal..
i am doing all this because i dont want to expose my button to the higher level class that is TrainingUI class..
{
...
private:
QPushButton *recordButton;
public slots:void setDisableSlot();
signals:
void recordClicked();
..
};
void TrainNavigation::setDisable()
{
emit recordClicked();
}
void TrainNavigation::setDisableSlot()
{
if()
recordButton->setDisabled(TRUE);
}
}
#include "TrainNavigation.h"
class TrainingUI:public QWidget
{
Q_OBJECT
public:
TrainNavigation *navigate;
TrainingUI();
virtual ~TrainingUI();
};
TrainingUI::TrainingUI()
{
navigate = new TrainNavigation(this);
connect(navigate,SIGNAL(recordClicked()),navigate, SLOT(setDisableSlot()));
navigate->setDisable();
}
In the above code i was thinking that some how i should tell in the if condition in my
TrainNavigation::setDisableSlot() function that if a button is clicked then only emit the signal..
i am doing all this because i dont want to expose my button to the higher level class that is TrainingUI class..