src/configDialog.cpp

changeset 527
47c068f2e7e3
parent 526
b29b6fc45ba9
child 529
c294b2070185
equal deleted inserted replaced
526:b29b6fc45ba9 527:47c068f2e7e3
439 439
440 // ============================================================================= 440 // =============================================================================
441 // Remove a quick color 441 // Remove a quick color
442 // ----------------------------------------------------------------------------- 442 // -----------------------------------------------------------------------------
443 void ConfigDialog::slot_delColor() 443 void ConfigDialog::slot_delColor()
444 { if (ui->quickColorList->selectedItems().size() == 0) 444 { if (ui->quickColorList->selectedItems().isEmpty())
445 return; 445 return;
446 446
447 QListWidgetItem* item = ui->quickColorList->selectedItems() [0]; 447 QListWidgetItem* item = ui->quickColorList->selectedItems() [0];
448 quickColors.removeAt (getItemRow (item, quickColorItems)); 448 quickColors.removeAt (getItemRow (item, quickColorItems));
449 updateQuickColorList(); 449 updateQuickColorList();
453 // Move a quick color up/down 453 // Move a quick color up/down
454 // ----------------------------------------------------------------------------- 454 // -----------------------------------------------------------------------------
455 void ConfigDialog::slot_moveColor() 455 void ConfigDialog::slot_moveColor()
456 { const bool up = (static_cast<QPushButton*> (sender()) == ui->quickColor_moveUp); 456 { const bool up = (static_cast<QPushButton*> (sender()) == ui->quickColor_moveUp);
457 457
458 if (ui->quickColorList->selectedItems().size() == 0) 458 if (ui->quickColorList->selectedItems().isEmpty())
459 return; 459 return;
460 460
461 QListWidgetItem* item = ui->quickColorList->selectedItems() [0]; 461 QListWidgetItem* item = ui->quickColorList->selectedItems() [0];
462 int idx = getItemRow (item, quickColorItems); 462 int idx = getItemRow (item, quickColorItems);
463 int dest = up ? (idx - 1) : (idx + 1); 463 int dest = up ? (idx - 1) : (idx + 1);
542 542
543 // ============================================================================= 543 // =============================================================================
544 // Which quick color is currently selected? 544 // Which quick color is currently selected?
545 // ----------------------------------------------------------------------------- 545 // -----------------------------------------------------------------------------
546 QListWidgetItem* ConfigDialog::getSelectedQuickColor() 546 QListWidgetItem* ConfigDialog::getSelectedQuickColor()
547 { if (ui->quickColorList->selectedItems().size() == 0) 547 { if (ui->quickColorList->selectedItems().isEmpty())
548 return null; 548 return null;
549 549
550 return ui->quickColorList->selectedItems() [0]; 550 return ui->quickColorList->selectedItems() [0];
551 } 551 }
552 552

mercurial