mainwindow.cpp
noobsForm myNoobs(listPart, file);
QObject::connect(&myNoobs,
SIGNAL(doFormat
(int,
bool)),
this, SLOT(formatSDcard(int, bool)));
this,
SLOT(writeNoobs
(int,
bool,
QString)));
QObject::connect(&myNoobs,
SIGNAL(doUpdateDriveDataList
()),
this, SLOT(getLogicalDrivesSlot()));
****
this,
SLOT(getUpdatedFileCount
(QString)));
****
myNoobs.exec();
void MainWindow
::getUpdatedFileCount(QString driveLetter
) //slot {
qDebug() << "getupdatedfilecountSlot" << driveLetter;
//getFileList(driveLetter);
//qDebug() << countFiles << "-" << countDirs;
//emit doUpdateFileList(countFiles, countDirs);
}
mainwindow.hpp
public slots:
bool formatSDcard(int type, bool remote);
void writeNoobs
(int which,
bool remote,
QString file);
void getLogicalDrives(); // find attached USB devices
void getUpdatedFileCount
(QString driveLetter
);
mainwindow.cpp
noobsForm myNoobs(listPart, file);
QObject::connect(&myNoobs, SIGNAL(doFormat(int, bool)),
this, SLOT(formatSDcard(int, bool)));
QObject::connect(&myNoobs, SIGNAL(doWriteNoobs(int, bool, QString)),
this, SLOT(writeNoobs(int, bool, QString)));
QObject::connect(&myNoobs, SIGNAL(doUpdateDriveDataList()),
this, SLOT(getLogicalDrivesSlot()));
****
QObject::connect(&myNoobs, SIGNAL(doGetFileCount(QString)),
this, SLOT(getUpdatedFileCount(QString)));
****
myNoobs.exec();
void MainWindow::getUpdatedFileCount(QString driveLetter) //slot
{
qDebug() << "getupdatedfilecountSlot" << driveLetter;
//getFileList(driveLetter);
//qDebug() << countFiles << "-" << countDirs;
//emit doUpdateFileList(countFiles, countDirs);
}
mainwindow.hpp
public slots:
bool formatSDcard(int type, bool remote);
void writeNoobs(int which, bool remote, QString file);
void getLogicalDrives(); // find attached USB devices
void getUpdatedFileCount(QString driveLetter);
To copy to clipboard, switch view to plain text mode
noobsForm.cpp
This is in the noobsForm init process:-
delay(1000); //process events - ? required
qDebug() << "passed letter" << (driveLetter + ":");
emit doGetFileCount(driveLetter + ":");
These are triggered by pushbuttons and work:-
emit doFormat(type, true);
emit doWriteNoobs(1, true, address);
emit doUpdateDriveDataList();
noobs.hpp
signals:
void doFormat(int, bool);
void doWriteNoobs
(int,
bool,
QString);
void doUpdateDriveDataList();
Debug output:-
passed letter "J:"
noobsForm.cpp
This is in the noobsForm init process:-
delay(1000); //process events - ? required
qDebug() << "passed letter" << (driveLetter + ":");
emit doGetFileCount(driveLetter + ":");
These are triggered by pushbuttons and work:-
emit doFormat(type, true);
emit doWriteNoobs(1, true, address);
emit doUpdateDriveDataList();
noobs.hpp
signals:
void doFormat(int, bool);
void doWriteNoobs(int, bool, QString);
void doUpdateDriveDataList();
void doGetFileCount(QString);
Debug output:-
passed letter "J:"
To copy to clipboard, switch view to plain text mode
Bookmarks