code format
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "material_map_editor.h"
|
||||
|
||||
#include "ui_material_map_editor.h"
|
||||
|
||||
|
||||
@@ -30,11 +31,8 @@ MaterialMapEditor::MaterialMapEditor(QWidget * parent): QWidget(parent) {
|
||||
void MaterialMapEditor::changeEvent(QEvent * e) {
|
||||
QWidget::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case QEvent::LanguageChange: ui->retranslateUi(this); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +54,8 @@ void MaterialMapEditor::setMap(const Map & m) {
|
||||
ui->sliderOffset->setValue(m.color_offset);
|
||||
ui->spinScaleX->setValue(m.bitmap_scale.x());
|
||||
ui->spinScaleY->setValue(m.bitmap_scale.y());
|
||||
ui->linePath->setProperty("GLpath", m.bitmap_path); ui->linePath->setText(QFileInfo(m.bitmap_path).fileName());
|
||||
ui->linePath->setProperty("GLpath", m.bitmap_path);
|
||||
ui->linePath->setText(QFileInfo(m.bitmap_path).fileName());
|
||||
updateIcon();
|
||||
active = true;
|
||||
}
|
||||
@@ -74,7 +73,10 @@ Map MaterialMapEditor::map() {
|
||||
|
||||
|
||||
void MaterialMapEditor::on_buttonSelect_clicked() {
|
||||
QString str = QFileDialog::getOpenFileName(this, "Select image", ui->linePath->property("GLpath").toString(), "Images(*.bmp *.jpg *.jpeg *.png *.tif *.tiff *.tga);;All files(*)");
|
||||
QString str = QFileDialog::getOpenFileName(this,
|
||||
"Select image",
|
||||
ui->linePath->property("GLpath").toString(),
|
||||
"Images(*.bmp *.jpg *.jpeg *.png *.tif *.tiff *.tga);;All files(*)");
|
||||
if (str.isEmpty()) return;
|
||||
ui->linePath->setProperty("GLpath", str);
|
||||
ui->linePath->setText(QFileInfo(str).fileName());
|
||||
|
||||
Reference in New Issue
Block a user