mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-06-03 00:29:55 -04:00
Version 0.14.0
Refactoring of engine and UI code to use model instead of items directly. WARNING: this code is untested yet and commited not for release purposes
This commit is contained in:
parent
9bc65c0590
commit
41fb0cbbf5
10 changed files with 1004 additions and 856 deletions
48
treemodel.h
48
treemodel.h
|
@ -1,13 +1,13 @@
|
|||
/* treemodel.h
|
||||
|
||||
Copyright (c) 2013, Nikolaj Schlej. All rights reserved.
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
*/
|
||||
|
||||
|
@ -28,7 +28,7 @@ class TreeModel : public QAbstractItemModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TreeModel(TreeItem *root, QObject *parent = 0);
|
||||
TreeModel(QObject *parent = 0);
|
||||
~TreeModel();
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
|
@ -40,15 +40,37 @@ public:
|
|||
QModelIndex parent(const QModelIndex &index) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
UINT8 setItemName(const QString &data, const QModelIndex &index);
|
||||
UINT8 setItemText(const QString &data, const QModelIndex &index);
|
||||
UINT8 setItemAction(const UINT8 action, const QModelIndex &index);
|
||||
|
||||
QString nameString(const QModelIndex &index) const;
|
||||
QString actionString(const QModelIndex &index) const;
|
||||
QString typeString(const QModelIndex &index) const;
|
||||
QString subtypeString(const QModelIndex &index) const;
|
||||
QString textString(const QModelIndex &index) const;
|
||||
|
||||
void setAction(const QModelIndex &index, const UINT8 action);
|
||||
void setTypeString(const QModelIndex &index, const QString &text);
|
||||
void setSubtypeString(const QModelIndex &index, const QString &text);
|
||||
void setNameString(const QModelIndex &index, const QString &text);
|
||||
void setTextString(const QModelIndex &index, const QString &text);
|
||||
|
||||
UINT8 type(const QModelIndex &index) const;
|
||||
UINT8 subtype(const QModelIndex &index) const;
|
||||
QByteArray header(const QModelIndex &index) const;
|
||||
bool hasEmptyHeader(const QModelIndex &index) const;
|
||||
QByteArray body(const QModelIndex &index) const;
|
||||
bool hasEmptyBody(const QModelIndex &index) const;
|
||||
QByteArray tail(const QModelIndex &index) const;
|
||||
bool hasEmptyTail(const QModelIndex &index) const;
|
||||
QString info(const QModelIndex &index) const;
|
||||
UINT8 action(const QModelIndex &index) const;
|
||||
UINT8 compression(const QModelIndex &index) const;
|
||||
|
||||
QModelIndex addItem(const UINT8 type, const UINT8 subtype = 0, const UINT8 compression = COMPRESSION_ALGORITHM_NONE,
|
||||
const QString & name = QString(), const QString & text = QString(), const QString & info = QString(),
|
||||
const QString & name = QString(), const QString & text = QString(), const QString & info = QString(),
|
||||
const QByteArray & header = QByteArray(), const QByteArray & body = QByteArray(), const QByteArray & tail = QByteArray(),
|
||||
const QModelIndex & index = QModelIndex(), const UINT8 mode = CREATE_MODE_APPEND);
|
||||
const QModelIndex & parent = QModelIndex(), const UINT8 mode = CREATE_MODE_APPEND);
|
||||
|
||||
QModelIndex findParentOfType(const QModelIndex & index, UINT8 type) const;
|
||||
|
||||
private:
|
||||
TreeItem *rootItem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue