memspyui/ui/hb/inc/memspyprocessview.h
changeset 35 98924d2efce9
parent 17 4f2773374eff
equal deleted inserted replaced
34:e0ec97ec3cc4 35:98924d2efce9
    18 #ifndef MEMSPYPROCESSVIEW_H_
    18 #ifndef MEMSPYPROCESSVIEW_H_
    19 #define MEMSPYPROCESSVIEW_H_
    19 #define MEMSPYPROCESSVIEW_H_
    20 
    20 
    21 #include <QAbstractListModel>
    21 #include <QAbstractListModel>
    22 
    22 
    23 #include "memspyview.h"
    23 #include "memspylistview.h"
    24 #include "enginewrapper.h"
    24 #include "enginewrapper.h"
    25 
    25 
    26 
    26 
    27 class MemSpyProcessModel : public QAbstractListModel
    27 class MemSpyProcessModel : public QAbstractListModel
    28 {
    28 {
    33 	
    33 	
    34 	int rowCount(const QModelIndex &parent = QModelIndex()) const;
    34 	int rowCount(const QModelIndex &parent = QModelIndex()) const;
    35 	
    35 	
    36 	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    36 	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    37 	
    37 	
       
    38 	void refresh();
       
    39 	
    38 private:
    40 private:
       
    41 	EngineWrapper& mEngine;
       
    42 	
    39 	QList<MemSpyProcess*> mProcesses;
    43 	QList<MemSpyProcess*> mProcesses;
       
    44 	
       
    45 	QMap<int, QString> mPriorityMap;
    40 };
    46 };
    41 
    47 
    42 class MemSpyProcessView : public MemSpyView
    48 class MemSpyProcessView : public MemSpyListView
    43 {
    49 {
    44     Q_OBJECT
    50     Q_OBJECT
    45     
    51     
    46 public:
    52 public:
    47 	MemSpyProcessView(EngineWrapper &engine, ViewManager &viewManager) 
    53 	MemSpyProcessView(EngineWrapper &engine, ViewManager &viewManager) : 
    48 			: MemSpyView(engine, viewManager) {}
    54         MemSpyListView(engine, viewManager),
       
    55 		mModel(0)
       
    56 	{}
       
    57 	
       
    58 public slots:
       
    59     virtual void refresh();
    49 	
    60 	
    50 protected:
    61 protected:
    51 	void initialize(const QVariantMap& params);
    62 	void initialize(const QVariantMap& params);
    52 	
    63 	
    53 protected:
    64 protected:
    54 	virtual bool isRefreshable() const { return true; }
    65 	virtual bool isRefreshable() const { return true; }
    55 	
    66 	
    56 private slots:
    67 private slots:
    57 	void itemClicked(const QModelIndex& index);
    68 	void itemClicked(const QModelIndex& index);
       
    69 	
       
    70 private:
       
    71 	MemSpyProcessModel* mModel;
    58 };
    72 };
    59 
    73 
    60 #endif /* MEMSPYPROCESSVIEW_H_ */
    74 #endif /* MEMSPYPROCESSVIEW_H_ */