много исправлений
This commit is contained in:
@@ -56,6 +56,8 @@ SceneTree::SceneTree(QWidget * parent): QWidget(parent) {
|
||||
ui->treeObjects->header()->setSectionResizeMode(cVis, QHeaderView::ResizeToContents);
|
||||
ui->treeObjects->header()->setSectionsMovable(false);
|
||||
ui->treeObjects->header()->swapSections(cName, cVis);
|
||||
ui->treeObjects->setItemDelegateForColumn(1, new NoEditDelegate(this));
|
||||
ui->treeObjects->setItemDelegateForColumn(2, new NoEditDelegate(this));
|
||||
icon_empty = QIcon(":/icons/type-empty.png");
|
||||
icon_geo = QIcon(":/icons/type-geo.png");
|
||||
icon_camera = QIcon(":/icons/type-camera.png");
|
||||
@@ -110,6 +112,11 @@ QList<QAction *> SceneTree::actionsSelection() {
|
||||
}
|
||||
|
||||
|
||||
void SceneTree::expandItems() {
|
||||
ui->treeObjects->expandAll();
|
||||
}
|
||||
|
||||
|
||||
void SceneTree::changeEvent(QEvent * e) {
|
||||
QWidget::changeEvent(e);
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
@@ -265,19 +272,30 @@ bool SceneTree::filterTree(QTreeWidgetItem * ti, const QString & filter, int typ
|
||||
|
||||
void SceneTree::checkActions() {
|
||||
bool has_1 = false, has_m = false;
|
||||
bool has_cam = false;
|
||||
bool has_mesh = false;
|
||||
bool is_def_cam = false;
|
||||
if (view) {
|
||||
has_1 = !view->selectedObjects().isEmpty();
|
||||
has_m = view->selectedObjects().size() > 1;
|
||||
is_def_cam = view->isDefaultCamera();
|
||||
ObjectBaseList slo = view->selectedObjects();
|
||||
has_1 = !slo.isEmpty();
|
||||
has_m = slo.size() > 1;
|
||||
for (ObjectBase * o : slo) {
|
||||
if (o->type() == ObjectBase::glCamera) has_cam = (slo.size() == 1);
|
||||
if (o->type() == ObjectBase::glMesh) has_mesh = true;
|
||||
}
|
||||
}
|
||||
ui->actionFocus ->setEnabled(has_1);
|
||||
|
||||
ui->actionFocus ->setEnabled(has_mesh);
|
||||
ui->actionRemove->setEnabled(has_1);
|
||||
ui->actionClone ->setEnabled(has_1);
|
||||
ui->actionGroup->setEnabled(has_m);
|
||||
ui->actionTransfer_transform_to_children->setEnabled(has_1);
|
||||
ui->actionSelect_parent->setEnabled(has_1);
|
||||
ui->actionSelect_by_mesh->setEnabled(has_1);
|
||||
ui->actionSelect_by_material->setEnabled(has_1);
|
||||
ui->actionActive_camera->setEnabled(has_1);
|
||||
ui->actionSelect_by_mesh->setEnabled(has_mesh);
|
||||
ui->actionSelect_by_material->setEnabled(has_mesh);
|
||||
ui->actionActive_camera->setEnabled(has_cam);
|
||||
ui->actionDefault_camera->setEnabled(is_def_cam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
void assignQGLView(QGLView * v);
|
||||
QList<QAction*> actionsAdd();
|
||||
QList<QAction*> actionsSelection();
|
||||
void expandItems();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent * e);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonFilter">
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/widgets/qad_widgets.qrc">
|
||||
<iconset resource="../../qad/libs/application/qad_application.qrc">
|
||||
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
@@ -98,6 +98,9 @@
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
<property name="autoExpandDelay">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -124,7 +127,7 @@
|
||||
</layout>
|
||||
<action name="actionFocus">
|
||||
<property name="icon">
|
||||
<iconset resource="../qglview.qrc">
|
||||
<iconset resource="../../qad/libs/qglview/qglview.qrc">
|
||||
<normaloff>:/icons/type-camera.png</normaloff>:/icons/type-camera.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -133,7 +136,7 @@
|
||||
</action>
|
||||
<action name="actionRemove">
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/utils/qad_utils.qrc">
|
||||
<iconset resource="../../qad/libs/blockview/qad_blockview.qrc">
|
||||
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -142,7 +145,7 @@
|
||||
</action>
|
||||
<action name="actionClone">
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/utils/qad_utils.qrc">
|
||||
<iconset resource="../../qad/libs/application/qad_application.qrc">
|
||||
<normaloff>:/icons/edit-copy.png</normaloff>:/icons/edit-copy.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -169,7 +172,7 @@
|
||||
</action>
|
||||
<action name="actionSelect_by_mesh">
|
||||
<property name="icon">
|
||||
<iconset resource="../qglview.qrc">
|
||||
<iconset resource="../../qad/libs/qglview/qglview.qrc">
|
||||
<normaloff>:/icons/type-geo.png</normaloff>:/icons/type-geo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -178,7 +181,7 @@
|
||||
</action>
|
||||
<action name="actionSelect_by_material">
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/blockview/qad_blockview.qrc">
|
||||
<iconset resource="../../qad/libs/blockview/qad_blockview.qrc">
|
||||
<normaloff>:/icons/format-fill-color.png</normaloff>:/icons/format-fill-color.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -229,7 +232,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../qglview.qrc">
|
||||
<iconset resource="../../qad/libs/qglview/qglview.qrc">
|
||||
<normaloff>:/icons/type-geo.png</normaloff>:/icons/type-geo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -241,7 +244,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../qglview.qrc">
|
||||
<iconset resource="../../qad/libs/qglview/qglview.qrc">
|
||||
<normaloff>:/icons/type-light.png</normaloff>:/icons/type-light.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -253,7 +256,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../qglview.qrc">
|
||||
<iconset resource="../../qad/libs/qglview/qglview.qrc">
|
||||
<normaloff>:/icons/type-camera.png</normaloff>:/icons/type-camera.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -267,7 +270,7 @@
|
||||
</action>
|
||||
<action name="actionActive_camera">
|
||||
<property name="icon">
|
||||
<iconset resource="../qglview.qrc">
|
||||
<iconset resource="../../qad/libs/qglview/qglview.qrc">
|
||||
<normaloff>:/icons/type-camera.png</normaloff>:/icons/type-camera.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -276,7 +279,7 @@
|
||||
</action>
|
||||
<action name="actionDefault_camera">
|
||||
<property name="icon">
|
||||
<iconset resource="../qglview.qrc">
|
||||
<iconset resource="../../qad/libs/qglview/qglview.qrc">
|
||||
<normaloff>:/icons/type-camera.png</normaloff>:/icons/type-camera.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -297,11 +300,16 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../qad/utils/qad_utils.qrc"/>
|
||||
<include location="../../qad/widgets/qad_widgets.qrc"/>
|
||||
<include location="../../qad/blockview/qad_blockview.qrc"/>
|
||||
<include location="../../qad/libs/application/qad_application.qrc"/>
|
||||
<include location="../../qad/libs/blockview/qad_blockview.qrc"/>
|
||||
<include location="../../qad/libs/qglview/qglview.qrc"/>
|
||||
<include location="widgets.qrc"/>
|
||||
<include location="../qglview.qrc"/>
|
||||
<include location="../../qad/libs/application/qad_application.qrc"/>
|
||||
<include location="../../qad/libs/blockview/qad_blockview.qrc"/>
|
||||
<include location="../../qad/libs/qglview/qglview.qrc"/>
|
||||
<include location="../qglview.qrc"/>
|
||||
<include location="widgets.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <QDropEvent>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
class InternalMoveTreeWidget: public QTreeWidget
|
||||
{
|
||||
@@ -48,4 +49,13 @@ signals:
|
||||
|
||||
};
|
||||
|
||||
|
||||
class NoEditDelegate: public QStyledItemDelegate {
|
||||
public:
|
||||
NoEditDelegate(QObject* parent=0): QStyledItemDelegate(parent) {}
|
||||
virtual QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // TREEWIDGET_H
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
ViewEditor::ViewEditor(QWidget * parent): QWidget(parent) {
|
||||
ui = new Ui::ViewEditor();
|
||||
ui->setupUi(this);
|
||||
view = 0;
|
||||
view = nullptr;
|
||||
active = true;
|
||||
ui->checkCameraLight->setCheckState(Qt::PartiallyChecked);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,12,0)
|
||||
@@ -54,7 +54,9 @@ void ViewEditor::assignQGLView(QGLView * v) {
|
||||
ui->lineHDR->setProperty("GLpath", view->environmentMapFile());
|
||||
ui->lineHDR->setText(QFileInfo(view->environmentMapFile()).fileName());
|
||||
ui->checkVSync->setChecked(view->getVSync());
|
||||
ui->spinSamples->setValue(view->getSamples());
|
||||
ui->colorFogBack->setColor(view->fogColor());
|
||||
ui->spinFogDecay->setValue(view->fogDecay());
|
||||
ui->spinFogDensity->setValue(view->fogDensity());
|
||||
active = true;
|
||||
}
|
||||
|
||||
@@ -181,12 +183,26 @@ void ViewEditor::on_buttonHDRSelect_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_colorFogBack_colorChanged(const QColor & color) {
|
||||
if (!view || !active) return;
|
||||
view->setFogColor(color);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinFogDensity_valueChanged(double arg1) {
|
||||
if (!view || !active) return;
|
||||
view->setFogDensity(arg1);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinFogDecay_valueChanged(double arg1) {
|
||||
if (!view || !active) return;
|
||||
view->setFogDecay(arg1);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_checkVSync_clicked(bool val) {
|
||||
if (!view || !active) return;
|
||||
view->setVSync(val);
|
||||
}
|
||||
|
||||
|
||||
void ViewEditor::on_spinSamples_valueChanged(int arg1) {
|
||||
view->setSamples(arg1);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,9 +58,11 @@ private slots:
|
||||
void on_checkService_clicked(bool val);
|
||||
void on_checkCameraLight_stateChanged(int s);
|
||||
void on_checkVSync_clicked(bool val);
|
||||
void on_spinSamples_valueChanged(int arg1);
|
||||
void on_buttonHDRClear_clicked();
|
||||
void on_buttonHDRSelect_clicked();
|
||||
void on_colorFogBack_colorChanged(const QColor &color);
|
||||
void on_spinFogDensity_valueChanged(double arg1);
|
||||
void on_spinFogDecay_valueChanged(double arg1);
|
||||
};
|
||||
|
||||
#endif // VIEW_EDITOR_H
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -78,9 +75,6 @@
|
||||
<property name="text">
|
||||
<string>Gamma:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
@@ -181,22 +175,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="spinSamples">
|
||||
<property name="prefix">
|
||||
<string>Samples: </string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@@ -238,9 +216,6 @@
|
||||
<property name="text">
|
||||
<string>FOV:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -265,9 +240,6 @@
|
||||
<property name="text">
|
||||
<string>Depth start:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -415,17 +387,14 @@
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Density:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="SpinSlider" name="spinFogDensity">
|
||||
@@ -449,27 +418,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorButton" name="colorFogBack">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>128</red>
|
||||
<green>128</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Decay:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="SpinSlider" name="spinFogDecay">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
@@ -497,6 +455,24 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="ColorButton" name="colorFogBack">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>128</red>
|
||||
<green>128</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -531,7 +507,6 @@
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../qad/libs/blockview/qad_blockview.qrc"/>
|
||||
<include location="../../qad/libs/blockview/qad_blockview.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user