CompilerOutputWidget.h

Go to the documentation of this file.
00001 
00002 #ifndef COMPILER_OUTPUT_WIDGET
00003 #define COMPILER_OUTPUT_WIDGET
00004 
00005 
00006 #include <QTreeWidget>
00007 #include <QItemDelegate>
00008 #include <QListView>
00009 #include <QToolButton>
00010 
00011 
00012 class TaskModel;
00013 class TaskView;
00014 
00015 
00020 class CompilerOutputWidget : public QWidget
00021 {
00022     Q_OBJECT
00023 
00024     public:
00025         enum PatternType { Unknown, Warning, Error };
00026 
00027 
00028         CompilerOutputWidget(QWidget * par = NULL);
00029         ~CompilerOutputWidget();
00030 
00031         void clearContents();
00032 
00033         void addItem(PatternType type,const QString &description, const QString &file, int line);
00034 
00035         int numberOfTasks() const;
00036         int numberOfErrors() const;
00037 
00038         void gotoFirstError();
00039 
00040     signals:
00041         void taskClicked(const QString & file, int line);
00042         void tasksChanged();
00043 
00044     private slots:
00045         void showTaskInFile(const QModelIndex &index);
00046         void copy();
00047 
00048     private:
00049         int sizeHintForColumn(int column) const;
00050 
00051         int m_errorCount;
00052         int m_currentTask;
00053 
00054         TaskModel *m_model;
00055         TaskView *m_listview;
00056 };
00057 
00058 #include <QStyledItemDelegate>
00059 
00060 class TaskDelegate : public QStyledItemDelegate
00061 {
00062     Q_OBJECT
00063     public:
00064         TaskDelegate(QObject * parent = 0);
00065         ~TaskDelegate();
00066         void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00067         QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00068 
00069         // TaskView uses this method if the size of the taskview changes
00070         void emitSizeHintChanged(const QModelIndex &index);
00071 
00072     public slots:
00073         void currentChanged(const QModelIndex &current, const QModelIndex &previous);
00074 
00075     private:
00076         void generateGradientPixmap(int width, int height, QColor color, bool selected) const;
00077 };
00078 
00079 
00080 
00081 #endif

Generated on Tue Sep 15 14:48:47 2009 for RoseQtWidgets by  doxygen 1.4.7