+ QSize size = text.size().toSize();
+
+ // Adjust for thumbnail
+ if (event->type() == ApiTraceEvent::Frame) {
+ ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
+ const QImage & thumbnail = frame->thumbnail();
+ if (!thumbnail.isNull()) {
+ size.rwidth() += thumbnail.width();
+ if (size.height() < thumbnail.height()) {
+ size.setHeight(thumbnail.height());
+ }
+ }
+ }
+
+ return size;