Restructured locations of source.
This commit is contained in:
parent
78a4c6d730
commit
7c4e8e95e8
151 changed files with 1 additions and 0 deletions
46
src/pglab/ConnectionListModel.h
Normal file
46
src/pglab/ConnectionListModel.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#ifndef CONNECTIONLISTMODEL_H
|
||||
#define CONNECTIONLISTMODEL_H
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include <QAbstractListModel>
|
||||
|
||||
#include "ConnectionConfig.h"
|
||||
#include "Expected.h"
|
||||
|
||||
class ConnectionList;
|
||||
|
||||
/** \brief Model class for the list of connections.
|
||||
*
|
||||
* This class also allows for the editing of the list.
|
||||
*/
|
||||
class ConnectionListModel : public QAbstractListModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConnectionListModel(ConnectionList *conns, QObject *parent);
|
||||
ConnectionListModel(const ConnectionListModel&) = delete;
|
||||
~ConnectionListModel();
|
||||
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
virtual int columnCount(const QModelIndex &/*parent*/) const override;
|
||||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
// virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
||||
void newItem();
|
||||
Expected<ConnectionConfig> get(int row);
|
||||
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
||||
|
||||
void save();
|
||||
void save(int index);
|
||||
private:
|
||||
|
||||
ConnectionList *m_connections;
|
||||
|
||||
|
||||
static QString makeLongDescription(const ConnectionConfig &cfg);
|
||||
};
|
||||
|
||||
#endif // CONNECTIONLISTMODEL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue