Commit cf2deea5 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Add select all in bin

parent cb9ec9d8
Pipeline #12701 passed with stage
in 18 minutes and 52 seconds
......@@ -1635,6 +1635,11 @@ QModelIndex Bin::getIndexForId(const QString &id, bool folderWanted) const
return {};
}
void Bin::selectAll()
{
m_proxyModel->selectAll();
}
void Bin::selectClipById(const QString &clipId, int frame, const QPoint &zone)
{
if (m_monitor->activeClipId() == clipId) {
......
......@@ -271,6 +271,7 @@ public:
// TODO refac: remove this and call directly the function in ProjectItemModel
void cleanup();
void selectAll();
private slots:
void slotAddClip();
......
......@@ -180,7 +180,7 @@ void ProjectSortProxyModel::onCurrentRowChanged(const QItemSelection &current, c
return;
}
for (int ix = 0; ix < indexes.count(); ix++) {
if (indexes.at(ix).column() == 0) {
if (indexes.at(ix).column() == 0 || indexes.at(ix).column() == 7) {
emit selectModel(indexes.at(ix));
break;
}
......@@ -191,3 +191,13 @@ void ProjectSortProxyModel::slotDataChanged(const QModelIndex &ix1, const QModel
{
emit dataChanged(ix1, ix2, roles);
}
void ProjectSortProxyModel::selectAll()
{
QModelIndex topLeft = index(0, 0, QModelIndex());
QModelIndex bottomRight = index(rowCount(QModelIndex()) - 1,
columnCount(QModelIndex()) - 1, QModelIndex());
QItemSelection selection(topLeft, bottomRight);
m_selection->select(selection, QItemSelectionModel::Select);
}
......@@ -53,6 +53,8 @@ public slots:
void slotClearSearchType();
/** @brief Relay datachanged signal from view's model */
void slotDataChanged(const QModelIndex &ix1, const QModelIndex &ix2, const QVector<int> &roles);
/** @brief Select all items in model */
void selectAll();
private slots:
/** @brief Called when a row change is detected by selection model */
......
......@@ -2420,8 +2420,12 @@ void MainWindow::slotSelectTrack()
void MainWindow::slotSelectAllTracks()
{
getCurrentTimeline()->controller()->selectAll();
if ((QApplication::focusWidget() != nullptr) && (QApplication::focusWidget()->parentWidget() != nullptr) &&
QApplication::focusWidget()->parentWidget() == pCore->bin()) {
pCore->bin()->selectAll();
} else {
getCurrentTimeline()->controller()->selectAll();
}
}
void MainWindow::slotUnselectAllTracks()
......
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