git mv Code\Sandbox\Editor Code/Editor
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_LEVEL_ITEM_MODEL_H
|
||||
#define CRYINCLUDE_EDITOR_LEVEL_ITEM_MODEL_H
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QStandardItemModel>
|
||||
#include <QSortFilterProxyModel>
|
||||
#endif
|
||||
class QString;
|
||||
class QStandardItem;
|
||||
|
||||
class LevelTreeModelFilter
|
||||
: public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LevelTreeModelFilter(QObject* parent = nullptr);
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
|
||||
void setFilterText(const QString&);
|
||||
QVariant data(const QModelIndex& index, int role) const override;
|
||||
private:
|
||||
QString m_filterText;
|
||||
};
|
||||
|
||||
class LevelTreeModel
|
||||
: public QStandardItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Role
|
||||
{
|
||||
FullPathRole = Qt::UserRole + 1,
|
||||
IsLevelFolderRole
|
||||
};
|
||||
|
||||
explicit LevelTreeModel(QObject* parent = nullptr);
|
||||
~LevelTreeModel();
|
||||
void ReloadTree(bool recurseIfNoLevels);
|
||||
void AddItem(const QString& name, const QModelIndex& parent); // Called when clicking "New folder"
|
||||
QVariant data(const QModelIndex& index, int role) const override;
|
||||
private:
|
||||
void ReloadTree(QStandardItem* root, bool recurseIfNoLevels);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user