-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP for asset selection and multiple editor window workflow
- Loading branch information
Showing
73 changed files
with
982 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "AssetSelector.h" | ||
#include "ui_AssetSelector.h" | ||
|
||
AssetSelector::AssetSelector(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::AssetSelector) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
AssetSelector::~AssetSelector() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void AssetSelector::on_fakeAsset_clicked() | ||
{ | ||
emit assetActivated(0,"data/bin/origins.bin"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include <QWidget> | ||
|
||
namespace Ui | ||
{ | ||
class AssetSelector; | ||
} | ||
|
||
class AssetSelector : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit AssetSelector(QWidget *parent = nullptr); | ||
~AssetSelector(); | ||
|
||
signals: | ||
void assetActivated(int type,const QString &path); | ||
private slots: | ||
void on_fakeAsset_clicked(); | ||
|
||
private: | ||
Ui::AssetSelector *ui; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>AssetSelector</class> | ||
<widget class="QWidget" name="AssetSelector"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>658</width> | ||
<height>92</height> | ||
</rect> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>0</width> | ||
<height>64</height> | ||
</size> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QToolButton" name="fakeAsset"> | ||
<property name="text"> | ||
<string>Origins</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include "MainWindow.h" | ||
|
||
#include "ui_mainwindow.h" | ||
|
||
#include "AssetSelector.h" | ||
#include "SegsOriginEditor.h" | ||
|
||
#include <QDockWidget> | ||
#include <QMdiSubWindow> | ||
|
||
MainWindow::MainWindow(QWidget *parent) : | ||
QMainWindow(parent), | ||
ui(new Ui::MainWindow) | ||
{ | ||
ui->setupUi(this); | ||
|
||
addEditors(); | ||
addDocks(); | ||
addMdis(); | ||
|
||
} | ||
|
||
void MainWindow::addDocks() { | ||
QDockWidget *dock = new QDockWidget(tr("Asset List"), this); | ||
dock->setAllowedAreas(Qt::DockWidgetArea::AllDockWidgetAreas); | ||
auto *sel = new AssetSelector(dock); | ||
dock->setWidget(sel); | ||
addDockWidget(Qt::LeftDockWidgetArea, dock); | ||
|
||
connect(sel,&AssetSelector::assetActivated,this,&MainWindow::onAssetActivated); | ||
|
||
} | ||
|
||
void MainWindow::onAssetActivated(int type, const QString &path) { | ||
|
||
if(m_editors[0]->isVisible()) { | ||
m_mdis[0]->activateWindow(); | ||
m_editors[0]->activateWindow(); | ||
} else { | ||
m_editors[0]->showMaximized(); | ||
} | ||
} | ||
|
||
void MainWindow::addEditors() { | ||
m_editors.push_back(new SegsOriginEditor()); | ||
m_editors.back()->setAttribute(Qt::WA_DeleteOnClose,false); | ||
|
||
} | ||
|
||
void MainWindow::addMdis() { | ||
m_mdis.push_back(new QMdiSubWindow(ui->centralwidget)); | ||
m_mdis.back()->setAttribute(Qt::WA_DeleteOnClose,false); | ||
//subWindow1->setWidget(w); | ||
} | ||
|
||
MainWindow::~MainWindow() | ||
{ | ||
delete ui; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <QMainWindow> | ||
|
||
class QMdiSubWindow; | ||
|
||
namespace Ui | ||
{ | ||
class MainWindow; | ||
} | ||
|
||
class MainWindow : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit MainWindow(QWidget *parent = nullptr); | ||
~MainWindow(); | ||
|
||
private slots: | ||
void onAssetActivated(int type, const QString &path); | ||
|
||
private: | ||
void addDocks(); | ||
void addMdis(); | ||
void addEditors(); | ||
|
||
Ui::MainWindow *ui; | ||
std::vector<QWidget *> m_editors; | ||
std::vector<QMdiSubWindow *> m_mdis; | ||
}; |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Utilities/EditorComponets/SegsOriginEditor.h → ...ities/EditorComponents/SegsOriginEditor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.