Krita Source Code Documentation
Loading...
Searching...
No Matches
TableModel.cpp File Reference
#include "TableModel.h"
#include <QDateTime>
#include <QApplication>

Go to the source code of this file.

Functions

QRect getNewRect (const QStyleOptionViewItem &option)
 

Function Documentation

◆ getNewRect()

QRect getNewRect ( const QStyleOptionViewItem & option)

Definition at line 15 of file TableModel.cpp.

16{
17 // get the rectangle in the middle of the field
18 const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
19 QRect newRect = QStyle::alignedRect(option.direction, Qt::AlignCenter,
20 QSize(option.decorationSize.width() +
21 5,option.decorationSize.height()),
22 QRect(option.rect.x() + textMargin, option.rect.y(),
23 option.rect.width() -
24 (2 * textMargin), option.rect.height()));
25 return newRect;
26}