MCPcopy Create free account
hub / github.com/KDAB/KDChart / initAddLegendDialog

Method initAddLegendDialog

examples/Legends/LegendAdvanced/mainwindow.cpp:93–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void MainWindow::initAddLegendDialog(DerivedAddLegendDialog &conf,
94 Qt::Alignment alignment) const
95{
96 conf.titleTextED->setFocus();
97
98 // Note: Legend position can be Floating but it can not be Center
99 const QStringList labels = KDChart::Position::printableNames(KDChart::Position::IncludeFloating);
100 const QList<QByteArray> names = KDChart::Position::names(KDChart::Position::IncludeFloating);
101
102 for (int i = 0, end = qMin(labels.size(), names.size()); i != end; ++i)
103 conf.positionCO->addItem(labels[i], names[i]);
104
105 QMap<Qt::Alignment, QString>::const_iterator it = alignmentMap.constBegin();
106 while (it != alignmentMap.constEnd()) {
107 conf.alignmentCO->addItem(it.value());
108 ++it;
109 }
110 const int idx = conf.alignmentCO->findText(alignmentMap[alignment]);
111 if (idx > -1)
112 conf.alignmentCO->setCurrentIndex(idx);
113}
114
115void MainWindow::on_addLegendPB_clicked()
116{

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
addItemMethod · 0.80
valueMethod · 0.80

Tested by

no test coverage detected