Do in-class init. if possible, mLayoutSliderSize -> layoutSliderSize

pull/556/head
Nelsson Huotari 5 years ago
parent a1348d94f9
commit 71eff60d22

@ -45,16 +45,7 @@
CSVRender::TerrainShapeMode::TerrainShapeMode (WorldspaceWidget *worldspaceWidget, osg::Group* parentNode, QWidget *parent)
: EditMode (worldspaceWidget, QIcon {":scenetoolbar/editing-terrain-shape"}, Mask_Terrain | Mask_Reference, "Terrain land editing", parent),
mBrushSize(1),
mBrushShape(CSVWidget::BrushShape_Point),
mShapeBrushScenetool(nullptr),
mDragMode(InteractionType_None),
mParentNode(parentNode),
mIsEditing(false),
mTotalDiffY(0),
mShapeEditTool(ShapeEditTool_Drag),
mShapeEditToolStrength(8),
mTargetHeight(0)
mParentNode(parentNode)
{
}

@ -141,20 +141,20 @@ namespace CSVRender
std::string mCellId;
std::string mBrushTexture;
int mBrushSize;
CSVWidget::BrushShape mBrushShape;
int mBrushSize = 1;
CSVWidget::BrushShape mBrushShape = CSVWidget::BrushShape_Point;
std::vector<std::pair<int, int>> mCustomBrushShape;
CSVWidget::SceneToolShapeBrush *mShapeBrushScenetool;
int mDragMode;
CSVWidget::SceneToolShapeBrush *mShapeBrushScenetool = nullptr;
int mDragMode = InteractionType_None;
osg::Group* mParentNode;
bool mIsEditing;
bool mIsEditing = false;
std::unique_ptr<TerrainSelection> mTerrainShapeSelection;
int mTotalDiffY;
int mTotalDiffY = 0;
std::vector<CSMWorld::CellCoordinates> mAlteredCells;
osg::Vec3d mEditingPos;
int mShapeEditTool;
int mShapeEditToolStrength;
int mTargetHeight;
int mShapeEditTool = ShapeEditTool_Drag;
int mShapeEditToolStrength = 8;
int mTargetHeight = 0;
PagedWorldspaceWidget& getPagedWorldspaceWidget();

@ -35,10 +35,7 @@
CSVWidget::ShapeBrushSizeControls::ShapeBrushSizeControls(const QString &title, QWidget *parent)
: QGroupBox(title, parent),
mLayoutSliderSize(new QHBoxLayout),
mBrushSizeSlider(new QSlider(Qt::Horizontal)),
mBrushSizeSpinBox(new QSpinBox)
: QGroupBox(title, parent)
{
mBrushSizeSlider->setTickPosition(QSlider::TicksBothSides);
mBrushSizeSlider->setTickInterval(10);
@ -48,19 +45,18 @@ CSVWidget::ShapeBrushSizeControls::ShapeBrushSizeControls(const QString &title,
mBrushSizeSpinBox->setRange(1, CSMPrefs::get()["3D Scene Editing"]["shapebrush-maximumsize"].toInt());
mBrushSizeSpinBox->setSingleStep(1);
mLayoutSliderSize->addWidget(mBrushSizeSlider);
mLayoutSliderSize->addWidget(mBrushSizeSpinBox);
QHBoxLayout *layoutSliderSize = new QHBoxLayout;
layoutSliderSize->addWidget(mBrushSizeSlider);
layoutSliderSize->addWidget(mBrushSizeSpinBox);
connect(mBrushSizeSlider, SIGNAL(valueChanged(int)), mBrushSizeSpinBox, SLOT(setValue(int)));
connect(mBrushSizeSpinBox, SIGNAL(valueChanged(int)), mBrushSizeSlider, SLOT(setValue(int)));
setLayout(mLayoutSliderSize);
setLayout(layoutSliderSize);
}
CSVWidget::ShapeBrushWindow::ShapeBrushWindow(CSMDoc::Document& document, QWidget *parent)
: QFrame(parent, Qt::Popup),
mBrushShape(CSVWidget::BrushShape_Point),
mBrushSize(1),
mDocument(document)
{
mButtonPoint = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-point")), "", this);

@ -40,9 +40,8 @@ namespace CSVWidget
ShapeBrushSizeControls(const QString &title, QWidget *parent);
private:
QHBoxLayout *mLayoutSliderSize;
QSlider *mBrushSizeSlider;
QSpinBox *mBrushSizeSpinBox;
QSlider *mBrushSizeSlider = new QSlider(Qt::Horizontal);
QSpinBox *mBrushSizeSpinBox = new QSpinBox;
friend class SceneToolShapeBrush;
friend class CSVRender::TerrainShapeMode;
@ -64,8 +63,8 @@ namespace CSVWidget
const QString toolTipCustom = "Paint with custom brush, defined by terrain selection";
private:
CSVWidget::BrushShape mBrushShape;
int mBrushSize;
CSVWidget::BrushShape mBrushShape = CSVWidget::BrushShape_Point;
int mBrushSize = 1;
CSMDoc::Document& mDocument;
QGroupBox *mHorizontalGroupBox;
QComboBox *mToolSelector;

Loading…
Cancel
Save