I declare it in the connect :
connect( qArchiv,
SIGNAL( clicked
( const QModelIndex &) ),
connect( qArchiv, SIGNAL( clicked( const QModelIndex &) ),
this, SLOT( selectmsg( const QModelIndex &) ) );
To copy to clipboard, switch view to plain text mode
archiv.h
#ifndef ARCHIVES_H
#define ARCHIVES_H
#include <qdialog.h>
#include <QtCore>
#include <QtGui>
{
Q_OBJECT
public:
~Archives();
protected slots:
private:
void remplirArchiv();
};
#endif
#ifndef ARCHIVES_H
#define ARCHIVES_H
#include <qdialog.h>
#include <QtCore>
#include <QtGui>
class QAbstractItemModel;
class QTreeView;
class QModelIndex;
class Archives : public QDialog
{
Q_OBJECT
public:
Archives( QWidget *parent = 0 );
~Archives();
QString getFileName( const QModelIndex & );
protected slots:
void selectmsg( const QModelIndex & );
private:
QAbstractItemModel *model;
QTreeView *qArchiv;
QPushButton *pbOk;
void addArchiv( QString sDate, QString sDest, QString sMsg );
void remplirArchiv();
};
#endif
To copy to clipboard, switch view to plain text mode
//****************************************************************
void ApplicationWindow::archives()
{
Archives Archives_dlg( this );
if ( Archives_dlg.exec() )
{
}
}
//****************************************************************
void ApplicationWindow::archives()
{
Archives Archives_dlg( this );
if ( Archives_dlg.exec() )
{
QStringList ret = Destinataires_dlg->getDestList();
QString qS = Archives_dlg.getFileName(const QModelIndex idx); // 181
}
}
To copy to clipboard, switch view to plain text mode
only the second line which uses QModelIndex fails:
181 C:\Qt\test\sms\menu.cpp expected primary-expression before "const"
Bookmarks