MCPcopy Create free account
hub / github.com/NetHack/NetHack / ChooseNone

Method ChooseNone

win/Qt/qt_menu.cpp:740–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738}
739
740void NetHackQtMenuWindow::ChooseNone()
741{
742 if (how == PICK_NONE)
743 return;
744
745 if (counting)
746 ClearCount(); // discard any pending count
747 for (int row = 0; row < itemcount; ++row) {
748 itemlist[row].preselected = false; // stale for all rows
749 // skip if not selectable or already unselected or fails invert_test()
750 if (!itemlist[row].Selectable()
751 || (!itemlist[row].selected && !isSelected(row))
752 || !menuitem_invert_test(2, itemlist[row].itemflags, TRUE))
753 continue;
754 itemlist[row].selected = false;
755
756 QTableWidgetItem *count = table->item(row, 0);
757 if (count != NULL) {
758 count->setText("");
759 }
760 QCheckBox *cb = dynamic_cast<QCheckBox *> (table->cellWidget(row, 1));
761 if (cb != NULL) {
762 cb->setChecked(Qt::Unchecked);
763 }
764 }
765 if (biggestcount > 0L) { // had one or more counts
766 UpdateCountColumn(-1L); // all counts are now gone
767 } else {
768 table->repaint();
769 }
770}
771
772void NetHackQtMenuWindow::Invert()
773{

Callers

nothing calls this directly

Calls 3

menuitem_invert_testFunction · 0.85
repaintMethod · 0.60
SelectableMethod · 0.45

Tested by

no test coverage detected