ProjectItemModel Class Reference

Public Types

enum  { TypeRole = Qt::UserRole , IdRole , DiskPathRole , SortRole }
 
enum  { FileType , FolderType }
 
enum  {
  COL_NAME = 0 , COL_TYPE , COL_SIZE_ON_DISK , COL_CREATED ,
  COL_LAST_OPENED , COL_STATUS , COLUMN_COUNT
}
 

Signals

void itemsDropped (Qt::DropAction action, const QList< QString > fileIds, const QList< QString > folderIds, const QList< QUrl > newUrls, ProjectFolderRef newParentFolder)
 
void projectFileCreated (ProjectFileRef projectFile)
 
void projectFileUpdated (ProjectFileRef projectFile)
 
void projectFileDeleted (ProjectFileRef projectFile)
 
void projectFolderCreated (ProjectFolderRef projectFolder)
 
void projectFolderUpdated (ProjectFolderRef projectFolder)
 
void projectFolderDeleted (ProjectFolderRef projectFolder)
 

Public Member Functions

 ProjectItemModel (ProjectRef project, QObject *parent=nullptr)
 
 ~ProjectItemModel ()
 
QStandardItem * ItemForId (const std::string &id)
 
void reloadData (const std::function< bool(size_t, size_t)> &progress=[](size_t, size_t){ return true;})
 
virtual QMimeData * mimeData (const QModelIndexList &indexes) const override
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
virtual bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
- Public Member Functions inherited from BinaryNinja::ProjectNotification
 ProjectNotification ()
 
virtual ~ProjectNotification ()
 
BNProjectNotificationGetCallbacks ()
 
virtual bool OnBeforeOpenProject (Project *project)
 
virtual void OnAfterOpenProject (Project *project)
 
virtual bool OnBeforeCloseProject (Project *project)
 
virtual void OnAfterCloseProject (Project *project)
 
virtual bool OnBeforeProjectMetadataWritten (Project *project, std::string &key, Metadata *value)
 
virtual void OnAfterProjectMetadataWritten (Project *project, std::string &key, Metadata *value)
 
virtual bool OnBeforeProjectFileCreated (Project *project, ProjectFile *projectFile)
 
virtual void OnAfterProjectFileCreated (Project *project, ProjectFile *projectFile)
 
virtual bool OnBeforeProjectFileUpdated (Project *project, ProjectFile *projectFile)
 
virtual void OnAfterProjectFileUpdated (Project *project, ProjectFile *projectFile)
 
virtual bool OnBeforeProjectFileDeleted (Project *project, ProjectFile *projectFile)
 
virtual void OnAfterProjectFileDeleted (Project *project, ProjectFile *projectFile)
 
virtual bool OnBeforeProjectFolderCreated (Project *project, ProjectFolder *projectFolder)
 
virtual void OnAfterProjectFolderCreated (Project *project, ProjectFolder *projectFolder)
 
virtual bool OnBeforeProjectFolderUpdated (Project *project, ProjectFolder *projectFolder)
 
virtual void OnAfterProjectFolderUpdated (Project *project, ProjectFolder *projectFolder)
 
virtual bool OnBeforeProjectFolderDeleted (Project *project, ProjectFolder *projectFolder)
 
virtual void OnAfterProjectFolderDeleted (Project *project, ProjectFolder *projectFolder)
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TypeRole 
IdRole 
DiskPathRole 
SortRole 

◆ anonymous enum

anonymous enum
Enumerator
FileType 
FolderType 

◆ anonymous enum

anonymous enum
Enumerator
COL_NAME 
COL_TYPE 
COL_SIZE_ON_DISK 
COL_CREATED 
COL_LAST_OPENED 
COL_STATUS 
COLUMN_COUNT 

Constructor & Destructor Documentation

◆ ProjectItemModel()

ProjectItemModel::ProjectItemModel ( ProjectRef  project,
QObject *  parent = nullptr 
)

◆ ~ProjectItemModel()

ProjectItemModel::~ProjectItemModel ( )

Member Function Documentation

◆ ItemForId()

QStandardItem * ProjectItemModel::ItemForId ( const std::string &  id)

◆ reloadData()

void ProjectItemModel::reloadData ( const std::function< bool(size_t, size_t)> &  progress = [](size_t, size_t){ return true;})

◆ mimeData()

virtual QMimeData * ProjectItemModel::mimeData ( const QModelIndexList &  indexes) const
overridevirtual

◆ dropMimeData()

virtual bool ProjectItemModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
overridevirtual

◆ canDropMimeData()

virtual bool ProjectItemModel::canDropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
) const
overridevirtual

◆ data()

QVariant ProjectItemModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

◆ setData()

virtual bool ProjectItemModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
overridevirtual

◆ itemsDropped

void ProjectItemModel::itemsDropped ( Qt::DropAction  action,
const QList< QString >  fileIds,
const QList< QString >  folderIds,
const QList< QUrl >  newUrls,
ProjectFolderRef  newParentFolder 
)
signal

◆ projectFileCreated

void ProjectItemModel::projectFileCreated ( ProjectFileRef  projectFile)
signal

◆ projectFileUpdated

void ProjectItemModel::projectFileUpdated ( ProjectFileRef  projectFile)
signal

◆ projectFileDeleted

void ProjectItemModel::projectFileDeleted ( ProjectFileRef  projectFile)
signal

◆ projectFolderCreated

void ProjectItemModel::projectFolderCreated ( ProjectFolderRef  projectFolder)
signal

◆ projectFolderUpdated

void ProjectItemModel::projectFolderUpdated ( ProjectFolderRef  projectFolder)
signal

◆ projectFolderDeleted

void ProjectItemModel::projectFolderDeleted ( ProjectFolderRef  projectFolder)
signal