ui: Errorview
Tabbed view with errorview as tab
This commit is contained in:
@@ -61,6 +61,11 @@ void QtCodeView::setErrorInfos(const std::vector<ErrorInfo>& errorInfos)
|
||||
m_errorInfos = errorInfos;
|
||||
}
|
||||
|
||||
bool QtCodeView::showsErrors() const
|
||||
{
|
||||
return m_errorInfos.size() > 0;
|
||||
}
|
||||
|
||||
void QtCodeView::showCodeSnippets(const std::vector<CodeSnippetParams>& snippets, const std::vector<Id>& activeTokenIds)
|
||||
{
|
||||
m_showCodeSnippetsFunctor(snippets, activeTokenIds);
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
virtual void clear();
|
||||
|
||||
virtual void setErrorInfos(const std::vector<ErrorInfo>& errorInfos);
|
||||
virtual bool showsErrors() const;
|
||||
|
||||
virtual void showCodeSnippets(const std::vector<CodeSnippetParams>& snippets, const std::vector<Id>& activeTokenIds);
|
||||
virtual void addCodeSnippets(const std::vector<CodeSnippetParams>& snippets, bool insert);
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
#include "qt/view/QtErrorView.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QCheckBox>
|
||||
#include <QFrame>
|
||||
#include <QHeaderView>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QPalette>
|
||||
#include <QStandardItemModel>
|
||||
#include <QStandardItem>
|
||||
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/element/QtTable.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
#include "utility/messaging/type/MessageErrorFilterChanged.h"
|
||||
#include "utility/messaging/type/MessageShowErrors.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
#include "qt/view/QtViewWidgetWrapper.h"
|
||||
|
||||
QtErrorView::QtErrorView(ViewLayout* viewLayout)
|
||||
: ErrorView(viewLayout)
|
||||
, m_clearFunctor(std::bind(&QtErrorView::doClear, this))
|
||||
, m_refreshFunctor(std::bind(&QtErrorView::doRefreshView, this))
|
||||
, m_addErrorFunctor(std::bind(&QtErrorView::doAddError, this, std::placeholders::_1))
|
||||
{
|
||||
}
|
||||
|
||||
QtErrorView::~QtErrorView()
|
||||
{
|
||||
}
|
||||
|
||||
void QtErrorView::createWidgetWrapper()
|
||||
{
|
||||
setWidgetWrapper(std::make_shared<QtViewWidgetWrapper>(new QFrame()));
|
||||
}
|
||||
|
||||
void QtErrorView::initView()
|
||||
{
|
||||
QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this);
|
||||
|
||||
QBoxLayout* layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 5);
|
||||
layout->setSpacing(0);
|
||||
widget->setLayout(layout);
|
||||
|
||||
m_table = new QtTable(this);
|
||||
m_table->setAlternatingRowColors(true);
|
||||
|
||||
m_table->setShowGrid(false);
|
||||
m_table->verticalHeader()->setAlternatingRowColors(true);
|
||||
m_table->verticalHeader()->sectionResizeMode(QHeaderView::Fixed);
|
||||
m_table->verticalHeader()->setDefaultSectionSize(ApplicationSettings::getInstance()->getFontSize() + 6);
|
||||
m_table->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
m_table->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
m_table->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
|
||||
m_model = new QStandardItemModel(this);
|
||||
m_table->setModel(m_model);
|
||||
|
||||
// Setup Table Headers
|
||||
m_model->setColumnCount(5);
|
||||
m_table->setColumnWidth(COLUMN::TYPE, 70);
|
||||
m_table->setColumnWidth(COLUMN::MESSAGE, 450);
|
||||
m_table->setColumnWidth(COLUMN::FILE, 300);
|
||||
m_table->setColumnWidth(COLUMN::LINE, 50);
|
||||
m_table->setColumnHidden(COLUMN::ID, true);
|
||||
|
||||
QStringList headers;
|
||||
headers << "Type" << "Message" << "File" << "Line" << "Indexed";
|
||||
m_model->setHorizontalHeaderLabels(headers);
|
||||
m_table->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
|
||||
|
||||
connect(m_table->selectionModel(), &QItemSelectionModel::currentRowChanged,
|
||||
[=](const QModelIndex& index, const QModelIndex& previousIndex)
|
||||
{
|
||||
if (index.isValid())
|
||||
{
|
||||
if (m_model->item(index.row(), COLUMN::FILE) == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MessageShowErrors(m_model->item(index.row(), COLUMN::ID)->text().toUInt()).dispatch();
|
||||
}
|
||||
});
|
||||
|
||||
layout->addWidget(m_table);
|
||||
|
||||
// Setup Checkboxes
|
||||
QBoxLayout* checkboxes = new QHBoxLayout();
|
||||
checkboxes->addSpacing(15);
|
||||
|
||||
m_showFatals = createFilterCheckbox("fatals", true, checkboxes);
|
||||
m_showErrors = createFilterCheckbox("errors", true, checkboxes);
|
||||
m_showNonIndexedFatals = createFilterCheckbox("fatals in non-indexed files", true, checkboxes);
|
||||
m_showNonIndexedErrors = createFilterCheckbox("errors in non-indexed files", false, checkboxes);
|
||||
|
||||
checkboxes->addStretch();
|
||||
|
||||
layout->addLayout(checkboxes);
|
||||
|
||||
doRefreshView();
|
||||
}
|
||||
|
||||
void QtErrorView::refreshView()
|
||||
{
|
||||
m_refreshFunctor();
|
||||
}
|
||||
|
||||
void QtErrorView::clear()
|
||||
{
|
||||
m_clearFunctor();
|
||||
}
|
||||
|
||||
void QtErrorView::addError(const StorageError& error)
|
||||
{
|
||||
m_addErrorFunctor(error);
|
||||
}
|
||||
|
||||
void QtErrorView::clickedInEmptySpace()
|
||||
{
|
||||
}
|
||||
|
||||
void QtErrorView::doRefreshView()
|
||||
{
|
||||
m_model->removeRows(0, m_model->rowCount());
|
||||
|
||||
for (StorageError error : m_errors)
|
||||
{
|
||||
addErrorToTable(error);
|
||||
}
|
||||
|
||||
m_table->updateRows();
|
||||
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
void QtErrorView::doClear()
|
||||
{
|
||||
m_model->removeRows(0, m_model->rowCount());
|
||||
m_errors.clear();
|
||||
}
|
||||
|
||||
void QtErrorView::doAddError(const StorageError& error)
|
||||
{
|
||||
m_errors.push_back(error);
|
||||
|
||||
addErrorToTable(error);
|
||||
}
|
||||
|
||||
void QtErrorView::setStyleSheet() const
|
||||
{
|
||||
QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this);
|
||||
utility::setWidgetBackgroundColor(widget, ColorScheme::getInstance()->getColor("error/background"));
|
||||
|
||||
|
||||
QPalette palette( m_showErrors->palette() );
|
||||
palette.setColor(QPalette::WindowText, QColor(ColorScheme::getInstance()->getColor("error/text/normal").c_str()));
|
||||
//palette.setColor(QPalette::Text, QColor(ColorScheme::getInstance()->getColor("error/text/normal").c_str()));
|
||||
//palette.setColor(QPalette::ButtonText, QColor(ColorScheme::getInstance()->getColor("error/text/normal").c_str()));
|
||||
|
||||
//m_showErrors->setAutoFillBackground(true);
|
||||
m_showErrors->setPalette(palette);
|
||||
m_showFatals->setPalette(palette);
|
||||
m_showNonIndexedErrors->setPalette(palette);
|
||||
m_showNonIndexedFatals->setPalette(palette);
|
||||
|
||||
widget->setStyleSheet(
|
||||
utility::getStyleSheet(ResourcePaths::getGuiPath() + "error_view/error_view.css").c_str()
|
||||
);
|
||||
}
|
||||
|
||||
void QtErrorView::addErrorToTable(const StorageError& error)
|
||||
{
|
||||
if (!isShownError(error))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int rowNumber = m_table->getFilledRowCount();
|
||||
if (rowNumber < m_model->rowCount())
|
||||
{
|
||||
m_model->insertRow(rowNumber);
|
||||
}
|
||||
|
||||
m_model->setItem(rowNumber, COLUMN::TYPE, new QStandardItem(error.fatal ? "FATAL" : "ERROR"));
|
||||
m_model->item(rowNumber, COLUMN::TYPE)->setForeground(QBrush(Qt::red));
|
||||
m_model->item(rowNumber, COLUMN::TYPE)->setTextAlignment(Qt::AlignCenter);
|
||||
m_model->setItem(rowNumber, COLUMN::MESSAGE, new QStandardItem(error.message.c_str()));
|
||||
std::string errorPngPath = ResourcePaths::getGuiPath() + "/indexing_dialog/error.png";
|
||||
m_model->item(rowNumber, COLUMN::MESSAGE)->setIcon(QIcon(QString(errorPngPath.c_str())));
|
||||
m_model->setItem(rowNumber, COLUMN::FILE, new QStandardItem(error.filePath.c_str()));
|
||||
m_model->item(rowNumber, COLUMN::FILE)->setToolTip(error.filePath.c_str());
|
||||
m_model->setItem(rowNumber, COLUMN::LINE, new QStandardItem(QString::number(error.lineNumber)));
|
||||
m_model->setItem(rowNumber, COLUMN::INDEXED, new QStandardItem(error.indexed ? "yes" : "no"));
|
||||
m_model->setItem(rowNumber, COLUMN::ID, new QStandardItem(QString::number(error.id)));
|
||||
m_table->updateRows();
|
||||
}
|
||||
|
||||
QCheckBox* QtErrorView::createFilterCheckbox(const QString& name, bool checked, QBoxLayout* layout)
|
||||
{
|
||||
QCheckBox* checkbox = new QCheckBox(name);
|
||||
checkbox->setChecked(checked);
|
||||
|
||||
connect(checkbox, &QCheckBox::stateChanged,
|
||||
[=](int)
|
||||
{
|
||||
m_table->selectionModel()->clearSelection();
|
||||
|
||||
ErrorFilter filter;
|
||||
filter.error = m_showErrors->checkState() == Qt::Checked;
|
||||
filter.fatal = m_showFatals->checkState() == Qt::Checked;
|
||||
filter.unindexedError = m_showNonIndexedErrors->checkState() == Qt::Checked;
|
||||
filter.unindexedFatal = m_showNonIndexedFatals->checkState() == Qt::Checked;
|
||||
|
||||
MessageErrorFilterChanged(filter).dispatch();
|
||||
}
|
||||
);
|
||||
|
||||
layout->addWidget(checkbox);
|
||||
layout->addSpacing(25);
|
||||
|
||||
return checkbox;
|
||||
}
|
||||
|
||||
bool QtErrorView::isShownError(const StorageError& error)
|
||||
{
|
||||
if (!error.fatal && error.indexed && m_showErrors->checkState() == Qt::Checked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (error.fatal && error.indexed && m_showFatals->checkState() == Qt::Checked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (error.fatal && !error.indexed && m_showNonIndexedErrors->checkState() == Qt::Checked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (error.fatal && !error.indexed && m_showNonIndexedFatals->checkState() == Qt::Checked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef QT_ERROR_VIEW_H
|
||||
#define QT_ERROR_VIEW_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "component/view/ErrorView.h"
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
|
||||
class QBoxLayout;
|
||||
class QCheckBox;
|
||||
class QPalette;
|
||||
class QStandardItemModel;
|
||||
class QtTable;
|
||||
|
||||
class QtErrorView
|
||||
: public QWidget
|
||||
, public ErrorView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtErrorView(ViewLayout* viewLayout);
|
||||
virtual ~QtErrorView();
|
||||
|
||||
// View implementation
|
||||
virtual void createWidgetWrapper();
|
||||
virtual void initView();
|
||||
virtual void refreshView();
|
||||
|
||||
// ErrorView implementation
|
||||
virtual void clear();
|
||||
virtual void addError(const StorageError& error);
|
||||
|
||||
private slots:
|
||||
void clickedInEmptySpace();
|
||||
|
||||
private:
|
||||
enum COLUMN {
|
||||
TYPE = 0,
|
||||
MESSAGE = 1,
|
||||
FILE = 2,
|
||||
LINE = 3,
|
||||
INDEXED = 4,
|
||||
ID = 5
|
||||
};
|
||||
|
||||
void doRefreshView();
|
||||
void doClear();
|
||||
void doAddError(const StorageError& error);
|
||||
|
||||
void setStyleSheet() const;
|
||||
|
||||
void addErrorToTable(const StorageError& error);
|
||||
|
||||
QCheckBox* createFilterCheckbox(const QString& name, bool checked, QBoxLayout* layout);
|
||||
bool isShownError(const StorageError& error);
|
||||
|
||||
QtThreadedFunctor<void> m_clearFunctor;
|
||||
QtThreadedFunctor<void> m_refreshFunctor;
|
||||
QtThreadedFunctor<const StorageError&> m_addErrorFunctor;
|
||||
|
||||
QCheckBox* m_showErrors;
|
||||
QCheckBox* m_showFatals;
|
||||
QCheckBox* m_showNonIndexedErrors;
|
||||
QCheckBox* m_showNonIndexedFatals;
|
||||
|
||||
QStandardItemModel* m_model;
|
||||
QtTable* m_table;
|
||||
|
||||
std::vector<StorageError> m_errors;
|
||||
QPalette* m_palette;
|
||||
};
|
||||
|
||||
#endif // QT_ERROR_VIEW_H
|
||||
@@ -0,0 +1,57 @@
|
||||
#include "qt/view/QtLogView.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QFrame>
|
||||
#include <QLabel>
|
||||
|
||||
#include "qt/view/QtViewWidgetWrapper.h"
|
||||
|
||||
QtLogView::QtLogView(ViewLayout* viewLayout)
|
||||
: LogView(viewLayout)
|
||||
, m_clearFunctor(std::bind(&QtLogView::doClear, this))
|
||||
, m_refreshFunctor(std::bind(&QtLogView::doRefreshView, this))
|
||||
{
|
||||
}
|
||||
|
||||
QtLogView::~QtLogView()
|
||||
{
|
||||
}
|
||||
|
||||
void QtLogView::createWidgetWrapper()
|
||||
{
|
||||
setWidgetWrapper(std::make_shared<QtViewWidgetWrapper>(new QFrame()));
|
||||
}
|
||||
|
||||
void QtLogView::initView()
|
||||
{
|
||||
QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this);
|
||||
|
||||
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
widget->setLayout(layout);
|
||||
|
||||
QLabel* label = new QLabel("test log view");
|
||||
|
||||
widget->layout()->addWidget(label);
|
||||
|
||||
doRefreshView();
|
||||
}
|
||||
|
||||
void QtLogView::refreshView()
|
||||
{
|
||||
m_refreshFunctor();
|
||||
}
|
||||
|
||||
void QtLogView::clear()
|
||||
{
|
||||
m_clearFunctor();
|
||||
}
|
||||
|
||||
void QtLogView::doClear()
|
||||
{
|
||||
}
|
||||
|
||||
void QtLogView::doRefreshView()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef QT_LOG_VIEW_H
|
||||
#define QT_LOG_VIEW_H
|
||||
|
||||
#include "component/view/LogView.h"
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
|
||||
class QtLogView
|
||||
: public LogView
|
||||
{
|
||||
public:
|
||||
QtLogView(ViewLayout* viewLayout);
|
||||
virtual ~QtLogView();
|
||||
|
||||
// View implementation
|
||||
virtual void createWidgetWrapper();
|
||||
virtual void initView();
|
||||
virtual void refreshView();
|
||||
|
||||
virtual void clear();
|
||||
|
||||
private:
|
||||
void doClear();
|
||||
void doRefreshView();
|
||||
|
||||
QtThreadedFunctor<void> m_clearFunctor;
|
||||
QtThreadedFunctor<void> m_refreshFunctor;
|
||||
};
|
||||
|
||||
#endif // QT_LOG_VIEW_H
|
||||
@@ -45,12 +45,22 @@ void QtMainView::removeView(View* view)
|
||||
|
||||
void QtMainView::showView(View* view)
|
||||
{
|
||||
m_window->showView(view);
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
{
|
||||
m_window->showView(view);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void QtMainView::hideView(View* view)
|
||||
{
|
||||
m_window->hideView(view);
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
{
|
||||
m_window->hideView(view);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void QtMainView::loadLayout()
|
||||
|
||||
@@ -38,13 +38,13 @@ public:
|
||||
virtual void showView(View* view);
|
||||
virtual void hideView(View* view);
|
||||
|
||||
virtual void loadLayout();
|
||||
virtual void saveLayout();
|
||||
|
||||
virtual QStatusBar* getStatusBar();
|
||||
virtual void setStatusBar(QStatusBar* statusBar);
|
||||
|
||||
// MainView implementation
|
||||
virtual void loadLayout();
|
||||
virtual void saveLayout();
|
||||
|
||||
virtual void hideStartScreen();
|
||||
virtual void setTitle(const std::string& title);
|
||||
virtual void activateWindow();
|
||||
@@ -76,6 +76,8 @@ private:
|
||||
QtThreadedFunctor<> m_activateWindowFunctor;
|
||||
QtThreadedFunctor<> m_updateRecentProjectMenuFunctor;
|
||||
QtThreadedFunctor<bool> m_forceLicenseScreenFunctor;
|
||||
|
||||
QtThreadedLambdaFunctor m_onQtThread;
|
||||
};
|
||||
|
||||
#endif // QT_MAIN_VIEW_H
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
#include "qt/view/QtTabbedView.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QFrame>
|
||||
#include <QTabBar>
|
||||
#include <QTabWidget>
|
||||
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/view/QtViewWidgetWrapper.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
|
||||
QtTabbedView::QtTabbedView(ViewLayout* viewLayout, const std::string& name)
|
||||
: TabbedView(viewLayout, name)
|
||||
, m_refreshFunctor(std::bind(&QtTabbedView::doRefreshView, this))
|
||||
{
|
||||
}
|
||||
|
||||
QtTabbedView::~QtTabbedView()
|
||||
{
|
||||
}
|
||||
|
||||
void QtTabbedView::createWidgetWrapper()
|
||||
{
|
||||
setWidgetWrapper(std::make_shared<QtViewWidgetWrapper>(new QFrame()));
|
||||
}
|
||||
|
||||
void QtTabbedView::initView()
|
||||
{
|
||||
QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this);
|
||||
|
||||
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
widget->setLayout(layout);
|
||||
|
||||
m_widget = new QTabWidget(widget);
|
||||
layout->addWidget(m_widget);
|
||||
}
|
||||
|
||||
void QtTabbedView::refreshView()
|
||||
{
|
||||
m_refreshFunctor();
|
||||
}
|
||||
|
||||
void QtTabbedView::doRefreshView()
|
||||
{
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
void QtTabbedView::addViewWidget(View* view)
|
||||
{
|
||||
m_widget->addTab(QtViewWidgetWrapper::getWidgetOfView(view), view->getName().c_str());
|
||||
|
||||
doRefreshView();
|
||||
}
|
||||
|
||||
void QtTabbedView::setStyleSheet()
|
||||
{
|
||||
utility::setWidgetBackgroundColor(QtViewWidgetWrapper::getWidgetOfView(this), ColorScheme::getInstance()->getColor("tab/background"));
|
||||
|
||||
m_widget->setStyleSheet(
|
||||
utility::getStyleSheet(ResourcePaths::getGuiPath() + "tabbed_view/tabbed_view.css").c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef QT_TABBED_VIEW
|
||||
#define QT_TABBED_VIEW
|
||||
|
||||
#include "component/view/TabbedView.h"
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
|
||||
class QTabWidget;
|
||||
|
||||
class QtTabbedView
|
||||
: public TabbedView
|
||||
{
|
||||
public:
|
||||
QtTabbedView(ViewLayout* viewLayout, const std::string& name);
|
||||
~QtTabbedView();
|
||||
|
||||
// View implementation
|
||||
virtual void createWidgetWrapper();
|
||||
virtual void initView();
|
||||
virtual void refreshView();
|
||||
|
||||
// TabbedView implementation
|
||||
virtual void addViewWidget(View* view);
|
||||
|
||||
private:
|
||||
void setStyleSheet();
|
||||
void doRefreshView();
|
||||
|
||||
QtThreadedFunctor<void> m_refreshFunctor;
|
||||
QTabWidget* m_widget;
|
||||
};
|
||||
|
||||
#endif // QT_TABBED_VIEW
|
||||
@@ -4,12 +4,15 @@
|
||||
#include "qt/view/QtCodeView.h"
|
||||
#include "qt/view/QtCompositeView.h"
|
||||
#include "qt/view/QtDialogView.h"
|
||||
#include "qt/view/QtErrorView.h"
|
||||
#include "qt/view/QtGraphView.h"
|
||||
#include "qt/view/QtGraphViewStyleImpl.h"
|
||||
#include "qt/view/QtLogView.h"
|
||||
#include "qt/view/QtMainView.h"
|
||||
#include "qt/view/QtRefreshView.h"
|
||||
#include "qt/view/QtSearchView.h"
|
||||
#include "qt/view/QtStatusBarView.h"
|
||||
#include "qt/view/QtTabbedView.h"
|
||||
#include "qt/view/QtUndoRedoView.h"
|
||||
|
||||
QtViewFactory::QtViewFactory()
|
||||
@@ -34,11 +37,29 @@ std::shared_ptr<CompositeView> QtViewFactory::createCompositeView(
|
||||
return ptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<TabbedView> QtViewFactory::createTabbedView(ViewLayout* viewLayout, const std::string& name) const
|
||||
{
|
||||
std::shared_ptr<TabbedView> ptr = std::make_shared<QtTabbedView>(viewLayout, name);
|
||||
ptr->init();
|
||||
ptr->addToLayout();
|
||||
return ptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<CodeView> QtViewFactory::createCodeView(ViewLayout* viewLayout) const
|
||||
{
|
||||
return View::createInitAndAddToLayout<QtCodeView>(viewLayout);
|
||||
}
|
||||
|
||||
std::shared_ptr<ErrorView> QtViewFactory::createErrorView(ViewLayout* viewLayout) const
|
||||
{
|
||||
return View::createInitAndAddToLayout<QtErrorView>(viewLayout);
|
||||
}
|
||||
|
||||
std::shared_ptr<LogView> QtViewFactory::createLogView(ViewLayout* viewLayout) const
|
||||
{
|
||||
return View::createInitAndAddToLayout<QtLogView>(viewLayout);
|
||||
}
|
||||
|
||||
std::shared_ptr<GraphView> QtViewFactory::createGraphView(ViewLayout* viewLayout) const
|
||||
{
|
||||
GraphViewStyle::setImpl(std::make_shared<QtGraphViewStyleImpl>());
|
||||
|
||||
@@ -12,9 +12,12 @@ public:
|
||||
virtual std::shared_ptr<MainView> createMainView() const;
|
||||
virtual std::shared_ptr<CompositeView> createCompositeView(
|
||||
ViewLayout* viewLayout, CompositeView::CompositeDirection direction, const std::string& name) const;
|
||||
virtual std::shared_ptr<TabbedView> createTabbedView(ViewLayout* viewLayout, const std::string& name) const;
|
||||
|
||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const;
|
||||
virtual std::shared_ptr<ErrorView> createErrorView(ViewLayout* viewLayout) const;
|
||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const;
|
||||
virtual std::shared_ptr<LogView> createLogView(ViewLayout* viewLayout) const;
|
||||
virtual std::shared_ptr<RefreshView> createRefreshView(ViewLayout* viewLayout) const;
|
||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const;
|
||||
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const;
|
||||
|
||||
Reference in New Issue
Block a user