|
|
@ -86,7 +86,7 @@ class UBFeaturesListView : public QListView |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesListView( QWidget* parent=0, const char* name="UBFeaturesListView" ); |
|
|
|
UBFeaturesListView( QWidget* parent=0, const char* name="UBFeaturesListView" ); |
|
|
|
virtual ~UBFeaturesListView() {}; |
|
|
|
virtual ~UBFeaturesListView() {;} |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
virtual void dropEvent( QDropEvent *event ); |
|
|
|
virtual void dropEvent( QDropEvent *event ); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -96,7 +96,7 @@ class UBFeaturesPathViewer : public QGraphicsView |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesPathViewer(const QPixmap &root, const QString &rootPath, QGraphicsScene *sc, QWidget* parent=0, const char* name="UBFeaturesPathViewer"); |
|
|
|
UBFeaturesPathViewer(const QPixmap &root, const QString &rootPath, QGraphicsScene *sc, QWidget* parent=0, const char* name="UBFeaturesPathViewer"); |
|
|
|
virtual ~UBFeaturesPathViewer() {} ; |
|
|
|
virtual ~UBFeaturesPathViewer() {;} |
|
|
|
void addPathElement(const QPixmap &p, const QString &s); |
|
|
|
void addPathElement(const QPixmap &p, const QString &s); |
|
|
|
void truncatePath(int number); |
|
|
|
void truncatePath(int number); |
|
|
|
private: |
|
|
|
private: |
|
|
@ -110,21 +110,22 @@ class UBFolderWidget : public QLabel |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFolderWidget( QWidget * parent = 0, Qt::WindowFlags f = 0 ) : QLabel( parent, f ) {}; |
|
|
|
UBFolderWidget( QWidget * parent = 0, Qt::WindowFlags f = 0 ) : QLabel( parent, f ) {;} |
|
|
|
virtual ~UBFolderWidget() {}; |
|
|
|
virtual ~UBFolderWidget() {;} |
|
|
|
virtual QString getPath()const { return path; }; |
|
|
|
virtual QString getPath()const { return path;} |
|
|
|
virtual void setPath( const QString &p ) { path = p; }; |
|
|
|
virtual void setPath( const QString &p ) { path = p;} |
|
|
|
signals: |
|
|
|
signals: |
|
|
|
void clicked(const QString &); |
|
|
|
void clicked(const QString &); |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
virtual void mouseReleaseEvent ( QMouseEvent * ev )
|
|
|
|
virtual void mouseReleaseEvent ( QMouseEvent * ev ) |
|
|
|
{
|
|
|
|
{
|
|
|
|
emit clicked(path);
|
|
|
|
Q_UNUSED(ev) |
|
|
|
};
|
|
|
|
emit clicked(path); |
|
|
|
|
|
|
|
} |
|
|
|
virtual void mousePressEvent ( QMouseEvent * ev )
|
|
|
|
virtual void mousePressEvent ( QMouseEvent * ev )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ev->accept(); |
|
|
|
ev->accept(); |
|
|
|
};
|
|
|
|
} |
|
|
|
private: |
|
|
|
private: |
|
|
|
QString path; |
|
|
|
QString path; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -179,8 +180,8 @@ class UBFeaturesModel : public QAbstractListModel |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesModel( QObject *parent = 0 ) { }; |
|
|
|
UBFeaturesModel( QObject *parent = 0 ) : QAbstractListModel(parent) {;} |
|
|
|
virtual ~UBFeaturesModel(){}; |
|
|
|
virtual ~UBFeaturesModel(){;} |
|
|
|
|
|
|
|
|
|
|
|
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; |
|
|
|
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; |
|
|
|
QMimeData *mimeData( const QModelIndexList &indexes ) const; |
|
|
|
QMimeData *mimeData( const QModelIndexList &indexes ) const; |
|
|
@ -190,9 +191,9 @@ public: |
|
|
|
bool dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent); |
|
|
|
bool dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent); |
|
|
|
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); |
|
|
|
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); |
|
|
|
bool removeRow(int row, const QModelIndex &parent = QModelIndex()); |
|
|
|
bool removeRow(int row, const QModelIndex &parent = QModelIndex()); |
|
|
|
Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; }; |
|
|
|
Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; } |
|
|
|
|
|
|
|
|
|
|
|
void setFeaturesList( QVector <UBFeature> *flist ) { featuresList = flist; }; |
|
|
|
void setFeaturesList( QVector <UBFeature> *flist ) { featuresList = flist; } |
|
|
|
private: |
|
|
|
private: |
|
|
|
QVector <UBFeature> *featuresList; |
|
|
|
QVector <UBFeature> *featuresList; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -201,8 +202,8 @@ class UBFeaturesProxyModel : public QSortFilterProxyModel |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesProxyModel(QObject *parent = 0) { QSortFilterProxyModel::QSortFilterProxyModel(parent); };
|
|
|
|
UBFeaturesProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {;} |
|
|
|
virtual ~UBFeaturesProxyModel() {}; |
|
|
|
virtual ~UBFeaturesProxyModel() {} |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const; |
|
|
|
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -211,8 +212,8 @@ class UBFeaturesSearchProxyModel : public QSortFilterProxyModel |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesSearchProxyModel(QObject *parent = 0) { QSortFilterProxyModel::QSortFilterProxyModel(parent); };
|
|
|
|
UBFeaturesSearchProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {;} |
|
|
|
virtual ~UBFeaturesSearchProxyModel() {}; |
|
|
|
virtual ~UBFeaturesSearchProxyModel() {} |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const; |
|
|
|
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -221,9 +222,9 @@ class UBFeaturesPathProxyModel : public QSortFilterProxyModel |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesPathProxyModel(QObject *parent = 0) { QSortFilterProxyModel::QSortFilterProxyModel(parent); };
|
|
|
|
UBFeaturesPathProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {;} |
|
|
|
virtual ~UBFeaturesPathProxyModel() {}; |
|
|
|
virtual ~UBFeaturesPathProxyModel() {} |
|
|
|
void setPath( const QString &p ) { path = p; }; |
|
|
|
void setPath( const QString &p ) { path = p; } |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const; |
|
|
|
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const; |
|
|
|
private: |
|
|
|
private: |
|
|
@ -234,8 +235,8 @@ class UBFeaturesItemDelegate : public QStyledItemDelegate |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesItemDelegate(QWidget *parent = 0, const QListView *lw = 0) : QStyledItemDelegate(parent) { listView = lw; }; |
|
|
|
UBFeaturesItemDelegate(QWidget *parent = 0, const QListView *lw = 0) : QStyledItemDelegate(parent) { listView = lw; } |
|
|
|
~UBFeaturesItemDelegate() {}; |
|
|
|
~UBFeaturesItemDelegate() {} |
|
|
|
//UBFeaturesItemDelegate(const QListView *lw = 0) { listView = lw; };
|
|
|
|
//UBFeaturesItemDelegate(const QListView *lw = 0) { listView = lw; };
|
|
|
|
//void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
|
|
|
//void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
|
|
|
//QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
|
|
|
//QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
|
|
|