~kubuntu-members/kompare/4.11

« back to all changes in this revision

Viewing changes to komparepart/komparelistview.h

  • Committer: Kevin Kofler
  • Date: 2011-11-06 02:21:44 UTC
  • Revision ID: git-v1:3e4e8c28f7eeefb0ced641cecf6711d31f6fc55d
Kompare: KompareListViewItem: Convert from rtti() to the new type() mechanism where the type is set in the constructor rather than through a virtual function.

svn path=/trunk/KDE/kdesdk/kompare/; revision=1262744

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
class KompareListViewItem : public QTreeWidgetItem
145
145
{
146
146
public:
147
 
        KompareListViewItem( KompareListView* parent );
148
 
        KompareListViewItem( KompareListView* parent, KompareListViewItem* after );
149
 
        KompareListViewItem( KompareListViewItem* parent );
150
 
        KompareListViewItem( KompareListViewItem* parent, KompareListViewItem* after );
 
147
        KompareListViewItem( KompareListView* parent, int type );
 
148
        KompareListViewItem( KompareListView* parent, KompareListViewItem* after, int type );
 
149
        KompareListViewItem( KompareListViewItem* parent, int type );
 
150
        KompareListViewItem( KompareListViewItem* parent, KompareListViewItem* after, int type );
151
151
 
152
152
        virtual void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column ) = 0;
153
153
 
160
160
        int scrollId() const { return m_scrollId; };
161
161
 
162
162
        virtual int maxHeight() = 0;
163
 
        virtual int rtti(void) const = 0;
164
163
 
165
164
        KompareListView* kompareListView() const;
166
165
 
167
 
        enum ListViewItemType { Diff = 1001, Container = 1002, Line = 1003, Blank = 1004, Hunk = 1005 };
 
166
        enum ListViewItemType { Diff = QTreeWidgetItem::UserType + 1, Container = QTreeWidgetItem::UserType + 2, Line = QTreeWidgetItem::UserType + 3, Blank = QTreeWidgetItem::UserType + 4, Hunk = QTreeWidgetItem::UserType + 5 };
168
167
 
169
168
private:
170
169
        int     m_scrollId;
185
184
        Diff2::Difference* difference() { return m_difference; };
186
185
 
187
186
        virtual int maxHeight();
188
 
        virtual int rtti(void) const { return Diff; };
189
187
 
190
188
        virtual void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column );
191
189
 
209
207
        ~KompareListViewLineContainerItem();
210
208
 
211
209
        virtual int maxHeight() { return 0; }
212
 
        virtual int rtti(void) const { return Container; };
213
210
 
214
211
        virtual void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column );
215
212
 
230
227
{
231
228
public:
232
229
        KompareListViewLineItem( KompareListViewLineContainerItem* parent, int line, Diff2::DifferenceString* text );
 
230
        KompareListViewLineItem( KompareListViewLineContainerItem* parent, int line, Diff2::DifferenceString* text, int type );
233
231
        ~KompareListViewLineItem();
234
232
 
235
233
        virtual int maxHeight() { return 0; }
236
 
        virtual int rtti(void) const { return Line; };
237
234
 
238
235
        virtual void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column );
239
236
 
243
240
        virtual void paintText( QPainter* p, const QColor& bg, int column, int width, int align );
244
241
 
245
242
private:
 
243
        void init( int line, Diff2::DifferenceString* text );
246
244
        void expandTabs(QString& text, int tabstop, int startPos = 0) const;
247
245
 
248
246
private:
254
252
public:
255
253
        KompareListViewBlankLineItem( KompareListViewLineContainerItem* parent );
256
254
 
257
 
        virtual int rtti(void) const { return Blank; };
258
 
 
259
255
protected:
260
256
        virtual void paintText( QPainter* p, const QColor& bg, int column, int width, int align );
261
257
};
270
266
        virtual void paintCell( QPainter* p, const QStyleOptionViewItem& option, int column );
271
267
 
272
268
        virtual int maxHeight();
273
 
        virtual int rtti(void) const { return Hunk; };
274
269
 
275
270
private:
276
271
        bool             m_zeroHeight;