code format
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
#ifndef THREADS_VIEW_H
|
||||
#define THREADS_VIEW_H
|
||||
|
||||
#include "ui_threads_view.h"
|
||||
#include <QDebug>
|
||||
#include <QWidget>
|
||||
#include <QHash>
|
||||
#include <QTreeView>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QStyledItemDelegate>
|
||||
#include "piintrospection_threads_p.h"
|
||||
#include "piqt.h"
|
||||
#include "pisystemmonitor.h"
|
||||
#include "piintrospection_threads_p.h"
|
||||
#include "ui_threads_view.h"
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDebug>
|
||||
#include <QHash>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QTreeView>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
class ThreadsModel: public QAbstractItemModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ThreadsModel();
|
||||
|
||||
@@ -24,7 +26,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;
|
||||
@@ -36,25 +38,25 @@ protected:
|
||||
PIVector<PISystemMonitor::ThreadStats> stat;
|
||||
QHash<int, QString> state_names;
|
||||
QHash<int, QColor> state_colors;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
class ContainersDelegate: public QStyledItemDelegate {
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
ContainersDelegate(QAbstractItemModel * m) {model = m;}
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex &index) const override;
|
||||
QAbstractItemModel * model;
|
||||
ContainersDelegate(QAbstractItemModel * m) {model = m;}
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex &index) const override;
|
||||
QAbstractItemModel * model;
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
class ThreadsView: public QWidget, private Ui::ThreadsView
|
||||
{
|
||||
class ThreadsView
|
||||
: public QWidget
|
||||
, private Ui::ThreadsView {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ThreadsView(QWidget * parent = 0);
|
||||
~ThreadsView();
|
||||
@@ -69,12 +71,11 @@ protected:
|
||||
ThreadsModel * model;
|
||||
|
||||
private slots:
|
||||
void sessionSave(QByteArray * data) {*data = treeThreads->header()->saveState();}
|
||||
void sessionLoad(QByteArray * data) {treeThreads->header()->restoreState(*data);}
|
||||
void sessionSave(QByteArray * data) { *data = treeThreads->header()->saveState(); }
|
||||
void sessionLoad(QByteArray * data) { treeThreads->header()->restoreState(*data); }
|
||||
void updateHidden();
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user