I declare it in the connect :
Qt Code:
  1. connect( qArchiv, SIGNAL( clicked( const QModelIndex &) ),
  2. this, SLOT( selectmsg( const QModelIndex &) ) );
To copy to clipboard, switch view to plain text mode 
archiv.h
Qt Code:
  1. #ifndef ARCHIVES_H
  2. #define ARCHIVES_H
  3.  
  4. #include <qdialog.h>
  5.  
  6. #include <QtCore>
  7. #include <QtGui>
  8.  
  9. class QTreeView;
  10.  
  11. class Archives : public QDialog
  12. {
  13. Q_OBJECT
  14.  
  15. public:
  16. Archives( QWidget *parent = 0 );
  17. ~Archives();
  18.  
  19. QString getFileName( const QModelIndex & );
  20.  
  21. protected slots:
  22. void selectmsg( const QModelIndex & );
  23.  
  24.  
  25. private:
  26. QTreeView *qArchiv;
  27. QPushButton *pbOk;
  28.  
  29. void addArchiv( QString sDate, QString sDest, QString sMsg );
  30. void remplirArchiv();
  31.  
  32. };
  33.  
  34. #endif
To copy to clipboard, switch view to plain text mode 


Qt Code:
  1. //****************************************************************
  2. void ApplicationWindow::archives()
  3. {
  4. Archives Archives_dlg( this );
  5. if ( Archives_dlg.exec() )
  6. {
  7. QStringList ret = Destinataires_dlg->getDestList();
  8. QString qS = Archives_dlg.getFileName(const QModelIndex idx); // 181
  9. }
  10. }
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"