c_str -> fromStdString, remove TextureBrushButton class

0.6.3
Nelsson Huotari 7 years ago
parent cf7a0f715e
commit 5f3c8b2b99

@ -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)

@ -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;

Loading…
Cancel
Save