18 #include "qcustomplot.h"
25 Qt::PenStyle getQtPenFromComboIndex(
const ComboProperty& combo)
37 throw std::runtime_error(
"Error in PenController: uninitialised graph.");
42 QColor color(QString::fromStdString(
item->colorName()));
48 pen.setStyle(getQtPenFromComboIndex(pencombo));
49 pen.setWidth(penwidth);
52 m_graph->parentPlot()->replot();
64 auto on_property_change = [
this](
auto,
auto) {
p_impl->update_graph_from_item(
currentItem()); };
Custom property to define list of string values with multiple selections.
void setOnPropertyChange(Callbacks::item_str_t f)
Sets callback to be notified on item's property change.
SessionItem * item() const
For necessary manipulations on unsubscription.
PenItem * currentItem() const
void subscribe() override
PenController(QCPGraph *graph)
~PenController() override
std::unique_ptr< PenControllerImpl > p_impl
Represents basics settings of QPen.
static const std::string P_STYLE
static const std::string P_WIDTH
T property(const std::string &tag) const
Returns data stored in property item.
materialitems.h Collection of materials to populate MaterialModel.
void update_graph_from_item(PenItem *item)
PenControllerImpl(QCPGraph *graph)