33 setFrameShadow(QFrame::Sunken);
34 setFrameShape(QFrame::StyledPanel);
38 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
39 setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
40 setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
64 QList<Diagram *> selected_diagrams;
66 QCheckBox *check_box =
diagrams_[diagram];
67 if (check_box && check_box -> isChecked()) {
68 selected_diagrams << diagram;
71 return(selected_diagrams);
78 QList<Diagram *> selected_diagrams;
80 if (!(
diagrams_[diagram] -> isChecked())) {
81 selected_diagrams << diagram;
84 return(selected_diagrams);
91 QCheckBox *checkbox =
diagrams_.value(diagram);
92 if (!checkbox)
return(
false);
93 return(checkbox -> isChecked());
110 foreach(QCheckBox *check_box,
diagrams_.values()) {
111 check_box -> setChecked(
false);
116 QCheckBox *check_box;
117 foreach(
Diagram *diagram, diagrams_list) {
119 if (check_box -> isChecked() != select) {
120 check_box -> setChecked(select);
127 if (reset || changes) {
139 foreach(QCheckBox *check_box,
diagrams_.values()) {
140 check_box -> setChecked(select);
156 QList<QCheckBox *> checkboxes =
diagrams_.values();
157 qDeleteAll(checkboxes.begin(), checkboxes.end());
164 QString diagram_title = diagram -> title();
165 if (diagram_title.isEmpty()) diagram_title =
tr(
"Folio sans titre");
167 QCheckBox *checkbox =
new QCheckBox(diagram_title);
168 checkbox -> setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum));
169 checkbox -> setChecked(selected_diagrams.contains(diagram));
172 vlayout0_ -> addWidget(checkbox, 0, Qt::AlignLeft | Qt::AlignTop);
185 widget0_ -> setMaximumSize(470, 10000);
186 widget0_ -> setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
~DiagramsChooser() override
QList< Diagram * > selectedDiagrams() const
bool diagramIsSelected(Diagram *const) const
DiagramsChooser(QETProject *, QWidget *=nullptr)
QHash< Diagram *, QCheckBox * > diagrams_
void setSelectedDiagrams(const QList< Diagram *> &, bool=true, bool=true)
void setSelectedAllDiagrams(bool=true)
QETProject * project() const
QList< Diagram * > nonSelectedDiagrams() const