Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
orthanc-qt/resourcebrowserview.hpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
51 lines (42 sloc)
1.47 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef RESOURCEBROWSERVIEW_HPP | |
#define RESOURCEBROWSERVIEW_HPP | |
#include <QColumnView> | |
#include "orthancitem.hpp" | |
class ResourceBrowserModel:public QAbstractItemModel{ | |
Q_OBJECT | |
OrthancRoot root; | |
OrthancItem *parentFromIndex(const QModelIndex &idx)const; | |
QAtomicPointer<OrthancItem> m_populating; | |
public: | |
ResourceBrowserModel(QString request, QObject *parent=NULL); | |
void updatePreview(const QModelIndex &index, QGraphicsView *preview); | |
// QAbstractItemModel interface | |
public: | |
QModelIndex index(int row, int column, const QModelIndex &parent) const; | |
QModelIndex parent(const QModelIndex &index) const; | |
int rowCount(const QModelIndex &parent) const; | |
int columnCount(const QModelIndex &parent) const; | |
QVariant data(const QModelIndex &index, int role) const; | |
// QAbstractItemModel interface | |
public: | |
bool hasChildren(const QModelIndex &parent) const; | |
public slots: | |
void onChildReady(QModelIndex parent, OrthancItem *child, int at); | |
// QAbstractItemModel interface | |
public: | |
bool canFetchMore(const QModelIndex &parent) const; | |
// QAbstractItemModel interface | |
public: | |
QMimeData *mimeData(const QModelIndexList &indexes) const; | |
Qt::DropActions supportedDragActions() const; | |
Qt::ItemFlags flags(const QModelIndex &index) const; | |
}; | |
class ResourceBrowserView : public QColumnView | |
{ | |
Q_OBJECT | |
public: | |
explicit ResourceBrowserView(QWidget *parent = 0); | |
public slots: | |
void onUpdatePreview(const QModelIndex &index); | |
}; | |
#endif // RESOURCEBROWSERVIEW_HPP |