342{
343 Q_UNUSED ( widget )
344 Q_UNUSED ( option )
345
346 double SpaceX = 3;
347 double SpaceY = 3;
348
349
350 QColor colour;
351 QColor background;
355 }
361 }
362 else {
365 }
366
368
369 const QPen bounding_box_pen = QPen(colour, 2.5);
370 const QPen inner_line_pen = QPen(colour, 1.5);
371
372 painter->setFont (
m_font );
373 painter->setPen ( bounding_box_pen );
374 painter->setBackground(background);
375
377
378 const QFontMetrics FontMetrics = painter->fontMetrics();
381
382 double HeightOffset = ClassNameBoundingRect.height() + SpaceY;
383 const auto ClassNamePosition = QPointF(
384 (ObjectBoundingRect.width() - ClassNameBoundingRect.width() ) / 2,
385 ClassNameBoundingRect.height());
387 painter->drawLine ( 0, HeightOffset, ObjectBoundingRect.width(), HeightOffset );
388
390 {
394 }
395 const QRectF AttributeBoundingRect = FontMetrics.boundingRect (attribute_name);
396 HeightOffset += AttributeBoundingRect.height();
397 painter->drawText ( QPointF(SpaceX, HeightOffset), attribute_name );
398 }
399
403 {
404 const QRectF AttributeBoundingRect = FontMetrics.boundingRect ( AttributeName );
405 HeightOffset += AttributeBoundingRect.height();
406 painter->drawText ( QPointF(SpaceX, HeightOffset), AttributeName );
407 }
408 painter->setPen ( colour );
409 }
410
411 HeightOffset += SpaceY;
412 painter->setPen ( inner_line_pen );
413 painter->drawLine ( 0, HeightOffset, ObjectBoundingRect.width(), HeightOffset );
414
416 {
417 const QRectF relationship_bounding_rect = FontMetrics.boundingRect ( relationship_name );
418 HeightOffset += relationship_bounding_rect.height();
419 painter->drawText ( QPointF(SpaceX, HeightOffset), relationship_name );
420 }
421
425 {
426 const QRectF relationship_bounding_rect = FontMetrics.boundingRect ( relationship_name );
427 HeightOffset += relationship_bounding_rect.height();
428 painter->drawText ( QPointF(SpaceX, HeightOffset), relationship_name );
429 }
430 painter->setPen ( colour );
431 }
432
433
434 HeightOffset += SpaceY;
435 painter->setPen ( inner_line_pen );
436 painter->drawLine ( 0, HeightOffset, ObjectBoundingRect.width(), HeightOffset );
437
439 {
440 const QRectF AttributeBoundingRect = FontMetrics.boundingRect ( MethodName );
441 HeightOffset += AttributeBoundingRect.height();
442 painter->drawText ( QPointF(SpaceX, HeightOffset), MethodName );
443 }
444
448 {
449 const QRectF AttributeBoundingRect = FontMetrics.boundingRect ( MethodName );
450 HeightOffset += AttributeBoundingRect.height();
451 painter->drawText (QPointF(SpaceX, HeightOffset), MethodName );
452 }
453 painter->setPen ( colour );
454 }
455}
std::string GetActiveSchema() const
QRectF boundingRect() const override
bool highlight_active() const
OksFile * get_file() const noexcept
const std::string & get_full_file_name() const
static QColor get_color(const QString &item, const QString &group)