1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-18 03:21:27 +02:00
vcmi/mapeditor/objectbrowser.h

41 lines
971 B
C
Raw Normal View History

2022-10-13 01:51:55 +04:00
/*
* objectbrowser.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
2022-09-25 00:55:05 +04:00
#pragma once
2022-09-18 03:23:17 +04:00
#include <QSortFilterProxyModel>
#include "../lib/GameConstants.h"
2022-09-18 03:23:17 +04:00
2022-12-04 06:45:39 +04:00
class ObjectBrowserProxyModel : public QSortFilterProxyModel
2022-09-18 03:23:17 +04:00
{
public:
2022-12-04 06:45:39 +04:00
explicit ObjectBrowserProxyModel(QObject *parent = nullptr);
Qt::ItemFlags flags(const QModelIndex &index) const override;
2022-12-21 04:28:56 +04:00
2022-12-04 06:45:39 +04:00
QMimeData * mimeData(const QModelIndexList & indexes) const override;
2022-09-18 03:23:17 +04:00
2022-10-08 23:54:45 +04:00
TerrainId terrain;
2022-09-18 03:23:17 +04:00
QString filter;
protected:
bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const override;
bool filterAcceptsRowText(int source_row, const QModelIndex &source_parent) const;
};
2022-12-04 06:45:39 +04:00
class ObjectBrowser : public QTreeView
{
public:
ObjectBrowser(QWidget * parent);
2022-12-04 14:51:01 +04:00
protected:
void startDrag(Qt::DropActions supportedActions) override;
2022-12-04 06:45:39 +04:00
};