mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
Allow to select COM frequencies from ATC view (context menu)
* added functions in component to select COM frequencies * changed views to contain ObjectType in template * function to obtain selected objects in view base class
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <QMenu>
|
||||
#include <QPoint>
|
||||
#include <QFont>
|
||||
#include <QList>
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -63,6 +64,12 @@ namespace BlackGui
|
||||
//! Horizontal font height
|
||||
int getHorizontalHeaderFontHeight() const;
|
||||
|
||||
//! Selection (selected rows)
|
||||
bool hasSelection() const;
|
||||
|
||||
//! Selected rows if any
|
||||
QModelIndexList selectedRows() const;
|
||||
|
||||
signals:
|
||||
//! Ask for new data
|
||||
void requestUpdate();
|
||||
@@ -140,7 +147,7 @@ namespace BlackGui
|
||||
};
|
||||
|
||||
//! Base class for views
|
||||
template <class ModelClass, class ContainerType> class CViewBase : public CViewBaseNonTemplate
|
||||
template <class ModelClass, class ContainerType, class ObjectType> class CViewBase : public CViewBaseNonTemplate
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -166,7 +173,7 @@ namespace BlackGui
|
||||
void updateContainerMaybeAsync(const ContainerType &container, bool sort = true, bool performResizing = true);
|
||||
|
||||
//! Insert
|
||||
template<class ObjectType> void insert(const ObjectType &value, bool resize = true)
|
||||
void insert(const ObjectType &value, bool resize = true)
|
||||
{
|
||||
Q_ASSERT(this->m_model);
|
||||
this->m_model->insert(value);
|
||||
@@ -174,12 +181,15 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
//! Value object at
|
||||
template<class ObjectType> const ObjectType &at(const QModelIndex &index) const
|
||||
const ObjectType &at(const QModelIndex &index) const
|
||||
{
|
||||
Q_ASSERT(this->m_model);
|
||||
return this->m_model->at(index);
|
||||
}
|
||||
|
||||
//! Selected objects
|
||||
ContainerType selectedObjects() const;
|
||||
|
||||
//! Row count
|
||||
int rowCount() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user