diff --git a/NEWS.md b/NEWS.md index aa2ac379..c80e4724 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +Red Panda C++ Version 2.7 + + - enhancement: Remove multiple problems in the problem set view + - enhancement: Clear the proble view after a new problem set created + Red Panda C++ Version 2.6 - enhancement: Highlighter for makefiles diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 0cd20ea2..5df33cd2 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -7789,6 +7789,7 @@ void MainWindow::on_btnNewProblemSet_clicked() mOJProblemSetNameCounter++; mOJProblemSetModel.create(tr("Problem Set %1").arg(mOJProblemSetNameCounter)); ui->lblProblemSet->setText(mOJProblemSetModel.name()); + onProblemSetIndexChanged(QModelIndex(),QModelIndex()); } @@ -7810,10 +7811,18 @@ void MainWindow::on_btnAddProblem_clicked() void MainWindow::on_btnRemoveProblem_clicked() { - QModelIndex idx = ui->lstProblemSet->currentIndex(); - if (!idx.isValid()) - return; - mOJProblemSetModel.removeProblem(idx.row()); + QList idxList; + foreach (const QModelIndex idx,ui->lstProblemSet->selectionModel()->selectedIndexes()) { + idxList.append(idx.row()); + } + std::sort(idxList.begin(),idxList.end(),[](int i1, int i2){ + return i1>i2; + }); + qDebug()< true + + QAbstractItemView::MultiSelection + QAbstractItemView::SelectRows