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)
|
void EditorWidget::onTabCountChanged(int prev, int now)
|
||||||
{
|
{
|
||||||
if (now != 0)
|
if (now != 0)
|
||||||
|
|
|
@ -4,27 +4,28 @@
|
||||||
#include "ui_EditorWidget.h"
|
#include "ui_EditorWidget.h"
|
||||||
|
|
||||||
class EditorWidget :
|
class EditorWidget :
|
||||||
public QWidget
|
public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
Ui::EditorWidget ui;
|
Ui::EditorWidget ui;
|
||||||
QTabWidget* tabWidget;
|
QTabWidget* tabWidget;
|
||||||
FluentMenuButton* fileMenuButton;
|
FluentMenuButton* fileMenuButton;
|
||||||
FluentMenuButton* projectMenuButton;
|
FluentMenuButton* projectMenuButton;
|
||||||
|
|
||||||
|
void initFileMenu();
|
||||||
|
void initProjectMenu();
|
||||||
|
|
||||||
void initFileMenu();
|
|
||||||
void initProjectMenu();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EditorWidget(QWidget* parent = nullptr);
|
EditorWidget(QWidget* parent = nullptr);
|
||||||
~EditorWidget()=default;
|
~EditorWidget() = default;
|
||||||
void renameTab(QWidget* target, QString name);
|
void renameTab(QWidget* target, QString name);
|
||||||
|
void handleOpenPaintingFile(QString path);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void onTabCountChanged(int prev, int now);
|
void onTabCountChanged(int prev, int now);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void tabCountChanged(int prev, int now);
|
void tabCountChanged(int prev, int now);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "Renderer/RendererGLWidget.h"
|
#include "Renderer/RendererGLWidget.h"
|
||||||
|
#include "Editor/EditorWidget.h"
|
||||||
#include "qslider.h"
|
#include "qslider.h"
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
@ -19,6 +20,7 @@ CentralWidget::CentralWidget(QWidget* parent) : QWidget(parent)
|
||||||
ui.gridLayout->addWidget(navigationBarWidget, 0, 0, 1, 1, Qt::AlignTop | Qt::AlignHCenter);
|
ui.gridLayout->addWidget(navigationBarWidget, 0, 0, 1, 1, Qt::AlignTop | Qt::AlignHCenter);
|
||||||
QObject::connect(navigationBarWidget->tabs, &QtMaterialTabs::currentChanged, ui.stackedWidget, &QStackedWidget::setCurrentIndex);
|
QObject::connect(navigationBarWidget->tabs, &QtMaterialTabs::currentChanged, ui.stackedWidget, &QStackedWidget::setCurrentIndex);
|
||||||
QObject::connect(ui.stackedWidget, &QStackedWidget::currentChanged, ui.rendererWidget, &Renderer::RendererWidget::currentTabChanged);
|
QObject::connect(ui.stackedWidget, &QStackedWidget::currentChanged, ui.rendererWidget, &Renderer::RendererWidget::currentTabChanged);
|
||||||
|
QObject::connect(ui.rendererWidget, &Renderer::RendererWidget::openPaintingFile, ui.editorWidget, &EditorWidget::handleOpenPaintingFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
CentralWidget::~CentralWidget()
|
CentralWidget::~CentralWidget()
|
||||||
|
|
|
@ -61,7 +61,7 @@ Renderer::RendererWidget::RendererWidget(QWidget* parent)
|
||||||
|
|
||||||
QObject::connect(ui.textureListWidget, &QListWidget::itemDoubleClicked, [&](QListWidgetItem* item) {
|
QObject::connect(ui.textureListWidget, &QListWidget::itemDoubleClicked, [&](QListWidgetItem* item) {
|
||||||
QString paintingPath = QFileInfo(modelFileName).dir().filePath(item->text());
|
QString paintingPath = QFileInfo(modelFileName).dir().filePath(item->text());
|
||||||
qDebug() << paintingPath;
|
emit openPaintingFile(paintingPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(ui.horizontalSlider, &QSlider::valueChanged,
|
QObject::connect(ui.horizontalSlider, &QSlider::valueChanged,
|
||||||
|
|
|
@ -14,7 +14,9 @@ namespace Renderer
|
||||||
public slots:
|
public slots:
|
||||||
void currentTabChanged(int index);
|
void currentTabChanged(int index);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void openPaintingFile(QString path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::RendererWidgetClass ui;
|
Ui::RendererWidgetClass ui;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue