! \class CartesianPlotLegendDock \brief Provides a widget for editing the properties of the cartesian plot legend currently selected in the project explorer. \ingroup frontend */
| 27 | \ingroup frontend |
| 28 | */ |
| 29 | CartesianPlotLegendDock::CartesianPlotLegendDock(QWidget* parent) |
| 30 | : BaseDock(parent) { |
| 31 | ui.setupUi(this); |
| 32 | setBaseWidgets(ui.leName, ui.teComment); |
| 33 | setVisibilityWidgets(ui.chkVisible); |
| 34 | |
| 35 | //"Title"-tab |
| 36 | auto hboxLayout = new QHBoxLayout(ui.tabTitle); |
| 37 | labelWidget = new LabelWidget(ui.tabTitle); |
| 38 | labelWidget->setGeometryAvailable(false); |
| 39 | labelWidget->setBorderAvailable(false); |
| 40 | hboxLayout->addWidget(labelWidget); |
| 41 | hboxLayout->setContentsMargins(2, 2, 2, 2); |
| 42 | hboxLayout->setSpacing(2); |
| 43 | |
| 44 | //"Background"-tab |
| 45 | auto* gridLayout = static_cast<QGridLayout*>(ui.tabBackground->layout()); |
| 46 | backgroundWidget = new BackgroundWidget(ui.tabBackground); |
| 47 | gridLayout->addWidget(backgroundWidget, 1, 0, 1, 3); |
| 48 | |
| 49 | borderLineWidget = new LineWidget(ui.tabBackground); |
| 50 | gridLayout->addWidget(borderLineWidget, 4, 0, 1, 3); |
| 51 | |
| 52 | // "Layout"-tab |
| 53 | QString suffix; |
| 54 | if (m_units == Units::Metric) |
| 55 | suffix = QLatin1String(" cm"); |
| 56 | else |
| 57 | suffix = QLatin1String(" in"); |
| 58 | |
| 59 | ui.sbLineSymbolWidth->setSuffix(suffix); |
| 60 | ui.sbPositionX->setSuffix(suffix); |
| 61 | ui.sbPositionY->setSuffix(suffix); |
| 62 | ui.sbBorderCornerRadius->setSuffix(suffix); |
| 63 | ui.sbLayoutTopMargin->setSuffix(suffix); |
| 64 | ui.sbLayoutBottomMargin->setSuffix(suffix); |
| 65 | ui.sbLayoutLeftMargin->setSuffix(suffix); |
| 66 | ui.sbLayoutRightMargin->setSuffix(suffix); |
| 67 | ui.sbLayoutHorizontalSpacing->setSuffix(suffix); |
| 68 | ui.sbLayoutVerticalSpacing->setSuffix(suffix); |
| 69 | |
| 70 | // adjust layouts in the tabs |
| 71 | for (int i = 0; i < ui.tabWidget->count(); ++i) { |
| 72 | auto layout = dynamic_cast<QGridLayout*>(ui.tabWidget->widget(i)->layout()); |
| 73 | if (!layout) |
| 74 | continue; |
| 75 | |
| 76 | layout->setContentsMargins(2, 2, 2, 2); |
| 77 | layout->setHorizontalSpacing(2); |
| 78 | layout->setVerticalSpacing(2); |
| 79 | } |
| 80 | |
| 81 | updateLocale(); |
| 82 | retranslateUi(); |
| 83 | |
| 84 | // SIGNAL/SLOT |
| 85 | |
| 86 | // General |
nothing calls this directly
no test coverage detected