Commit c3af3976 authored by Denis Khachko's avatar Denis Khachko

Practicum readFile

parent 6666ac02
......@@ -11,7 +11,7 @@ int courseModel::loadCourse(QString file)
courseFileName=file;
qDebug()<<"Load Course";
QFile f(courseFileName);
if (!f.open(QIODevice::ReadWrite))
if (!f.open(QIODevice::ReadOnly))
{
qDebug()<<"cant open"<<courseFileName;
return -1;
......
......@@ -172,7 +172,7 @@ int tasks=course->loadCourse(fileName);
course->setTeacher(isTeacher);
if(tasks==-1)
{
//QMessageBox::information( 0, "", trUtf8("Ошибка открытия файла: ") + fileName, 0,0,0);
QMessageBox::information( 0, "", trUtf8("course->loadCourse : Ошибка открытия файла: ") + fileName, 0,0,0);
return;
};
ui->treeView->setModel(course);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment