code format

This commit is contained in:
2022-12-14 14:14:33 +03:00
parent 09e5342956
commit cdb02fc9be
278 changed files with 15371 additions and 12176 deletions

View File

@@ -1,16 +1,18 @@
#ifndef CONTAINERS_VIEW_H
#define CONTAINERS_VIEW_H
#include "ui_containers_view.h"
#include <QDebug>
#include <QWidget>
#include <QAbstractItemModel>
#include <QStyledItemDelegate>
#include "piqt.h"
#include "piintrospection_containers_p.h"
#include "piqt.h"
#include "ui_containers_view.h"
#include <QAbstractItemModel>
#include <QDebug>
#include <QStyledItemDelegate>
#include <QWidget>
class ContainersModel: public QAbstractItemModel {
Q_OBJECT
public:
ContainersModel();
@@ -19,7 +21,7 @@ public:
int rowCount(const QModelIndex & parent = QModelIndex()) const;
int columnCount(const QModelIndex & parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex & child) const {return QModelIndex();}
QModelIndex parent(const QModelIndex & child) const { return QModelIndex(); }
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
bool hasChildren(const QModelIndex & parent = QModelIndex()) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
@@ -37,39 +39,40 @@ protected:
public slots:
void setChangesMode(bool yes);
};
class ContainersDelegate: public QStyledItemDelegate {
Q_OBJECT
public:
ContainersDelegate(QAbstractItemModel * m) {model = m;}
void paint(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex &index) const;
ContainersDelegate(QAbstractItemModel * m) { model = m; }
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
QAbstractItemModel * model;
};
class ContainersView: public QWidget, private Ui::ContainersView
{
class ContainersView
: public QWidget
, private Ui::ContainersView {
Q_OBJECT
public:
ContainersView(QWidget * parent = 0);
~ContainersView();
void showContainers(const PIVector<PIIntrospectionContainers::TypeInfo> & t);
void clear();
protected:
void changeEvent(QEvent * e);
ContainersModel * model;
private slots:
void sessionSave(QByteArray * data) {*data = treeContainers->header()->saveState();}
void sessionLoad(QByteArray * data) {treeContainers->header()->restoreState(*data);}
void sessionSave(QByteArray * data) { *data = treeContainers->header()->saveState(); }
void sessionLoad(QByteArray * data) { treeContainers->header()->restoreState(*data); }
public slots:
};