10#include "gui/menus/menuaction.h"
15using namespace swift::misc::aviation;
25 &CAircraftCategoryTreeView::customMenu);
32 if (!this->categoryModel())
36 this->categoryModel()->updateContainer(categories);
47 if (!this->categoryModel())
51 this->categoryModel()->clear();
58 if (this->categoryModel())
60 this->categoryModel()->setColumns(columns);
64 void CAircraftCategoryTreeView::fullResizeToContentsImpl()
70 const int cc = this->categoryModel()->
columnCount();
71 for (
int c = 0; c < cc; c++)
96 return model->container().frontOrDefault();
99 void CAircraftCategoryTreeView::onExpanded(
const QModelIndex &index)
105 void CAircraftCategoryTreeView::customMenu(
const QPoint &point)
107 if (!this->categoryModel())
111 if (this->categoryModel()->container().
isEmpty())
116 auto *menu =
new QMenu(
this);
CAircraftCategoryTreeView(QWidget *parent=nullptr)
Constructor.
void fullResizeToContents()
Resize all columns.
void updateContainer(const swift::misc::aviation::CAircraftCategoryList &categories)
Update container.
bool isEmpty() const
Empty data.
void setColumns(const models::CColumns &columns)
Set columns.
static const QPixmap & resize16()
Resize.
Value object for aircraft categories.
Value object encapsulating a list of ICAO codes.
Models to be used with views, mainly QTableView.
Views, mainly QTableView.
Free functions in swift::misc.
QAbstractItemModel * model() const const
void triggered(bool checked)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
T qobject_cast(QObject *object)
virtual int columnCount(const QModelIndex &parent) const const override
QTreeView(QWidget *parent)
void expanded(const QModelIndex &index)
void resizeColumnToContents(int column)
virtual void setModel(QAbstractItemModel *model) override