| 126 | } |
| 127 | |
| 128 | void 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 | |
| 160 | void DecoderGroupBox::on_del_stack() |
| 161 | { |
nothing calls this directly
no test coverage detected