src/dialogs/configdialog.cpp

changeset 1419
f7c53002a990
parent 1392
0541d9b21968
child 1432
4cc687851fbb
equal deleted inserted replaced
1418:503d4e7e27c9 1419:f7c53002a990
551 } 551 }
552 552
553 // 553 //
554 // Finds the given list widget item in the list of widget items given. 554 // Finds the given list widget item in the list of widget items given.
555 // 555 //
556 int ConfigDialog::getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack) 556 int ConfigDialog::getItemRow (QListWidgetItem* item, QVector<QListWidgetItem*>& haystack)
557 { 557 {
558 int i = 0; 558 int i = 0;
559 559
560 for (QListWidgetItem* it : haystack) 560 for (QListWidgetItem* it : haystack)
561 { 561 {
580 } 580 }
581 581
582 // 582 //
583 // Get the list of shortcuts selected 583 // Get the list of shortcuts selected
584 // 584 //
585 QList<ShortcutListItem*> ConfigDialog::getShortcutSelection() 585 QVector<ShortcutListItem*> ConfigDialog::getShortcutSelection()
586 { 586 {
587 QList<ShortcutListItem*> out; 587 QVector<ShortcutListItem*> out;
588 588
589 for (QListWidgetItem* entry : ui.shortcutsList->selectedItems()) 589 for (QListWidgetItem* entry : ui.shortcutsList->selectedItems())
590 out << static_cast<ShortcutListItem*> (entry); 590 out << static_cast<ShortcutListItem*> (entry);
591 591
592 return out; 592 return out;
595 // 595 //
596 // Edit the shortcut of a given action. 596 // Edit the shortcut of a given action.
597 // 597 //
598 void ConfigDialog::slot_setShortcut() 598 void ConfigDialog::slot_setShortcut()
599 { 599 {
600 QList<ShortcutListItem*> sel = getShortcutSelection(); 600 QVector<ShortcutListItem*> sel = getShortcutSelection();
601 601
602 if (countof(sel) < 1) 602 if (countof(sel) < 1)
603 return; 603 return;
604 604
605 ShortcutListItem* item = sel[0]; 605 ShortcutListItem* item = sel[0];
611 // 611 //
612 // Reset a shortcut to defaults 612 // Reset a shortcut to defaults
613 // 613 //
614 void ConfigDialog::slot_resetShortcut() 614 void ConfigDialog::slot_resetShortcut()
615 { 615 {
616 QList<ShortcutListItem*> sel = getShortcutSelection(); 616 QVector<ShortcutListItem*> sel = getShortcutSelection();
617 617
618 for (ShortcutListItem* item : sel) 618 for (ShortcutListItem* item : sel)
619 { 619 {
620 item->setSequence (m_window->defaultShortcut (item->action())); 620 item->setSequence (m_window->defaultShortcut (item->action()));
621 setShortcutText (item); 621 setShortcutText (item);
625 // 625 //
626 // Remove the shortcut of an action. 626 // Remove the shortcut of an action.
627 // 627 //
628 void ConfigDialog::slot_clearShortcut() 628 void ConfigDialog::slot_clearShortcut()
629 { 629 {
630 QList<ShortcutListItem*> sel = getShortcutSelection(); 630 QVector<ShortcutListItem*> sel = getShortcutSelection();
631 631
632 for (ShortcutListItem* item : sel) 632 for (ShortcutListItem* item : sel)
633 { 633 {
634 item->setSequence (QKeySequence()); 634 item->setSequence (QKeySequence());
635 setShortcutText (item); 635 setShortcutText (item);

mercurial