Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: debugger/QT/SkListWidget.cpp

Issue 1034733004: Debugger: remove dead feature (SkPicture offset display) & fix bug (unbalanced indents) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « debugger/QT/SkListWidget.h ('k') | src/utils/debugger/SkDebugCanvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkListWidget.h" 10 #include "SkListWidget.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 QIcon breakpointIcon = 56 QIcon breakpointIcon =
57 QIcon(qvariant_cast<QPixmap>(index.data(Qt::DecorationRole))); 57 QIcon(qvariant_cast<QPixmap>(index.data(Qt::DecorationRole)));
58 QIcon deleteIcon = 58 QIcon deleteIcon =
59 QIcon(qvariant_cast<QPixmap>(index.data(Qt::UserRole + 2))); 59 QIcon(qvariant_cast<QPixmap>(index.data(Qt::UserRole + 2)));
60 int indent = index.data(Qt::UserRole + 3).toInt(); 60 int indent = index.data(Qt::UserRole + 3).toInt();
61 61
62 QString drawCommandText = index.data(Qt::DisplayRole).toString(); 62 QString drawCommandText = index.data(Qt::DisplayRole).toString();
63 QString drawCommandNumber; 63 QString drawCommandNumber;
64 if (kIndex_IndexStyle == fIndexStyle) { 64 drawCommandNumber = index.data(Qt::UserRole + 1).toString();
65 drawCommandNumber = index.data(Qt::UserRole + 1).toString();
66 } else {
67 drawCommandNumber = index.data(Qt::UserRole + 5).toString();
68 }
69 float time = index.data(Qt::UserRole + 4).toFloat(); 65 float time = index.data(Qt::UserRole + 4).toFloat();
70 QString drawTime; 66 QString drawTime;
71 drawTime.setNum(time, 'f', 2); 67 drawTime.setNum(time, 'f', 2);
72 drawTime += "%"; 68 drawTime += "%";
73 69
74 /* option.rect is a struct that Qt uses as a target to draw into. Following 70 /* option.rect is a struct that Qt uses as a target to draw into. Following
75 * the format (x1,y1,x2,y2) x1 and y1 represent where the painter can start 71 * the format (x1,y1,x2,y2) x1 and y1 represent where the painter can start
76 * drawing. x2 and y2 represent where the drawing area has to terminate 72 * drawing. x2 and y2 represent where the drawing area has to terminate
77 * counting from the bottom right corner of each list item styled with this 73 * counting from the bottom right corner of each list item styled with this
78 * widget. A (x1,y1,0,0) rect would mean that the item being drawn would 74 * widget. A (x1,y1,0,0) rect would mean that the item being drawn would
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 r = option.rect.adjusted(kImageSpace+kCommandNumberSpace, 0, -10, -7); 108 r = option.rect.adjusted(kImageSpace+kCommandNumberSpace, 0, -10, -7);
113 painter->drawText(r.left(), r.top(), r.width(), r.height(), 109 painter->drawText(r.left(), r.top(), r.width(), r.height(),
114 Qt::AlignBottom|Qt::AlignLeft, drawTime, &r); 110 Qt::AlignBottom|Qt::AlignLeft, drawTime, &r);
115 } 111 }
116 } 112 }
117 113
118 QSize SkListWidget::sizeHint (const QStyleOptionViewItem& option, 114 QSize SkListWidget::sizeHint (const QStyleOptionViewItem& option,
119 const QModelIndex& index) const{ 115 const QModelIndex& index) const{
120 return QSize(200, 30); 116 return QSize(200, 30);
121 } 117 }
OLDNEW
« no previous file with comments | « debugger/QT/SkListWidget.h ('k') | src/utils/debugger/SkDebugCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698