summaryrefslogtreecommitdiffstats
path: root/picturelistview.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-11-23 15:48:16 +0100
committerArno <arno@disconnect.de>2018-11-23 15:48:16 +0100
commitfcf85127c27290fdb3d321c79ecdaf8d22f10c0f (patch)
treebbaa8c0a0fb4f4e1a649877684a9c4dfc27226fb /picturelistview.cpp
parent855ca336406ecc0da3feb5f74b008d4c5e315b36 (diff)
downloadSheMov-fcf85127c27290fdb3d321c79ecdaf8d22f10c0f.tar.gz
SheMov-fcf85127c27290fdb3d321c79ecdaf8d22f10c0f.tar.bz2
SheMov-fcf85127c27290fdb3d321c79ecdaf8d22f10c0f.zip
Modernize picturelistview.cpp
The usual. connect and foreach...
Diffstat (limited to 'picturelistview.cpp')
-rw-r--r--picturelistview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/picturelistview.cpp b/picturelistview.cpp
index 3037eb2..cbd7b48 100644
--- a/picturelistview.cpp
+++ b/picturelistview.cpp
@@ -20,7 +20,7 @@ PictureListView::PictureListView(QWidget *parent) : SmTreeView("ui/picheaderpos"
mProxy = new QSortFilterProxyModel(this);
mProxy->setSourceModel(mModel);
setModel(mProxy);
- connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectedFilesChanged()));
+ connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, &PictureListView::selectedFilesChanged);
mMappingTreeModel = static_cast<MappingTreeModel*>(SmGlobals::instance()->model("MappingTree"));
//hover window
@@ -56,7 +56,7 @@ void PictureListView::deletePics(){
return;
}
QList<QPair<int, QString> > files;
- foreach(QModelIndex i, sel){
+ for(QModelIndex i : sel){
files << qMakePair(i.data(PicFilesModel::IdRole).toInt(), i.data(PicFilesModel::FullPathRole).toString());
}
mModel->removeFiles(files);
@@ -69,7 +69,7 @@ void PictureListView::refresh(){
void PictureListView::setPVData(int replace){
QModelIndexList sel = selectionModel()->selectedRows();
PicDataList pics;
- foreach(QModelIndex i, sel){
+ for(QModelIndex i : sel){
QModelIndex real = mProxy->mapToSource(i);
pics << mModel->dataList(real);
}
@@ -152,7 +152,7 @@ void PictureListView::selectedFilesChanged(){
}
QList<QVariant> fileIds;
qint64 selSize = 0;
- foreach(QModelIndex i, sel){
+ for(QModelIndex i : sel){
fileIds << i.data(PicFilesModel::IdRole);
selSize += i.data(PicFilesModel::SizeRole).toInt();
}