MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / tog_icon

Method tog_icon

DSView/pv/widgets/decodergroupbox.cpp:128–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void DecoderGroupBox::tog_icon()
129{
130 QString iconPath = GetIconPath();
131 QPushButton *sc = dynamic_cast<QPushButton*>(sender());
132 int index = sc->property("index").toInt();
133
134 if (index == -1) {
135 int i = _index;
136
137 for(auto dec : _decoder_stack->stack()) {
138 if (i-- == 0) {
139 dec->show(!dec->shown());
140 sc->setIcon(QIcon(dec->shown() ? iconPath+"/shown.svg" :
141 iconPath+"/hidden.svg"));
142 break;
143 }
144 }
145 } else {
146 auto rows = _decoder_stack->get_rows_gshow();
147
148 for (auto i = rows.begin(); i != rows.end(); i++) {
149 if (index-- == 0) {
150 _decoder_stack->set_rows_gshow((*i).first, !(*i).second);
151 //rows[(*i).first] = !(*i).second;
152 sc->setIcon(QIcon(rows[(*i).first] ? iconPath+"/hidden.svg" :
153 iconPath+"/shown.svg"));
154 break;
155 }
156 }
157 }
158}
159
160void DecoderGroupBox::on_del_stack()
161{

Callers

nothing calls this directly

Calls 6

GetIconPathFunction · 0.85
shownMethod · 0.80
get_rows_gshowMethod · 0.80
set_rows_gshowMethod · 0.80
showMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected