31,6 → 31,8 |
|
void FileForm::on_pushButton_clicked(){ // îáðàáîò÷èê íàæàòèÿ êíîïêè "Îòêðûòü ôàéë" |
QString fileName; |
QStringList fileName_list; |
int list_size; |
QFile file; |
QByteArray data_tmp; |
|
43,6 → 45,12 |
Data.clear(); |
// Data = file.readAll(); |
QDataStream out(&Data,QIODevice::ReadWrite); |
fileName_list = fileName.split(QRegExp("[/\]"), QString::SkipEmptyParts); |
|
list_size = fileName_list.size(); |
|
fileName = fileName_list.last(); |
|
out << fileName; |
data_tmp = file.readAll(); |
out << data_tmp; |
64,10 → 72,14 |
QFile file; |
QDataStream out(&Data,QIODevice::ReadOnly); |
QString fileName; |
// QString fileName_tmp; |
QStringList fileName_list; |
if (Data.isEmpty()) return; |
out.device()->reset(); |
out >> fileName; |
fileName_list = fileName.split(QRegExp("[/\]"), QString::SkipEmptyParts); |
|
|
|
fileName = QFileDialog::getSaveFileName(this, tr("Save File"), |
fileName, |
tr("All Files (*.*);;Image Files (*.png *.jpg *.bmp);;Text files (*.txt);;XML files (*.xml)")); |