EditorWidget添加handleOpenPaintingFile接口,待实现
parent
9cc5466abc
commit
1e341a8ea5
|
@ -39,6 +39,11 @@ void EditorWidget::renameTab(QWidget* target, QString name)
|
|||
}
|
||||
}
|
||||
|
||||
void EditorWidget::handleOpenPaintingFile(QString path)
|
||||
{
|
||||
qDebug() << path;
|
||||
}
|
||||
|
||||
void EditorWidget::onTabCountChanged(int prev, int now)
|
||||
{
|
||||
if (now != 0)
|
||||
|
|
|
@ -18,8 +18,9 @@ private:
|
|||
|
||||
public:
|
||||
EditorWidget(QWidget* parent = nullptr);
|
||||
~EditorWidget()=default;
|
||||
~EditorWidget() = default;
|
||||
void renameTab(QWidget* target, QString name);
|
||||
void handleOpenPaintingFile(QString path);
|
||||
|
||||
protected slots:
|
||||
void onTabCountChanged(int prev, int now);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "MainWindow.h"
|
||||
#include "Renderer/RendererGLWidget.h"
|
||||
#include "Editor/EditorWidget.h"
|
||||
#include "qslider.h"
|
||||
#include <QPushButton>
|
||||
#include <QScreen>
|
||||
|
@ -19,6 +20,7 @@ CentralWidget::CentralWidget(QWidget* parent) : QWidget(parent)
|
|||
ui.gridLayout->addWidget(navigationBarWidget, 0, 0, 1, 1, Qt::AlignTop | Qt::AlignHCenter);
|
||||
QObject::connect(navigationBarWidget->tabs, &QtMaterialTabs::currentChanged, ui.stackedWidget, &QStackedWidget::setCurrentIndex);
|
||||
QObject::connect(ui.stackedWidget, &QStackedWidget::currentChanged, ui.rendererWidget, &Renderer::RendererWidget::currentTabChanged);
|
||||
QObject::connect(ui.rendererWidget, &Renderer::RendererWidget::openPaintingFile, ui.editorWidget, &EditorWidget::handleOpenPaintingFile);
|
||||
}
|
||||
|
||||
CentralWidget::~CentralWidget()
|
||||
|
|
|
@ -61,7 +61,7 @@ Renderer::RendererWidget::RendererWidget(QWidget* parent)
|
|||
|
||||
QObject::connect(ui.textureListWidget, &QListWidget::itemDoubleClicked, [&](QListWidgetItem* item) {
|
||||
QString paintingPath = QFileInfo(modelFileName).dir().filePath(item->text());
|
||||
qDebug() << paintingPath;
|
||||
emit openPaintingFile(paintingPath);
|
||||
});
|
||||
|
||||
QObject::connect(ui.horizontalSlider, &QSlider::valueChanged,
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace Renderer
|
|||
public slots:
|
||||
void currentTabChanged(int index);
|
||||
|
||||
signals:
|
||||
void openPaintingFile(QString path);
|
||||
|
||||
private:
|
||||
Ui::RendererWidgetClass ui;
|
||||
|
|
Loading…
Reference in New Issue