Ok ,so I must connect the finished signals to one of my slot to be sure that the operation is over.
void testDialog::init()
{
targetPath
= QDir::currentDirPath();
targetFile = targetPath+"/AFile.txt";
op = new QUrlOperator(targetPath);
connect(op, SIGNAL(finished(QNetworkOperation*)), SLOT(displayInfo(QNetworkOperation* _nop)));
nop = op->listChildren();
}
void testDialog
::write( const QString &line
) {
lb->insertItem(line);
lb->setBottomItem(lb->count()-1);
}
void testDialog::displayInfo( QNetworkOperation * _nop )
{
write(fi.name());
}
void testDialog::init()
{
targetPath = QDir::currentDirPath();
targetFile = targetPath+"/AFile.txt";
op = new QUrlOperator(targetPath);
connect(op, SIGNAL(finished(QNetworkOperation*)), SLOT(displayInfo(QNetworkOperation* _nop)));
nop = op->listChildren();
}
void testDialog::write( const QString &line )
{
lb->insertItem(line);
lb->setBottomItem(lb->count()-1);
}
void testDialog::displayInfo( QNetworkOperation * _nop )
{
QUrlInfo fi = op->info(targetFile);
write(fi.name());
}
To copy to clipboard, switch view to plain text mode
but my slot is never called, what's wrong again ?
Bookmarks