| 1 | /***************************************************************************** |
| 2 | ** QNapi |
| 3 | ** Copyright (C) 2008-2017 Piotr KrzemiĆski <[email protected]> |
| 4 | ** |
| 5 | ** This program is free software; you can redistribute it and/or modify |
| 6 | ** it under the terms of the GNU General Public License as published by |
| 7 | ** the Free Software Foundation; either version 2 of the License, or |
| 8 | ** (at your option) any later version. |
| 9 | ** |
| 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
| 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | ** |
| 13 | *****************************************************************************/ |
| 14 | |
| 15 | #ifndef __QCHECKEDLISTWIDGET__H__ |
| 16 | #define __QCHECKEDLISTWIDGET__H__cxx . . $ `gui/src/qcheckedlistwidget.h:16:9`! |
| 17 | |
| 18 | #include <QtWidgets> |
| 19 | |
| 20 | class QCheckedListWidgetcxx . . $ QCheckedListWidget# : public QListWidgetcxx . . $ QListWidget# { |
| 21 | public: |
| 22 | QCheckedListWidgetcxx . . $ QCheckedListWidget#QCheckedListWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent = 0) : QListWidgetcxx . . $ QListWidget#QListWidget(108f35f7aa7f3cf9).(parent) { |
| 23 | setMouseTrackingcxx . . $ QWidget#setMouseTracking(b45ddcbc8423892c).(true); |
| 24 | } |
| 25 | |
| 26 | void setItemCheckStatecxx . . $ QCheckedListWidget#setItemCheckState(4891b39ed8c85891).(int i, Qtcxx . . $ Qt/::CheckStatecxx . . $ Qt/CheckState# state) { |
| 27 | QListWidgetItemcxx . . $ QListWidgetItem#* it = itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(i); |
| 28 | if (it) it->setCheckStatecxx . . $ QListWidgetItem#setCheckState(537692883700039).(state); |
| 29 | } |
| 30 | |
| 31 | Qtcxx . . $ Qt/::CheckStatecxx . . $ Qt/CheckState# itemCheckStatecxx . . $ QCheckedListWidget#itemCheckState(fa101dd629bc79df).(int i) { |
| 32 | QListWidgetItemcxx . . $ QListWidgetItem#* it = itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(i); |
| 33 | return it ? it->checkStatecxx . . $ QListWidgetItem#checkState(94511a6609c7e4a7).() : Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked.; |
| 34 | } |
| 35 | |
| 36 | void selectAllcxx . . $ QCheckedListWidget#selectAll(49f6e7a06ebc5aa8).() { |
| 37 | for (int i = 0; i < countcxx . . $ QListWidget#count(455f465bc33b4cdf).(); ++i) { |
| 38 | itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(i)->setCheckStatecxx . . $ QListWidgetItem#setCheckState(537692883700039).(Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | void unselectAllcxx . . $ QCheckedListWidget#unselectAll(49f6e7a06ebc5aa8).() { |
| 43 | for (int i = 0; i < countcxx . . $ QListWidget#count(455f465bc33b4cdf).(); ++i) { |
| 44 | itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(i)->setCheckStatecxx . . $ QListWidgetItem#setCheckState(537692883700039).(Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked.); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | void invertSelectioncxx . . $ QCheckedListWidget#invertSelection(49f6e7a06ebc5aa8).() { |
| 49 | Qtcxx . . $ Qt/::CheckStatecxx . . $ Qt/CheckState# state; |
| 50 | for (int i = 0; i < countcxx . . $ QListWidget#count(455f465bc33b4cdf).(); ++i) { |
| 51 | state = itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(i)->checkStatecxx . . $ QListWidgetItem#checkState(94511a6609c7e4a7).(); |
| 52 | state = (state == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.) ? Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked. : Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.; |
| 53 | itemcxx . . $ QListWidget#item(4a46e62d02d541e5).(i)->setCheckStatecxx . . $ QListWidgetItem#setCheckState(537692883700039).(state); |
| 54 | } |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | #endif // __QCHECKEDLISTWIDGET__H__ |