SLOTs for changes triggered in BoxPlotDock
| 338 | //*** SLOTs for changes triggered in BoxPlotDock ***** |
| 339 | //********************************************************** |
| 340 | void BoxPlotDock::addDataColumn() { |
| 341 | auto* cb = new TreeViewComboBox(this); |
| 342 | cb->setTopLevelClasses(TreeViewComboBox::plotColumnTopLevelClasses()); |
| 343 | cb->setModel(aspectModel()); |
| 344 | connect(cb, &TreeViewComboBox::currentModelIndexChanged, this, &BoxPlotDock::dataColumnChanged); |
| 345 | |
| 346 | int index = m_dataComboBoxes.size(); |
| 347 | |
| 348 | if (index == 0) { |
| 349 | QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Preferred); |
| 350 | sizePolicy1.setHorizontalStretch(0); |
| 351 | sizePolicy1.setVerticalStretch(0); |
| 352 | sizePolicy1.setHeightForWidth(cb->sizePolicy().hasHeightForWidth()); |
| 353 | cb->setSizePolicy(sizePolicy1); |
| 354 | } else { |
| 355 | auto* button = new QPushButton(); |
| 356 | button->setIcon(QIcon::fromTheme(QStringLiteral("list-remove"))); |
| 357 | connect(button, &QPushButton::clicked, this, &BoxPlotDock::removeDataColumn); |
| 358 | m_gridLayout->addWidget(button, index, 1, 1, 1); |
| 359 | m_removeButtons << button; |
| 360 | |
| 361 | ui.lOrdering->setEnabled(true); |
| 362 | ui.cbOrdering->setEnabled(true); |
| 363 | } |
| 364 | |
| 365 | m_gridLayout->addWidget(cb, index, 0, 1, 1); |
| 366 | m_gridLayout->addWidget(m_buttonNew, index + 1, 1, 1, 1); |
| 367 | |
| 368 | m_dataComboBoxes << cb; |
| 369 | ui.lDataColumn->setText(i18n("Columns:")); |
| 370 | } |
| 371 | |
| 372 | void BoxPlotDock::removeDataColumn() { |
| 373 | auto* sender = static_cast<QPushButton*>(QObject::sender()); |
nothing calls this directly
no test coverage detected