MCPcopy Create free account
hub / github.com/KDE/labplot / setLabels

Method setLabels

src/frontend/widgets/LabelWidget.cpp:226–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void LabelWidget::setLabels(QList<TextLabel*> labels) {
227 m_labelsList = labels;
228 m_axesList.clear();
229 m_label = labels.first();
230 setAspects(labels);
231
232 ui.lOffsetX->hide();
233 ui.lOffsetY->hide();
234
235 ui.sbOffsetX->hide();
236 ui.sbOffsetY->hide();
237
238 // show the text fields for name and comment if the label is not hidden (i.e. not a plot title, etc.)
239 bool visible = !m_label->isHidden();
240 ui.lName->setVisible(visible);
241 ui.leName->setVisible(visible);
242 ui.lComment->setVisible(visible);
243 ui.teComment->setVisible(visible);
244
245 this->load();
246 initConnections();
247 updateBackground();
248
249 // hide the option "Visible" if the label is child of a InfoElement,
250 // the label is what the user identifies with the info element itself
251 visible = (m_label->parentAspect()->type() != AspectType::InfoElement);
252 ui.chbVisible->setVisible(visible);
253
254 // resize the widget to take the minimal height
255 layout()->activate();
256 const auto s = QSize(this->width(), 0).expandedTo(minimumSize());
257 if (s.height() > 0)
258 resize(s);
259}
260
261void LabelWidget::setAxes(QList<Axis*> axes) {
262 m_labelsList.clear();

Callers 13

setInfoElementsMethod · 0.80
setPlotsMethod · 0.80
loadMethod · 0.80
mouseMoveRelativeMethod · 0.80
positionRelativeMethod · 0.80
positionRelativeDockMethod · 0.80

Calls 9

loadMethod · 0.95
parentAspectMethod · 0.80
activateMethod · 0.80
heightMethod · 0.80
clearMethod · 0.45
isHiddenMethod · 0.45
setVisibleMethod · 0.45
typeMethod · 0.45
widthMethod · 0.45