parnedo
16th July 2009, 10:51
Hi.
I'm trying the auto-connect feature in my code but i don't arrive to get it working.
this is my code:
File .h
class TBarAffichage : public QToolBar{
Q_OBJECT
private:
TColorComboBox* CBoxTraitCouleurs;
....
private Q_SLOTS:
void on_CBoxTraitCouleurs_activated(int);
....
};
File .cpp:
TBarAffichage::TBarAffichage(QWidget *parent):
QToolBar(parent),
CBoxTraitCouleurs (new TColorComboBox(this)) {}
...
void TBarAffichage::on_CBoxTraitCouleurs_activated(int i){
qDebug() << "activated";
}
...
The TColorComboBox.h:
class TColorComboBox : public QComboBox{
Q_OBJECT
public:
TColorComboBox(QWidget *widget = 0):QComboBox(widget){}
};
When i select the color combobox (CBoxTraitCouleurs) and change it (from red to white) the qDebug isn't launched.
I've tried with others objects and signals but nothing works.
What i'm doing wrong?
I've to put something into the .pro?
I've to add something to the constructor?
Thanks
I'm trying the auto-connect feature in my code but i don't arrive to get it working.
this is my code:
File .h
class TBarAffichage : public QToolBar{
Q_OBJECT
private:
TColorComboBox* CBoxTraitCouleurs;
....
private Q_SLOTS:
void on_CBoxTraitCouleurs_activated(int);
....
};
File .cpp:
TBarAffichage::TBarAffichage(QWidget *parent):
QToolBar(parent),
CBoxTraitCouleurs (new TColorComboBox(this)) {}
...
void TBarAffichage::on_CBoxTraitCouleurs_activated(int i){
qDebug() << "activated";
}
...
The TColorComboBox.h:
class TColorComboBox : public QComboBox{
Q_OBJECT
public:
TColorComboBox(QWidget *widget = 0):QComboBox(widget){}
};
When i select the color combobox (CBoxTraitCouleurs) and change it (from red to white) the qDebug isn't launched.
I've tried with others objects and signals but nothing works.
What i'm doing wrong?
I've to put something into the .pro?
I've to add something to the constructor?
Thanks