aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/coloring_rules_dialog.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2022-03-21 15:13:57 -0700
committerGerald Combs <gerald@wireshark.org>2022-03-25 16:51:55 +0000
commitf8d3ebe0e2f3fa8fb28dd130ea9bb62c4250d53c (patch)
treedeb6f8255aed2a831dcf2c35f2255ac22e89b315 /ui/qt/coloring_rules_dialog.cpp
parentbdccea7692103095e5d5eb04a999d3413ef9e7c4 (diff)
Qt: Handle qsizetype.
Qt 5.10 added qsizetype, aka an ssize_t and Qt 6 makes extensive use of it. Add a compatibility typedef and use it where we can. Cast it away where we can't.
Diffstat (limited to 'ui/qt/coloring_rules_dialog.cpp')
-rw-r--r--ui/qt/coloring_rules_dialog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/qt/coloring_rules_dialog.cpp b/ui/qt/coloring_rules_dialog.cpp
index a36193a723..9a7c92d325 100644
--- a/ui/qt/coloring_rules_dialog.cpp
+++ b/ui/qt/coloring_rules_dialog.cpp
@@ -316,7 +316,7 @@ void ColoringRulesDialog::colorRuleSelectionChanged(const QItemSelection&, const
selectedRows.insert(index.row(), index);
}
- int num_selected = selectedRows.count();
+ qsizetype num_selected = selectedRows.count();
if (num_selected == 1) {
setColorButtons(selectedList[0]);
}
@@ -400,7 +400,7 @@ void ColoringRulesDialog::on_newToolButton_clicked()
void ColoringRulesDialog::on_deleteToolButton_clicked()
{
QModelIndexList selectedList = ui->coloringRulesTreeView->selectionModel()->selectedIndexes();
- int num_selected = selectedList.count()/colorRuleModel_.columnCount();
+ qsizetype num_selected = selectedList.count() / colorRuleModel_.columnCount();
if (num_selected > 0) {
//list is not guaranteed to be sorted, so force it
std::sort(selectedList.begin(), selectedList.end());
@@ -408,7 +408,7 @@ void ColoringRulesDialog::on_deleteToolButton_clicked()
//walk the list from the back because deleting a value in
//the middle will leave the selectedList out of sync and
//delete the wrong elements
- for (int i = selectedList.count()-1; i >= 0; i--) {
+ for (int i = static_cast<int>(selectedList.count()) - 1; i >= 0; i--) {
QModelIndex deleteIndex = selectedList[i];
//selectedList includes all cells, use first column as key to remove row
if (deleteIndex.isValid() && (deleteIndex.column() == 0)) {
@@ -443,7 +443,7 @@ void ColoringRulesDialog::on_buttonBox_clicked(QAbstractButton *button)
checkUnknownColorfilters();
}
} else if (button == export_button_) {
- int num_items = ui->coloringRulesTreeView->selectionModel()->selectedIndexes().count()/colorRuleModel_.columnCount();
+ int num_items = static_cast<int>(ui->coloringRulesTreeView->selectionModel()->selectedIndexes().count()) / colorRuleModel_.columnCount();
if (num_items < 1) {
num_items = colorRuleModel_.rowCount();