Warning, file /sdk/cervisia/annotateview.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * Copyright (C) 1999-2002 Bernd Gehrmann <bernd@mail.berlios.de> 0003 * Copyright (c) 2003-2008 André Wöbbeking <Woebbeking@kde.org> 0004 * Copyright (c) 2015 Martin Koller <kollix@aon.at> 0005 * 0006 * This program is free software; you can redistribute it and/or modify 0007 * it under the terms of the GNU General Public License as published by 0008 * the Free Software Foundation; either version 2 of the License, or 0009 * (at your option) any later version. 0010 * 0011 * This program is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 * GNU General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU General Public License 0017 * along with this program; if not, write to the Free Software 0018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0019 */ 0020 0021 #ifndef ANNOTATEVIEW_H 0022 #define ANNOTATEVIEW_H 0023 0024 #include <QStyledItemDelegate> 0025 #include <QTreeWidget> 0026 0027 namespace Cervisia 0028 { 0029 struct LogInfo; 0030 } 0031 0032 class AnnotateView : public QTreeWidget 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 explicit AnnotateView(QWidget *parent); 0038 0039 void addLine(const Cervisia::LogInfo &logInfo, const QString &content, bool odd); 0040 0041 QSize sizeHint() const override; 0042 0043 int currentLine() const; 0044 int lastLine() const; 0045 void gotoLine(int line); 0046 0047 public slots: 0048 void findText(const QString &textToFind, bool up); 0049 0050 private slots: 0051 void configChanged(); 0052 0053 void slotQueryToolTip(const QPoint &, QRect &, QString &); 0054 }; 0055 0056 class AnnotateViewDelegate : public QStyledItemDelegate 0057 { 0058 Q_OBJECT 0059 0060 public: 0061 explicit AnnotateViewDelegate(AnnotateView *v) 0062 : view(v) 0063 { 0064 } 0065 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 0066 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; 0067 0068 private: 0069 enum { BORDER = 4 }; 0070 AnnotateView *view; 0071 }; 0072 0073 #endif