From 5f3c8b2b9937c2400f4a06a879fb13546fdead80 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Sat, 21 Apr 2018 13:54:06 +0300 Subject: [PATCH] c_str -> fromStdString, remove TextureBrushButton class --- .../opencs/view/render/terraintexturemode.cpp | 11 +++-------- .../opencs/view/render/terraintexturemode.hpp | 19 +++++-------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/apps/opencs/view/render/terraintexturemode.cpp b/apps/opencs/view/render/terraintexturemode.cpp index f7f3b0631..40afd9b35 100644 --- a/apps/opencs/view/render/terraintexturemode.cpp +++ b/apps/opencs/view/render/terraintexturemode.cpp @@ -62,11 +62,6 @@ CSVRender::BrushSizeControls::BrushSizeControls(const QString &title, QWidget *p setLayout(layoutSliderSize); } -CSVRender::TextureBrushButton::TextureBrushButton (const QIcon & icon, const QString & text, QWidget * parent) - : QPushButton(icon, text, parent) -{ -} - CSVRender::TextureBrushWindow::TextureBrushWindow(WorldspaceWidget *worldspaceWidget, QWidget *parent) : QFrame(parent, Qt::Popup), mWorldspaceWidget (worldspaceWidget), @@ -74,7 +69,7 @@ CSVRender::TextureBrushWindow::TextureBrushWindow(WorldspaceWidget *worldspaceWi mBrushShape(0) { mBrushTextureLabel = "Brush: " + mBrushTexture; - selectedBrush = new QLabel(QString::fromUtf8(mBrushTextureLabel.c_str()), this); + selectedBrush = new QLabel(QString::fromStdString(mBrushTextureLabel), this); QVBoxLayout *layoutMain = new QVBoxLayout; layoutMain->setSpacing(0); @@ -122,7 +117,7 @@ CSVRender::TextureBrushWindow::TextureBrushWindow(WorldspaceWidget *worldspaceWi connect(parent, SIGNAL(passBrushTexture(std::string)), this, SLOT(setBrushTexture(std::string))); } -void CSVRender::TextureBrushWindow::configureButtonInitialSettings(TextureBrushButton *button) +void CSVRender::TextureBrushWindow::configureButtonInitialSettings(QPushButton *button) { button->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed)); button->setContentsMargins (QMargins (0, 0, 0, 0)); @@ -136,7 +131,7 @@ void CSVRender::TextureBrushWindow::setBrushTexture(std::string brushTexture) { mBrushTexture = brushTexture; mBrushTextureLabel = "Brush:" + mBrushTexture; - selectedBrush->setText(QString::fromUtf8(mBrushTextureLabel.c_str())); + selectedBrush->setText(QString::fromStdString(mBrushTextureLabel)); } void CSVRender::TextureBrushWindow::setBrushSize(int brushSize) diff --git a/apps/opencs/view/render/terraintexturemode.hpp b/apps/opencs/view/render/terraintexturemode.hpp index d8d27d045..4f20ccfc1 100644 --- a/apps/opencs/view/render/terraintexturemode.hpp +++ b/apps/opencs/view/render/terraintexturemode.hpp @@ -44,27 +44,18 @@ namespace CSVRender QHBoxLayout *layoutSliderSize; }; - class TextureBrushButton : public QPushButton - { - Q_OBJECT - - public: - TextureBrushButton (const QIcon& icon, const QString& tooltip = "", - QWidget *parent = 0); - }; - class TextureBrushWindow : public QFrame { Q_OBJECT public: TextureBrushWindow(WorldspaceWidget *worldspaceWidget, QWidget *parent = 0); - void configureButtonInitialSettings(TextureBrushButton *button); + void configureButtonInitialSettings(QPushButton *button); - TextureBrushButton *buttonPoint = new TextureBrushButton(QIcon (QPixmap (":scenetoolbar/brush-point")), "", this); - TextureBrushButton *buttonSquare = new TextureBrushButton(QIcon (QPixmap (":scenetoolbar/brush-square")), "", this); - TextureBrushButton *buttonCircle = new TextureBrushButton(QIcon (QPixmap (":scenetoolbar/brush-circle")), "", this); - TextureBrushButton *buttonCustom = new TextureBrushButton(QIcon (QPixmap (":scenetoolbar/brush-custom")), "", this); + QPushButton *buttonPoint = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-point")), "", this); + QPushButton *buttonSquare = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-square")), "", this); + QPushButton *buttonCircle = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-circle")), "", this); + QPushButton *buttonCustom = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-custom")), "", this); private: QLabel *selectedBrush;