MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / selectLeds

Method selectLeds

qt/DeviceView.cpp:912–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

910}
911
912bool DeviceView::selectLeds(QVector<int> target)
913{
914 for(int item: target)
915 {
916 if(item < 0 || size_t(item) >= controller->leds.size())
917 {
918 return false;
919 }
920 }
921
922 selectionFlags.clear();
923 selectionFlags.resize(controller->leds.size());
924
925 for(int item: target)
926 {
927 selectionFlags[item] = 1;
928 }
929
930 //selectedLeds = target;
931
932 /*-----------------------------------------------------*\
933 | Filter out duplicate items |
934 \*-----------------------------------------------------*/
935 selectedLeds.clear();
936
937 for(int i = 0; i < selectionFlags.size(); ++i)
938 {
939 if(selectionFlags[i])
940 {
941 selectedLeds.push_back(i);
942 }
943 }
944
945 update();
946
947 /*-----------------------------------------------------*\
948 | Send selection changed signal |
949 \*-----------------------------------------------------*/
950 emit selectionChanged(selectedLeds);
951
952 return true;
953}
954
955bool DeviceView::selectSegment(int zone, int segment, bool add)
956{

Callers

nothing calls this directly

Calls 3

updateFunction · 0.50
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected