mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:20:06 +00:00
Display placefiles in settings view
This commit is contained in:
parent
157500e20a
commit
014ea9d39e
6 changed files with 279 additions and 4 deletions
54
scwx-qt/source/scwx/qt/model/placefile_model.hpp
Normal file
54
scwx-qt/source/scwx/qt/model/placefile_model.hpp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/qt/types/text_event_key.hpp>
|
||||
#include <scwx/common/geographic.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
namespace model
|
||||
{
|
||||
|
||||
class PlacefileModelImpl;
|
||||
|
||||
class PlacefileModel : public QAbstractTableModel
|
||||
{
|
||||
public:
|
||||
enum class Column : int
|
||||
{
|
||||
Enabled = 0,
|
||||
Thresholds = 1,
|
||||
Url = 2,
|
||||
Description = 3
|
||||
};
|
||||
|
||||
explicit PlacefileModel(QObject* parent = nullptr);
|
||||
~PlacefileModel();
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
|
||||
QVariant data(const QModelIndex& index,
|
||||
int role = Qt::DisplayRole) const override;
|
||||
QVariant headerData(int section,
|
||||
Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const override;
|
||||
|
||||
public slots:
|
||||
void HandlePlacefileUpdate(const std::string& name);
|
||||
|
||||
private:
|
||||
friend class PlacefileModelImpl;
|
||||
std::unique_ptr<PlacefileModelImpl> p;
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue