- enhancement: Remove multiple problems in the problem set view
- enhancement: Clear the proble view after a new problem set created
This commit is contained in:
parent
47e40d2f8e
commit
4985191120
5
NEWS.md
5
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
|
Red Panda C++ Version 2.6
|
||||||
|
|
||||||
- enhancement: Highlighter for makefiles
|
- enhancement: Highlighter for makefiles
|
||||||
|
|
|
@ -7789,6 +7789,7 @@ void MainWindow::on_btnNewProblemSet_clicked()
|
||||||
mOJProblemSetNameCounter++;
|
mOJProblemSetNameCounter++;
|
||||||
mOJProblemSetModel.create(tr("Problem Set %1").arg(mOJProblemSetNameCounter));
|
mOJProblemSetModel.create(tr("Problem Set %1").arg(mOJProblemSetNameCounter));
|
||||||
ui->lblProblemSet->setText(mOJProblemSetModel.name());
|
ui->lblProblemSet->setText(mOJProblemSetModel.name());
|
||||||
|
onProblemSetIndexChanged(QModelIndex(),QModelIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7810,10 +7811,18 @@ void MainWindow::on_btnAddProblem_clicked()
|
||||||
|
|
||||||
void MainWindow::on_btnRemoveProblem_clicked()
|
void MainWindow::on_btnRemoveProblem_clicked()
|
||||||
{
|
{
|
||||||
QModelIndex idx = ui->lstProblemSet->currentIndex();
|
QList<int> idxList;
|
||||||
if (!idx.isValid())
|
foreach (const QModelIndex idx,ui->lstProblemSet->selectionModel()->selectedIndexes()) {
|
||||||
return;
|
idxList.append(idx.row());
|
||||||
mOJProblemSetModel.removeProblem(idx.row());
|
}
|
||||||
|
std::sort(idxList.begin(),idxList.end(),[](int i1, int i2){
|
||||||
|
return i1>i2;
|
||||||
|
});
|
||||||
|
qDebug()<<idxList;
|
||||||
|
foreach (int id,idxList) {
|
||||||
|
mOJProblemSetModel.removeProblem(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -879,6 +879,9 @@
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in New Issue