archiv.h
{
Q_OBJECT
public:
~Archives();
...
class Archives : public QDialog
{
Q_OBJECT
public:
Archives( QWidget *parent = 0 );
~Archives();
QString getFileName( const QModelIndex &);
...
To copy to clipboard, switch view to plain text mode
archiv.cpp
//****************************************************************
{
return model->data(idx.sibling(idx.row(), 0)).toString();
}
//****************************************************************
QString Archives::getFileName( const QModelIndex & idx )
{
return model->data(idx.sibling(idx.row(), 0)).toString();
}
To copy to clipboard, switch view to plain text mode
and menu.cpp
//****************************************************************
void ApplicationWindow::archives()
{
Archives Archives_dlg( this );
if ( Archives_dlg.exec() )
{
QString s
= Archives_dlg
->getFileName
( const QmodelIndex
& idx
);
}
}
//****************************************************************
void ApplicationWindow::archives()
{
Archives Archives_dlg( this );
if ( Archives_dlg.exec() )
{
QString s = Archives_dlg->getFileName( const QmodelIndex & idx);
}
}
To copy to clipboard, switch view to plain text mode
and the compiler says :
QString s = Archives_dlg->getFileName( const QmodelIndex & idx);
180 C:\Qt\test\sms\menu.cpp base operand of `->' has non-pointer type `Archives'
in the procedure above I make a similar call with (apparently the same syntax) and it works, so I don't know.
Bookmarks