dave_mm0
29th July 2009, 00:28
Hey,
I have a QListView from which I obtain a QAbstractItemModel with list->model();
After this, I want to connect the dataChanged signal to a custom QObject of mine:
if( QObject::connect(model, SIGNAL(dataChanged (const QModelIndex , const QModelIndex ) ),
customObject_,SLOT(onText(const QModelIndex , const QModelIndex )) ) )
Proxy::write("SIGNAL SLOT connection successful");
else
Proxy::write("SIGNAL SLOT connection ERROR");
here is my custom object:
class CustomObject : public QObject
{
Q_OBJECT
public:
CustomObject (QObject *parent);
~CustomObject ();
public slots:
void onText(const QModelIndex & topLeft, const QModelIndex & bottomRight );
private:
};
what am I doing wrong? I have a cout in the onText function, but nothing is ever printed when the QListView is Changed.
I have a QListView from which I obtain a QAbstractItemModel with list->model();
After this, I want to connect the dataChanged signal to a custom QObject of mine:
if( QObject::connect(model, SIGNAL(dataChanged (const QModelIndex , const QModelIndex ) ),
customObject_,SLOT(onText(const QModelIndex , const QModelIndex )) ) )
Proxy::write("SIGNAL SLOT connection successful");
else
Proxy::write("SIGNAL SLOT connection ERROR");
here is my custom object:
class CustomObject : public QObject
{
Q_OBJECT
public:
CustomObject (QObject *parent);
~CustomObject ();
public slots:
void onText(const QModelIndex & topLeft, const QModelIndex & bottomRight );
private:
};
what am I doing wrong? I have a cout in the onText function, but nothing is ever printed when the QListView is Changed.