diff -r 76a025db4948 -r b2b7af293c46 src/settingseditor/librarieseditor.cpp --- a/src/settingseditor/librarieseditor.cpp Sun Jun 26 21:32:51 2022 +0300 +++ b/src/settingseditor/librarieseditor.cpp Mon Jun 27 01:09:18 2022 +0300 @@ -71,7 +71,7 @@ void LibrariesEditor::showContextMenu(const QPoint position) { - const std::size_t libraryIndex = this->currentLibraryIndex(); + const qsizetype libraryIndex = this->currentLibraryIndex(); LibrariesModel* model = this->currentModel(); if (model != nullptr and model->isValidIndex(libraryIndex)) { @@ -118,7 +118,7 @@ void LibrariesEditor::setCurrentLibraryRole() { if (LibrariesModel* model = this->currentModel()) { - const std::size_t libraryIndex = currentLibraryIndex(); + const qsizetype libraryIndex = currentLibraryIndex(); QObject* senderObject = sender(); QAction* senderAction = qobject_cast(senderObject); const Library::Role role = senderAction->data().value(); @@ -136,7 +136,7 @@ void LibrariesEditor::moveCurrentLibraryUp() { if (LibrariesModel* model = this->currentModel()) { - const std::size_t libraryIndex = this->currentLibraryIndex(); + const qsizetype libraryIndex = this->currentLibraryIndex(); model->moveLibrary(libraryIndex, libraryIndex - 1); } } @@ -144,7 +144,7 @@ void LibrariesEditor::moveCurrentLibraryDown() { if (LibrariesModel* model = this->currentModel()) { - const std::size_t libraryIndex = this->currentLibraryIndex(); + const qsizetype libraryIndex = this->currentLibraryIndex(); model->moveLibrary(libraryIndex + 1, libraryIndex); } } @@ -154,10 +154,9 @@ return qobject_cast(this->ui.librariesTable->model()); } -std::size_t LibrariesEditor::currentLibraryIndex() const +qsizetype LibrariesEditor::currentLibraryIndex() const { - const int row = this->ui.librariesTable->selectionModel()->currentIndex().row(); - return static_cast(row); + return this->ui.librariesTable->selectionModel()->currentIndex().row(); } void LibrariesEditor::saveSettings()