diff --git a/src/gui/UBTGWidgetTreeDelegate.cpp b/src/gui/UBTGWidgetTreeDelegate.cpp deleted file mode 100644 index 928beac9..00000000 --- a/src/gui/UBTGWidgetTreeDelegate.cpp +++ /dev/null @@ -1,34 +0,0 @@ - -#include -#include -#include -#include -#include -#include -#include "UBTGWidgetTreeDelegate.h" - -UBTGWidgetTreeDelegate::UBTGWidgetTreeDelegate(QObject *parent) : - QStyledItemDelegate(parent) -{ - //NOOP -} - -void UBTGWidgetTreeDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const -{ - if(index.data(Qt::UserRole) != eUBTGAddSubItemWidgetType_None){ - painter->setBackgroundMode(Qt::OpaqueMode); - painter->setBackground(QBrush(QColor(Qt::red))); - QStyleOptionButton styleButton; - styleButton.text = "pipo"; - styleButton.rect = option.rect; - QApplication::style()->drawControl(QStyle::CE_PushButtonLabel,&styleButton,painter); - } - else - QStyledItemDelegate::paint(painter,option,index); -} - -QSize UBTGWidgetTreeDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const -{ - QSize size = QStyledItemDelegate::sizeHint(option,index); - return size; -} diff --git a/src/gui/UBTGWidgetTreeDelegate.h b/src/gui/UBTGWidgetTreeDelegate.h deleted file mode 100644 index 75343346..00000000 --- a/src/gui/UBTGWidgetTreeDelegate.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef UBTGWIDGETTREEDELEGATE_H -#define UBTGWIDGETTREEDELEGATE_H - -class QPainter; -class QStyleOptionViewItem; -class QModelIndex; - -#include - - -typedef enum -{ - eUBTGAddSubItemWidgetType_None, - eUBTGAddSubItemWidgetType_Action , - eUBTGAddSubItemWidgetType_Media, - eUBTGAddSubItemWidgetType_Url -}eUBTGAddSubItemWidgetType; - - -class UBTGWidgetTreeDelegate : public QStyledItemDelegate -{ - Q_OBJECT -public: - explicit UBTGWidgetTreeDelegate(QObject *parent = 0); - - virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; - virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; - -signals: - -public slots: - -}; - -#endif // UBTGWIDGETTREEDELEGATE_H diff --git a/src/gui/gui.pri b/src/gui/gui.pri index a1dd1218..c6430a24 100644 --- a/src/gui/gui.pri +++ b/src/gui/gui.pri @@ -51,8 +51,7 @@ HEADERS += src/gui/UBThumbnailView.h \ src/gui/UBDockTeacherGuideWidget.h \ src/gui/UBTeacherGuideWidget.h \ src/gui/UBTeacherGuideWidgetsTools.h \ - src/gui/UBTeacherGuideDelegate.h \ - src/gui/UBTGWidgetTreeDelegate.h + src/gui/UBTeacherGuideDelegate.h SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBFloatingPalette.cpp \ @@ -106,8 +105,7 @@ SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBDockTeacherGuideWidget.cpp \ src/gui/UBTeacherGuideWidget.cpp \ src/gui/UBTeacherGuideWidgetsTools.cpp \ - src/gui/UBTeacherGuideDelegate.cpp \ - src/gui/UBTGWidgetTreeDelegate.cpp + src/gui/UBTeacherGuideDelegate.cpp win32 {