incapacitant
29th March 2006, 12:07
I have selected the lines relevant (sic) to the prolem:
first archiv.h puis archiv.cpp
class Archives : public QDialog
{
Q_OBJECT
public:
Archives( QWidget *parent = 0 );
~Archives();
protected:
QAbstractItemModel *model;
QTreeView *qArchiv;
void addArchiv( QString sDate, QString sDest, QString sMsg );
void remplirArchiv();
void selmsg( const QModelIndex() &);
QPushButton *pbOk;
};
//************************************************** **************
connect( qArchiv, SIGNAL( clicked( const QModelIndex() ) ),
this, SLOT( selmsg( const QModelIndex() ) ) );
}
void Archives::selmsg( const QModelIndex() idx )
{
accept();
close();
}
compile:
7 C:\Qt\test\sms\archiv.cpp In file included from archiv.cpp
24 C:\Qt\test\sms\archiv.h variable or field `selmsg' declared void
24 C:\Qt\test\sms\archiv.h expected `;' before '(' token
60 C:\Qt\test\sms\archiv.cpp variable or field `selmsg' declared void
60 C:\Qt\test\sms\archiv.cpp `int Archives::selmsg' is not a static member of `class Archives'
60 C:\Qt\test\sms\archiv.cpp expected primary-expression before "const"
first archiv.h puis archiv.cpp
class Archives : public QDialog
{
Q_OBJECT
public:
Archives( QWidget *parent = 0 );
~Archives();
protected:
QAbstractItemModel *model;
QTreeView *qArchiv;
void addArchiv( QString sDate, QString sDest, QString sMsg );
void remplirArchiv();
void selmsg( const QModelIndex() &);
QPushButton *pbOk;
};
//************************************************** **************
connect( qArchiv, SIGNAL( clicked( const QModelIndex() ) ),
this, SLOT( selmsg( const QModelIndex() ) ) );
}
void Archives::selmsg( const QModelIndex() idx )
{
accept();
close();
}
compile:
7 C:\Qt\test\sms\archiv.cpp In file included from archiv.cpp
24 C:\Qt\test\sms\archiv.h variable or field `selmsg' declared void
24 C:\Qt\test\sms\archiv.h expected `;' before '(' token
60 C:\Qt\test\sms\archiv.cpp variable or field `selmsg' declared void
60 C:\Qt\test\sms\archiv.cpp `int Archives::selmsg' is not a static member of `class Archives'
60 C:\Qt\test\sms\archiv.cpp expected primary-expression before "const"