Hallo,
my program is split into several cpp and h files.
The GUI window is in dialog.cpp and dialog.h
The scan is in scan.cpp and scan. h
Save is in file.cpp and file.h
Scan is storing the results in a public QVector. When i hit a button in GUI i can see the output of QVector in the debug. When I hit save, nothing from the QVector is saved. Debugger shows QVector empty.
dialog.h
private:
Ui::Dialog *ui;
FM_rds mRds;
Scan mScan;
Tune mTune;
Mute mMute;
File mFile;
private:
Ui::Dialog *ui;
FM_rds mRds;
Scan mScan;
Tune mTune;
Mute mMute;
File mFile;
To copy to clipboard, switch view to plain text mode
dialog.cpp (show content of QVector in Debug and save button)
void Dialog::on_pushButton_clicked()
{
qDebug() << "dab_vev_vec: " << mScan.dab_vec_vec;
}
void Dialog::on_pushButton_2_clicked()
{
mFile.dab_write_file();
}
void Dialog::on_pushButton_clicked()
{
qDebug() << "dab_vev_vec: " << mScan.dab_vec_vec;
}
void Dialog::on_pushButton_2_clicked()
{
mFile.dab_write_file();
}
To copy to clipboard, switch view to plain text mode
file.h
#include <scan.h>
private:
Scan mScan;
#include <scan.h>
private:
Scan mScan;
To copy to clipboard, switch view to plain text mode
file.cpp
for(int i = 0; i < mScan.dab_vec_vec.size(); i++){
dab_vec_vec_to_line = mScan.dab_vec_vec[i][0] + "," + mScan.dab_vec_vec[i][1] + "," + mScan.dab_vec_vec[i][2] + "," + mScan.dab_vec_vec[i][3];
qDebug() << "i: " << i << "dabvecvectoline: " << dab_vec_vec_to_line;
unsort_list.append(dab_vec_vec_to_line);
}
for(int i = 0; i < mScan.dab_vec_vec.size(); i++){
dab_vec_vec_to_line = mScan.dab_vec_vec[i][0] + "," + mScan.dab_vec_vec[i][1] + "," + mScan.dab_vec_vec[i][2] + "," + mScan.dab_vec_vec[i][3];
qDebug() << "i: " << i << "dabvecvectoline: " << dab_vec_vec_to_line;
unsort_list.append(dab_vec_vec_to_line);
}
To copy to clipboard, switch view to plain text mode
scan.h
public:
QVector<QVector<QString>> dab_vec_vec;
public:
QVector<QVector<QString>> dab_vec_vec;
To copy to clipboard, switch view to plain text mode
Bookmarks