mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-22 14:43:46 +00:00
Remove useless begin-/end-ReloadModel methods (#793)
This commit is contained in:
parent
cd4b86fa69
commit
8d3e8a65e1
@ -74,16 +74,6 @@ QVariant BreakpointModel::headerData(int section, Qt::Orientation, int role) con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakpointModel::beginReloadBreakpoint()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BreakpointModel::endReloadBreakpoint()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
BreakpointProxyModel::BreakpointProxyModel(BreakpointModel *sourceModel, QObject *parent)
|
BreakpointProxyModel::BreakpointProxyModel(BreakpointModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -152,9 +142,9 @@ BreakpointWidget::~BreakpointWidget() {}
|
|||||||
|
|
||||||
void BreakpointWidget::refreshBreakpoint()
|
void BreakpointWidget::refreshBreakpoint()
|
||||||
{
|
{
|
||||||
breakpointModel->beginReloadBreakpoint();
|
breakpointModel->beginResetModel();
|
||||||
breakpoints = Core()->getBreakpoints();
|
breakpoints = Core()->getBreakpoints();
|
||||||
breakpointModel->endReloadBreakpoint();
|
breakpointModel->endResetModel();
|
||||||
|
|
||||||
ui->breakpointTreeView->resizeColumnToContents(0);
|
ui->breakpointTreeView->resizeColumnToContents(0);
|
||||||
ui->breakpointTreeView->resizeColumnToContents(1);
|
ui->breakpointTreeView->resizeColumnToContents(1);
|
||||||
|
@ -18,12 +18,14 @@ class BreakpointWidget;
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class BreakpointWidget;
|
||||||
|
|
||||||
class BreakpointModel: public QAbstractListModel
|
class BreakpointModel: public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend BreakpointWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<BreakpointDescription> *breakpoints;
|
QList<BreakpointDescription> *breakpoints;
|
||||||
|
|
||||||
@ -31,16 +33,13 @@ public:
|
|||||||
enum Column { AddrColumn = 0, PermColumn, HwColumn, TraceColumn, EnabledColumn, ColumnCount };
|
enum Column { AddrColumn = 0, PermColumn, HwColumn, TraceColumn, EnabledColumn, ColumnCount };
|
||||||
enum Role { BreakpointDescriptionRole = Qt::UserRole };
|
enum Role { BreakpointDescriptionRole = Qt::UserRole };
|
||||||
|
|
||||||
BreakpointModel(QList<BreakpointDescription> *breakpoints, QObject *parent = 0);
|
BreakpointModel(QList<BreakpointDescription> *breakpoints, QObject *parent = nullptr);
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadBreakpoint();
|
|
||||||
void endReloadBreakpoint();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,16 +164,6 @@ QVariant ClassesModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassesModel::beginReload()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassesModel::endReload()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -254,11 +244,11 @@ void ClassesWidget::flagsChanged()
|
|||||||
|
|
||||||
void ClassesWidget::refreshClasses()
|
void ClassesWidget::refreshClasses()
|
||||||
{
|
{
|
||||||
model->beginReload();
|
model->beginResetModel();
|
||||||
classes = getSource() == Source::BIN
|
classes = getSource() == Source::BIN
|
||||||
? Core()->getAllClassesFromBin()
|
? Core()->getAllClassesFromBin()
|
||||||
: Core()->getAllClassesFromFlags();
|
: Core()->getAllClassesFromFlags();
|
||||||
model->endReload();
|
model->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->classesTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->classesTreeView, 3, 0);
|
||||||
|
|
||||||
|
@ -16,12 +16,15 @@ class ClassesWidget;
|
|||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
class ClassesWidget;
|
||||||
|
|
||||||
|
|
||||||
class ClassesModel: public QAbstractItemModel
|
class ClassesModel: public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend ClassesWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ClassDescription> *classes;
|
QList<ClassDescription> *classes;
|
||||||
|
|
||||||
@ -44,9 +47,6 @@ public:
|
|||||||
QVariant data(const QModelIndex &index, int role) const override;
|
QVariant data(const QModelIndex &index, int role) const override;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation,
|
QVariant headerData(int section, Qt::Orientation orientation,
|
||||||
int role = Qt::DisplayRole) const override;
|
int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
void beginReload();
|
|
||||||
void endReload();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(ClassesModel::RowType)
|
Q_DECLARE_METATYPE(ClassesModel::RowType)
|
||||||
|
@ -161,16 +161,6 @@ QVariant CommentsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommentsModel::beginReloadComments()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommentsModel::endReloadComments()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
CommentsProxyModel::CommentsProxyModel(CommentsModel *sourceModel, QObject *parent)
|
CommentsProxyModel::CommentsProxyModel(CommentsModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -325,7 +315,7 @@ void CommentsWidget::resizeEvent(QResizeEvent *event)
|
|||||||
|
|
||||||
void CommentsWidget::refreshTree()
|
void CommentsWidget::refreshTree()
|
||||||
{
|
{
|
||||||
commentsModel->beginReloadComments();
|
commentsModel->beginResetModel();
|
||||||
|
|
||||||
comments = Core()->getAllComments("CCu");
|
comments = Core()->getAllComments("CCu");
|
||||||
nestedComments.clear();
|
nestedComments.clear();
|
||||||
@ -334,7 +324,7 @@ void CommentsWidget::refreshTree()
|
|||||||
nestedComments[fcnName].append(comment);
|
nestedComments[fcnName].append(comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
commentsModel->endReloadComments();
|
commentsModel->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->commentsTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->commentsTreeView, 3, 0);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class CommentsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class CommentsWidget;
|
class CommentsWidget;
|
||||||
@ -19,6 +20,8 @@ class CommentsModel : public QAbstractItemModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend CommentsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<CommentDescription> *comments;
|
QList<CommentDescription> *comments;
|
||||||
QMap<QString, QList<CommentDescription>> *nestedComments;
|
QMap<QString, QList<CommentDescription>> *nestedComments;
|
||||||
@ -42,9 +45,6 @@ public:
|
|||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadComments();
|
|
||||||
void endReloadComments();
|
|
||||||
|
|
||||||
bool isNested() const;
|
bool isNested() const;
|
||||||
void setNested(bool nested);
|
void setNested(bool nested);
|
||||||
};
|
};
|
||||||
|
@ -706,8 +706,9 @@ void DisassemblyTextEdit::scrollContentsBy(int dx, int dy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisassemblyTextEdit::keyPressEvent(QKeyEvent */*event*/)
|
void DisassemblyTextEdit::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(event)
|
||||||
//QPlainTextEdit::keyPressEvent(event);
|
//QPlainTextEdit::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,16 +68,6 @@ QVariant ExportsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportsModel::beginReloadExports()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExportsModel::endReloadExports()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
ExportsProxyModel::ExportsProxyModel(ExportsModel *source_model, QObject *parent)
|
ExportsProxyModel::ExportsProxyModel(ExportsModel *source_model, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -155,9 +145,9 @@ ExportsWidget::~ExportsWidget() {}
|
|||||||
|
|
||||||
void ExportsWidget::refreshExports()
|
void ExportsWidget::refreshExports()
|
||||||
{
|
{
|
||||||
exportsModel->beginReloadExports();
|
exportsModel->beginResetModel();
|
||||||
exports = Core()->getAllExports();
|
exports = Core()->getAllExports();
|
||||||
exportsModel->endReloadExports();
|
exportsModel->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->exportsTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->exportsTreeView, 3, 0);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
class ExportsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ExportsWidget;
|
class ExportsWidget;
|
||||||
@ -20,6 +21,8 @@ class ExportsModel : public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend ExportsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ExportDescription> *exports;
|
QList<ExportDescription> *exports;
|
||||||
|
|
||||||
@ -34,9 +37,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadExports();
|
|
||||||
void endReloadExports();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExportsProxyModel : public QSortFilterProxyModel
|
class ExportsProxyModel : public QSortFilterProxyModel
|
||||||
|
@ -69,16 +69,6 @@ QVariant FlagsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlagsModel::beginReloadFlags()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FlagsModel::endReloadFlags()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -242,9 +232,9 @@ void FlagsWidget::refreshFlags()
|
|||||||
flagspace = flagspace_data.value<FlagspaceDescription>().name;
|
flagspace = flagspace_data.value<FlagspaceDescription>().name;
|
||||||
|
|
||||||
|
|
||||||
flags_model->beginReloadFlags();
|
flags_model->beginResetModel();
|
||||||
flags = Core()->getAllFlags(flagspace);
|
flags = Core()->getAllFlags(flagspace);
|
||||||
flags_model->endReloadFlags();
|
flags_model->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->flagsTreeView, 2, 0);
|
qhelpers::adjustColumns(ui->flagsTreeView, 2, 0);
|
||||||
|
|
||||||
|
@ -11,12 +11,15 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class FlagsWidget;
|
||||||
|
|
||||||
|
|
||||||
class FlagsModel: public QAbstractListModel
|
class FlagsModel: public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend FlagsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<FlagDescription> *flags;
|
QList<FlagDescription> *flags;
|
||||||
|
|
||||||
@ -31,9 +34,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadFlags();
|
|
||||||
void endReloadFlags();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -260,17 +260,6 @@ QVariant FunctionModel::headerData(int section, Qt::Orientation orientation, int
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionModel::beginReloadFunctions()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FunctionModel::endReloadFunctions()
|
|
||||||
{
|
|
||||||
updateCurrentIndex();
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FunctionModel::setNested(bool nested)
|
void FunctionModel::setNested(bool nested)
|
||||||
{
|
{
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
@ -487,7 +476,7 @@ void FunctionsWidget::refreshTree()
|
|||||||
task = QSharedPointer<FunctionsTask>(new FunctionsTask());
|
task = QSharedPointer<FunctionsTask>(new FunctionsTask());
|
||||||
connect(task.data(), &FunctionsTask::fetchFinished,
|
connect(task.data(), &FunctionsTask::fetchFinished,
|
||||||
this, [this] (const QList<FunctionDescription> &functions) {
|
this, [this] (const QList<FunctionDescription> &functions) {
|
||||||
functionModel->beginReloadFunctions();
|
functionModel->beginResetModel();
|
||||||
|
|
||||||
this->functions = functions;
|
this->functions = functions;
|
||||||
|
|
||||||
@ -498,7 +487,8 @@ void FunctionsWidget::refreshTree()
|
|||||||
|
|
||||||
mainAdress = (ut64)Core()->cmdj("iMj").object()["vaddr"].toInt();
|
mainAdress = (ut64)Core()->cmdj("iMj").object()["vaddr"].toInt();
|
||||||
|
|
||||||
functionModel->endReloadFunctions();
|
functionModel->updateCurrentIndex();
|
||||||
|
functionModel->endResetModel();
|
||||||
|
|
||||||
// resize offset and size columns
|
// resize offset and size columns
|
||||||
qhelpers::adjustColumns(ui->functionsTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->functionsTreeView, 3, 0);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
class FunctionsTask;
|
class FunctionsTask;
|
||||||
|
class FunctionsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class FunctionsWidget;
|
class FunctionsWidget;
|
||||||
@ -22,6 +23,8 @@ class FunctionModel : public QAbstractItemModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend FunctionsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<FunctionDescription> *functions;
|
QList<FunctionDescription> *functions;
|
||||||
QSet<RVA> *importAddresses;
|
QSet<RVA> *importAddresses;
|
||||||
@ -59,9 +62,6 @@ public:
|
|||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadFunctions();
|
|
||||||
void endReloadFunctions();
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @return true if the index changed
|
* @return true if the index changed
|
||||||
*/
|
*/
|
||||||
|
@ -64,16 +64,6 @@ QVariant HeadersModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeadersModel::beginReloadHeaders()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HeadersModel::endReloadHeaders()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
HeadersProxyModel::HeadersProxyModel(HeadersModel *sourceModel, QObject *parent)
|
HeadersProxyModel::HeadersProxyModel(HeadersModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -128,9 +118,9 @@ HeadersWidget::~HeadersWidget() {}
|
|||||||
|
|
||||||
void HeadersWidget::refreshHeaders()
|
void HeadersWidget::refreshHeaders()
|
||||||
{
|
{
|
||||||
headersModel->beginReloadHeaders();
|
headersModel->beginResetModel();
|
||||||
headers = Core()->getAllHeaders();
|
headers = Core()->getAllHeaders();
|
||||||
headersModel->endReloadHeaders();
|
headersModel->endResetModel();
|
||||||
|
|
||||||
ui->headersTreeView->resizeColumnToContents(0);
|
ui->headersTreeView->resizeColumnToContents(0);
|
||||||
ui->headersTreeView->resizeColumnToContents(1);
|
ui->headersTreeView->resizeColumnToContents(1);
|
||||||
|
@ -19,12 +19,15 @@ class HeadersWidget;
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class HeadersWidget;
|
||||||
|
|
||||||
|
|
||||||
class HeadersModel: public QAbstractListModel
|
class HeadersModel: public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend HeadersWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<HeaderDescription> *headers;
|
QList<HeaderDescription> *headers;
|
||||||
|
|
||||||
@ -39,9 +42,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadHeaders();
|
|
||||||
void endReloadHeaders();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,16 +76,6 @@ QVariant ImportsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportsModel::beginReload()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImportsModel::endReload()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImportsProxyModel::ImportsProxyModel(ImportsModel *sourceModel, QObject *parent)
|
ImportsProxyModel::ImportsProxyModel(ImportsModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -167,9 +157,9 @@ ImportsWidget::~ImportsWidget() {}
|
|||||||
|
|
||||||
void ImportsWidget::refreshImports()
|
void ImportsWidget::refreshImports()
|
||||||
{
|
{
|
||||||
importsModel->beginReload();
|
importsModel->beginResetModel();
|
||||||
imports = Core()->getAllImports();
|
imports = Core()->getAllImports();
|
||||||
importsModel->endReload();
|
importsModel->endResetModel();
|
||||||
qhelpers::adjustColumns(ui->importsTreeView, 4, 0);
|
qhelpers::adjustColumns(ui->importsTreeView, 4, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
class ImportsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ImportsWidget;
|
class ImportsWidget;
|
||||||
@ -23,6 +24,8 @@ class ImportsModel : public QAbstractTableModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend ImportsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QRegularExpression banned = QRegularExpression(QStringLiteral(
|
const QRegularExpression banned = QRegularExpression(QStringLiteral(
|
||||||
"\\A(\\w\\.)*(system|strcpy|strcpyA|strcpyW|wcscpy|_tcscpy|_mbscpy|StrCpy|StrCpyA|StrCpyW|lstrcpy|lstrcpyA|lstrcpyW"
|
"\\A(\\w\\.)*(system|strcpy|strcpyA|strcpyW|wcscpy|_tcscpy|_mbscpy|StrCpy|StrCpyA|StrCpyW|lstrcpy|lstrcpyA|lstrcpyW"
|
||||||
@ -52,9 +55,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||||
|
|
||||||
void beginReload();
|
|
||||||
void endReload();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ImportsProxyModel : public QSortFilterProxyModel
|
class ImportsProxyModel : public QSortFilterProxyModel
|
||||||
|
@ -68,16 +68,6 @@ QVariant MemoryMapModel::headerData(int section, Qt::Orientation, int role) cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryMapModel::beginReloadMemoryMap()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryMapModel::endReloadMemoryMap()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
MemoryProxyModel::MemoryProxyModel(MemoryMapModel *sourceModel, QObject *parent)
|
MemoryProxyModel::MemoryProxyModel(MemoryMapModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -136,9 +126,9 @@ MemoryMapWidget::~MemoryMapWidget() {}
|
|||||||
|
|
||||||
void MemoryMapWidget::refreshMemoryMap()
|
void MemoryMapWidget::refreshMemoryMap()
|
||||||
{
|
{
|
||||||
memoryModel->beginReloadMemoryMap();
|
memoryModel->beginResetModel();
|
||||||
memoryMaps = Core()->getMemoryMap();
|
memoryMaps = Core()->getMemoryMap();
|
||||||
memoryModel->endReloadMemoryMap();
|
memoryModel->endResetModel();
|
||||||
|
|
||||||
ui->memoryTreeView->resizeColumnToContents(0);
|
ui->memoryTreeView->resizeColumnToContents(0);
|
||||||
ui->memoryTreeView->resizeColumnToContents(1);
|
ui->memoryTreeView->resizeColumnToContents(1);
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
class MemoryMapWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MemoryMapWidget;
|
class MemoryMapWidget;
|
||||||
@ -24,6 +25,8 @@ class MemoryMapModel: public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend MemoryMapWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<MemoryMapDescription> *memoryMaps;
|
QList<MemoryMapDescription> *memoryMaps;
|
||||||
|
|
||||||
@ -38,9 +41,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadMemoryMap();
|
|
||||||
void endReloadMemoryMap();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,16 +66,6 @@ QVariant RegisterRefModel::headerData(int section, Qt::Orientation, int role) co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterRefModel::beginReloadRegisterRef()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegisterRefModel::endReloadRegisterRef()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
RegisterRefProxyModel::RegisterRefProxyModel(RegisterRefModel *sourceModel, QObject *parent)
|
RegisterRefProxyModel::RegisterRefProxyModel(RegisterRefModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -151,9 +141,9 @@ RegisterRefsWidget::~RegisterRefsWidget() {}
|
|||||||
|
|
||||||
void RegisterRefsWidget::refreshRegisterRef()
|
void RegisterRefsWidget::refreshRegisterRef()
|
||||||
{
|
{
|
||||||
registerRefModel->beginReloadRegisterRef();
|
registerRefModel->beginResetModel();
|
||||||
registerRefs = Core()->getRegisterRefs();
|
registerRefs = Core()->getRegisterRefs();
|
||||||
registerRefModel->endReloadRegisterRef();
|
registerRefModel->endResetModel();
|
||||||
|
|
||||||
ui->registerRefTreeView->resizeColumnToContents(0);
|
ui->registerRefTreeView->resizeColumnToContents(0);
|
||||||
ui->registerRefTreeView->resizeColumnToContents(1);
|
ui->registerRefTreeView->resizeColumnToContents(1);
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
class RegisterRefsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class RegisterRefsWidget;
|
class RegisterRefsWidget;
|
||||||
@ -24,6 +25,8 @@ class RegisterRefModel: public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend RegisterRefsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<RegisterRefDescription> *registerRefs;
|
QList<RegisterRefDescription> *registerRefs;
|
||||||
|
|
||||||
@ -38,9 +41,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadRegisterRef();
|
|
||||||
void endReloadRegisterRef();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,16 +59,6 @@ QVariant RelocsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RelocsModel::beginReload()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RelocsModel::endReload()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
RelocsProxyModel::RelocsProxyModel(RelocsModel *sourceModel, QObject *parent)
|
RelocsProxyModel::RelocsProxyModel(RelocsModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -152,9 +142,9 @@ void RelocsWidget::on_relocsTreeView_doubleClicked(const QModelIndex &index)
|
|||||||
|
|
||||||
void RelocsWidget::refreshRelocs()
|
void RelocsWidget::refreshRelocs()
|
||||||
{
|
{
|
||||||
relocsModel->beginReload();
|
relocsModel->beginResetModel();
|
||||||
relocs = Core()->getAllRelocs();
|
relocs = Core()->getAllRelocs();
|
||||||
relocsModel->endReload();
|
relocsModel->endResetModel();
|
||||||
qhelpers::adjustColumns(ui->relocsTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->relocsTreeView, 3, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "Cutter.h"
|
#include "Cutter.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
class RelocsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class RelocsWidget;
|
class RelocsWidget;
|
||||||
@ -18,6 +19,8 @@ class RelocsModel : public QAbstractTableModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend RelocsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<RelocDescription> *relocs;
|
QList<RelocDescription> *relocs;
|
||||||
|
|
||||||
@ -32,9 +35,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||||
|
|
||||||
void beginReload();
|
|
||||||
void endReload();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class RelocsProxyModel : public QSortFilterProxyModel
|
class RelocsProxyModel : public QSortFilterProxyModel
|
||||||
|
@ -73,16 +73,6 @@ QVariant ResourcesModel::headerData(int section, Qt::Orientation, int role) cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourcesModel::beginReload()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcesModel::endReload()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
ResourcesWidget::ResourcesWidget(MainWindow *main, QAction *action) :
|
ResourcesWidget::ResourcesWidget(MainWindow *main, QAction *action) :
|
||||||
CutterDockWidget(main, action)
|
CutterDockWidget(main, action)
|
||||||
{
|
{
|
||||||
@ -106,9 +96,9 @@ ResourcesWidget::ResourcesWidget(MainWindow *main, QAction *action) :
|
|||||||
|
|
||||||
void ResourcesWidget::refreshResources()
|
void ResourcesWidget::refreshResources()
|
||||||
{
|
{
|
||||||
model->beginReload();
|
model->beginResetModel();
|
||||||
resources = Core()->getAllResources();
|
resources = Core()->getAllResources();
|
||||||
model->endReload();
|
model->endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourcesWidget::onDoubleClicked(const QModelIndex &index)
|
void ResourcesWidget::onDoubleClicked(const QModelIndex &index)
|
||||||
|
@ -8,11 +8,14 @@
|
|||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
class ResourcesWidget;
|
||||||
|
|
||||||
class ResourcesModel : public QAbstractListModel
|
class ResourcesModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend ResourcesWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ResourcesDescription> *resources;
|
QList<ResourcesDescription> *resources;
|
||||||
|
|
||||||
@ -26,9 +29,6 @@ public:
|
|||||||
QVariant data(const QModelIndex &index, int role) const override;
|
QVariant data(const QModelIndex &index, int role) const override;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation,
|
QVariant headerData(int section, Qt::Orientation orientation,
|
||||||
int role = Qt::DisplayRole) const override;
|
int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
void beginReload();
|
|
||||||
void endReload();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ResourcesWidget : public CutterDockWidget
|
class ResourcesWidget : public CutterDockWidget
|
||||||
|
@ -71,16 +71,6 @@ QVariant SearchModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchModel::beginReloadSearch()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchModel::endReloadSearch()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SearchSortFilterProxyModel::SearchSortFilterProxyModel(SearchModel *source_model, QObject *parent)
|
SearchSortFilterProxyModel::SearchSortFilterProxyModel(SearchModel *source_model, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
@ -192,9 +182,9 @@ void SearchWidget::refreshSearch()
|
|||||||
QVariant searchspace_data = ui->searchspaceCombo->currentData();
|
QVariant searchspace_data = ui->searchspaceCombo->currentData();
|
||||||
QString searchspace = searchspace_data.toString();
|
QString searchspace = searchspace_data.toString();
|
||||||
|
|
||||||
search_model->beginReloadSearch();
|
search_model->beginResetModel();
|
||||||
search = Core()->getAllSearch(search_for, searchspace);
|
search = Core()->getAllSearch(search_for, searchspace);
|
||||||
search_model->endReloadSearch();
|
search_model->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->searchTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->searchTreeView, 3, 0);
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,15 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class SearchWidget;
|
||||||
|
|
||||||
|
|
||||||
class SearchModel: public QAbstractListModel
|
class SearchModel: public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend SearchWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<SearchDescription> *search;
|
QList<SearchDescription> *search;
|
||||||
|
|
||||||
@ -31,9 +34,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadSearch();
|
|
||||||
void endReloadSearch();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,16 +92,6 @@ QVariant SectionsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SectionsModel::beginReloadSections()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SectionsModel::endReloadSections()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
SectionsProxyModel::SectionsProxyModel(SectionsModel *sourceModel, QObject *parent)
|
SectionsProxyModel::SectionsProxyModel(SectionsModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -164,9 +154,9 @@ SectionsWidget::~SectionsWidget() {}
|
|||||||
|
|
||||||
void SectionsWidget::refreshSections()
|
void SectionsWidget::refreshSections()
|
||||||
{
|
{
|
||||||
sectionsModel->beginReloadSections();
|
sectionsModel->beginResetModel();
|
||||||
sections = Core()->getAllSections();
|
sections = Core()->getAllSections();
|
||||||
sectionsModel->endReloadSections();
|
sectionsModel->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(sectionsTable, SectionsModel::ColumnCount, 0);
|
qhelpers::adjustColumns(sectionsTable, SectionsModel::ColumnCount, 0);
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,14 @@
|
|||||||
class QTreeView;
|
class QTreeView;
|
||||||
class QAbstractItemView;
|
class QAbstractItemView;
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
class SectionsWidget;
|
||||||
|
|
||||||
class SectionsModel : public QAbstractListModel
|
class SectionsModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend SectionsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<SectionDescription> *sections;
|
QList<SectionDescription> *sections;
|
||||||
|
|
||||||
@ -31,9 +34,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadSections();
|
|
||||||
void endReloadSections();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SectionsProxyModel : public QSortFilterProxyModel
|
class SectionsProxyModel : public QSortFilterProxyModel
|
||||||
|
@ -77,16 +77,6 @@ QVariant StringsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StringsModel::beginReload()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void StringsModel::endReload()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
StringsSortFilterProxyModel::StringsSortFilterProxyModel(StringsModel *source_model,
|
StringsSortFilterProxyModel::StringsSortFilterProxyModel(StringsModel *source_model,
|
||||||
QObject *parent)
|
QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
@ -185,9 +175,9 @@ void StringsWidget::refreshStrings()
|
|||||||
|
|
||||||
void StringsWidget::stringSearchFinished(const QList<StringDescription> &strings)
|
void StringsWidget::stringSearchFinished(const QList<StringDescription> &strings)
|
||||||
{
|
{
|
||||||
model->beginReload();
|
model->beginResetModel();
|
||||||
this->strings = strings;
|
this->strings = strings;
|
||||||
model->endReload();
|
model->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->stringsTreeView, 5, 0);
|
qhelpers::adjustColumns(ui->stringsTreeView, 5, 0);
|
||||||
if (ui->stringsTreeView->columnWidth(1) > 300)
|
if (ui->stringsTreeView->columnWidth(1) > 300)
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class StringsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class StringsWidget;
|
class StringsWidget;
|
||||||
@ -21,6 +22,8 @@ class StringsModel: public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend StringsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<StringDescription> *strings;
|
QList<StringDescription> *strings;
|
||||||
|
|
||||||
@ -35,9 +38,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReload();
|
|
||||||
void endReload();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,16 +65,6 @@ QVariant SymbolsModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbolsModel::beginReloadSymbols()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SymbolsModel::endReloadSymbols()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
SymbolsProxyModel::SymbolsProxyModel(SymbolsModel *sourceModel, QObject *parent)
|
SymbolsProxyModel::SymbolsProxyModel(SymbolsModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -154,9 +144,9 @@ void SymbolsWidget::on_symbolsTreeView_doubleClicked(const QModelIndex &index)
|
|||||||
|
|
||||||
void SymbolsWidget::refreshSymbols()
|
void SymbolsWidget::refreshSymbols()
|
||||||
{
|
{
|
||||||
symbolsModel->beginReloadSymbols();
|
symbolsModel->beginResetModel();
|
||||||
symbols = Core()->getAllSymbols();
|
symbols = Core()->getAllSymbols();
|
||||||
symbolsModel->endReloadSymbols();
|
symbolsModel->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->symbolsTreeView, SymbolsModel::ColumnCount, 0);
|
qhelpers::adjustColumns(ui->symbolsTreeView, SymbolsModel::ColumnCount, 0);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class SymbolsWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class SymbolsWidget;
|
class SymbolsWidget;
|
||||||
@ -19,6 +20,8 @@ class SymbolsModel: public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend SymbolsWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<SymbolDescription> *symbols;
|
QList<SymbolDescription> *symbols;
|
||||||
|
|
||||||
@ -33,9 +36,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadSymbols();
|
|
||||||
void endReloadSymbols();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SymbolsProxyModel : public QSortFilterProxyModel
|
class SymbolsProxyModel : public QSortFilterProxyModel
|
||||||
|
@ -64,15 +64,6 @@ QVariant TypesModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypesModel::beginReloadTypes()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TypesModel::endReloadTypes()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypesSortFilterProxyModel::TypesSortFilterProxyModel(TypesModel *source_model, QObject *parent)
|
TypesSortFilterProxyModel::TypesSortFilterProxyModel(TypesModel *source_model, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
@ -128,9 +119,9 @@ TypesWidget::~TypesWidget() {}
|
|||||||
|
|
||||||
void TypesWidget::refreshTypes()
|
void TypesWidget::refreshTypes()
|
||||||
{
|
{
|
||||||
types_model->beginReloadTypes();
|
types_model->beginResetModel();
|
||||||
types = Core()->getAllTypes();
|
types = Core()->getAllTypes();
|
||||||
types_model->endReloadTypes();
|
types_model->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->typesTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->typesTreeView, 3, 0);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
class TypesWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class TypesWidget;
|
class TypesWidget;
|
||||||
@ -25,6 +26,8 @@ class TypesModel: public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend TypesWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<TypeDescription> *types;
|
QList<TypeDescription> *types;
|
||||||
|
|
||||||
@ -39,9 +42,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReloadTypes();
|
|
||||||
void endReloadTypes();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,15 +92,6 @@ QVariant VTableModel::headerData(int section, Qt::Orientation, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VTableModel::beginReload()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void VTableModel::endReload()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
VTableSortFilterProxyModel::VTableSortFilterProxyModel(VTableModel *model, QObject *parent)
|
VTableSortFilterProxyModel::VTableSortFilterProxyModel(VTableModel *model, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
@ -169,9 +160,9 @@ VTablesWidget::~VTablesWidget()
|
|||||||
|
|
||||||
void VTablesWidget::refreshVTables()
|
void VTablesWidget::refreshVTables()
|
||||||
{
|
{
|
||||||
model->beginReload();
|
model->beginResetModel();
|
||||||
vtables = Core()->getAllVTables();
|
vtables = Core()->getAllVTables();
|
||||||
model->endReload();
|
model->endResetModel();
|
||||||
|
|
||||||
qhelpers::adjustColumns(ui->vTableTreeView, 3, 0);
|
qhelpers::adjustColumns(ui->vTableTreeView, 3, 0);
|
||||||
|
|
||||||
|
@ -14,11 +14,14 @@ class VTablesWidget;
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
class VTablesWidget;
|
||||||
|
|
||||||
class VTableModel : public QAbstractItemModel
|
class VTableModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend VTablesWidget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<VTableDescription> *vtables;
|
QList<VTableDescription> *vtables;
|
||||||
|
|
||||||
@ -36,9 +39,6 @@ public:
|
|||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
void beginReload();
|
|
||||||
void endReload();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class VTableSortFilterProxyModel : public QSortFilterProxyModel
|
class VTableSortFilterProxyModel : public QSortFilterProxyModel
|
||||||
|
@ -78,16 +78,6 @@ QVariant ZignaturesModel::headerData(int section, Qt::Orientation, int role) con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZignaturesModel::beginReloadZignatures()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZignaturesModel::endReloadZignatures()
|
|
||||||
{
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZignaturesProxyModel::ZignaturesProxyModel(ZignaturesModel *sourceModel, QObject *parent)
|
ZignaturesProxyModel::ZignaturesProxyModel(ZignaturesModel *sourceModel, QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@ -143,9 +133,9 @@ ZignaturesWidget::~ZignaturesWidget() {}
|
|||||||
|
|
||||||
void ZignaturesWidget::refreshZignatures()
|
void ZignaturesWidget::refreshZignatures()
|
||||||
{
|
{
|
||||||
zignaturesModel->beginReloadZignatures();
|
zignaturesModel->beginResetModel();
|
||||||
zignatures = Core()->getAllZignatures();
|
zignatures = Core()->getAllZignatures();
|
||||||
zignaturesModel->endReloadZignatures();
|
zignaturesModel->endResetModel();
|
||||||
|
|
||||||
ui->zignaturesTreeView->resizeColumnToContents(0);
|
ui->zignaturesTreeView->resizeColumnToContents(0);
|
||||||
ui->zignaturesTreeView->resizeColumnToContents(1);
|
ui->zignaturesTreeView->resizeColumnToContents(1);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
class MainWindow;
|
class MainWindow;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
class ZignaturesWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ZignaturesWidget;
|
class ZignaturesWidget;
|
||||||
@ -21,6 +22,8 @@ class ZignaturesModel : public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend ZignaturesWidget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Column { OffsetColumn = 0, NameColumn, ValueColumn, ColumnCount };
|
enum Column { OffsetColumn = 0, NameColumn, ValueColumn, ColumnCount };
|
||||||
enum Role { ZignatureDescriptionRole = Qt::UserRole };
|
enum Role { ZignatureDescriptionRole = Qt::UserRole };
|
||||||
@ -33,9 +36,6 @@ public:
|
|||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
|
|
||||||
void beginReloadZignatures();
|
|
||||||
void endReloadZignatures();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ZignatureDescription> *zignatures;
|
QList<ZignatureDescription> *zignatures;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user