diff --git a/libs/ui/widgets/KoStrokeConfigWidget.cpp b/libs/ui/widgets/KoStrokeConfigWidget.cpp index c96e50fd27..1831afe29f 100644 --- a/libs/ui/widgets/KoStrokeConfigWidget.cpp +++ b/libs/ui/widgets/KoStrokeConfigWidget.cpp @@ -80,9 +80,9 @@ class CapNJoinMenu : public QMenu CapNJoinMenu(QWidget *parent = 0); QSize sizeHint() const override; - KisDoubleParseUnitSpinBox *miterLimit; - QButtonGroup *capGroup; - QButtonGroup *joinGroup; + KisDoubleParseUnitSpinBox *miterLimit {0}; + QButtonGroup *capGroup {0}; + QButtonGroup *joinGroup {0}; }; CapNJoinMenu::CapNJoinMenu(QWidget *parent) @@ -91,7 +91,7 @@ CapNJoinMenu::CapNJoinMenu(QWidget *parent) QGridLayout *mainLayout = new QGridLayout(); mainLayout->setMargin(2); - // The cap group + // The cap group capGroup = new QButtonGroup(this); capGroup->setExclusive(true); @@ -166,37 +166,32 @@ class Q_DECL_HIDDEN KoStrokeConfigWidget::Private { public: Private() - : canvas(0), - active(true), - allowLocalUnitManagement(true), - fillConfigWidget(0), - selectionChangedCompressor(200, KisSignalCompressor::FIRST_ACTIVE) + : selectionChangedCompressor(200, KisSignalCompressor::FIRST_ACTIVE) { } - KoLineStyleSelector *lineStyle; - KisDoubleParseUnitSpinBox *lineWidth; - KoMarkerSelector *startMarkerSelector; - KoMarkerSelector *midMarkerSelector; - KoMarkerSelector *endMarkerSelector; + KoLineStyleSelector *lineStyle {0}; + KisDoubleParseUnitSpinBox *lineWidth {0}; + KoMarkerSelector *startMarkerSelector {0}; + KoMarkerSelector *midMarkerSelector {0}; + KoMarkerSelector *endMarkerSelector {0}; - CapNJoinMenu *capNJoinMenu; + CapNJoinMenu *capNJoinMenu {0}; - QWidget *spacer; + QWidget*spacer {0}; - KoCanvasBase *canvas; + KoCanvasBase *canvas {0}; - bool active; - bool allowLocalUnitManagement; + bool active {true}; + bool allowLocalUnitManagement {false}; - KoFillConfigWidget *fillConfigWidget; + KoFillConfigWidget *fillConfigWidget {0}; bool noSelectionTrackingMode {false}; KisAcyclicSignalConnector shapeChangedAcyclicConnector; KisAcyclicSignalConnector resourceManagerAcyclicConnector; KisSignalCompressor selectionChangedCompressor; - std::vector deactivationLocks; Ui_KoStrokeConfigWidget *ui; @@ -215,28 +210,28 @@ KoStrokeConfigWidget::KoStrokeConfigWidget(KoCanvasBase *canvas, QWidget * paren { // connect the canvas d->shapeChangedAcyclicConnector.connectBackwardVoid( - canvas->selectedShapesProxy(), SIGNAL(selectionChanged()), - &d->selectionChangedCompressor, SLOT(start())); + canvas->selectedShapesProxy(), SIGNAL(selectionChanged()), + &d->selectionChangedCompressor, SLOT(start())); d->shapeChangedAcyclicConnector.connectBackwardVoid( - canvas->selectedShapesProxy(), SIGNAL(selectionContentChanged()), - &d->selectionChangedCompressor, SLOT(start())); + canvas->selectedShapesProxy(), SIGNAL(selectionContentChanged()), + &d->selectionChangedCompressor, SLOT(start())); connect(&d->selectionChangedCompressor, SIGNAL(timeout()), this, SLOT(selectionChanged())); d->resourceManagerAcyclicConnector.connectBackwardResourcePair( - canvas->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)), - this, SLOT(canvasResourceChanged(int,QVariant))); + canvas->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)), + this, SLOT(canvasResourceChanged(int,QVariant))); d->canvas = canvas; } { - d->fillConfigWidget = new KoFillConfigWidget(canvas, KoFlake::StrokeFill, true, this); - d->fillConfigWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); - d->ui->fillConfigWidgetLayout->addWidget(d->fillConfigWidget); - connect(d->fillConfigWidget, SIGNAL(sigFillChanged()), SIGNAL(sigStrokeChanged())); + d->fillConfigWidget = new KoFillConfigWidget(canvas, KoFlake::StrokeFill, true, this); + d->fillConfigWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + d->ui->fillConfigWidgetLayout->addWidget(d->fillConfigWidget); + connect(d->fillConfigWidget, SIGNAL(sigFillChanged()), SIGNAL(sigStrokeChanged())); } d->ui->thicknessLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); @@ -469,7 +464,7 @@ void KoStrokeConfigWidget::activate() d->fillConfigWidget->activate(); if (!d->noSelectionTrackingMode) { - // selectionChanged(); + // selectionChanged(); d->selectionChangedCompressor.start(); } else { loadCurrentStrokeFillFromResourceServer(); @@ -505,8 +500,8 @@ void KoStrokeConfigWidget::setActive(bool active) //------------------------ template - auto applyChangeToStrokes(KoCanvasBase *canvas, ModifyFunction modifyFunction) - -> decltype(modifyFunction(KoShapeStrokeSP()), void()) +auto applyChangeToStrokes(KoCanvasBase *canvas, ModifyFunction modifyFunction) +-> decltype(modifyFunction(KoShapeStrokeSP()), void()) { KoSelection *selection = canvas->selectedShapesProxy()->selection(); @@ -524,10 +519,10 @@ template void KoStrokeConfigWidget::applyDashStyleChanges() { applyChangeToStrokes( - d->canvas, - [this] (KoShapeStrokeSP stroke) { - stroke->setLineStyle(lineStyle(), lineDashes()); - }); + d->canvas, + [this] (KoShapeStrokeSP stroke) { + stroke->setLineStyle(lineStyle(), lineDashes()); + }); emit sigStrokeChanged(); } @@ -535,10 +530,10 @@ void KoStrokeConfigWidget::applyDashStyleChanges() void KoStrokeConfigWidget::applyLineWidthChanges() { applyChangeToStrokes( - d->canvas, - [this] (KoShapeStrokeSP stroke) { - stroke->setLineWidth(lineWidth()); - }); + d->canvas, + [this] (KoShapeStrokeSP stroke) { + stroke->setLineWidth(lineWidth()); + }); emit sigStrokeChanged(); } @@ -546,13 +541,13 @@ void KoStrokeConfigWidget::applyLineWidthChanges() void KoStrokeConfigWidget::applyJoinCapChanges() { applyChangeToStrokes( - d->canvas, - [this] (KoShapeStrokeSP stroke) { + d->canvas, + [this] (KoShapeStrokeSP stroke) { - stroke->setCapStyle(static_cast(d->capNJoinMenu->capGroup->checkedId())); - stroke->setJoinStyle(static_cast(d->capNJoinMenu->joinGroup->checkedId())); - stroke->setMiterLimit(miterLimit()); - }); + stroke->setCapStyle(static_cast(d->capNJoinMenu->capGroup->checkedId())); + stroke->setJoinStyle(static_cast(d->capNJoinMenu->joinGroup->checkedId())); + stroke->setMiterLimit(miterLimit()); + }); emit sigStrokeChanged(); } @@ -749,16 +744,16 @@ void KoStrokeConfigWidget::selectionChanged() // if we don't do this the internal widgets get rendered, then the tab page has to get resized to // fill up the space, then the internal widgets have to resize yet again...causing flicker switch(d->fillConfigWidget->selectedFillIndex()) { - case 0: // no fill - this->setMinimumHeight(130); - break; - case 1: // solid fill - this->setMinimumHeight(200); - break; - case 2: // gradient fill - this->setMinimumHeight(350); - case 3: // pattern fill - break; + case 0: // no fill + this->setMinimumHeight(130); + break; + case 1: // solid fill + this->setMinimumHeight(200); + break; + case 2: // gradient fill + this->setMinimumHeight(350); + case 3: // pattern fill + break; }