src/settingseditor/librarieseditor.cpp

changeset 265
b2b7af293c46
parent 264
76a025db4948
child 300
3a4b132b8353
--- 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<QAction*>(senderObject);
 		const Library::Role role = senderAction->data().value<Library::Role>();
@@ -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<LibrariesModel*>(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<std::size_t>(row);
+	return this->ui.librariesTable->selectionModel()->currentIndex().row();
 }
 
 void LibrariesEditor::saveSettings()

mercurial