1
0
Fork 0

GUI: Implemented custom callstack view paint function #2341

This commit is contained in:
morsisko 2020-10-23 16:05:23 +02:00
parent b48b068976
commit d39b8211de
2 changed files with 19 additions and 0 deletions

View File

@ -58,6 +58,22 @@ void CallStackView::setupContextMenu()
mMenuBuilder->loadFromConfig();
}
QString CallStackView::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
{
if(isSelected(rowBase, rowOffset))
painter->fillRect(QRect(x, y, w, h), QBrush(mSelectionColor));
bool isSpaceRow = !getCellContent(rowBase + rowOffset, ColThread).isEmpty();
if(col > ColThread && isSpaceRow)
{
auto mid = h / 2.0;
painter->drawLine(QPointF(x, y + mid), QPointF(x + w, y + mid));
}
return getCellContent(rowBase + rowOffset, col);
}
void CallStackView::updateCallStack()
{
if(!DbgFunctions()->GetCallStackByThread)

View File

@ -10,6 +10,9 @@ public:
explicit CallStackView(StdTable* parent = 0);
void setupContextMenu();
protected:
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h) override;
protected slots:
void updateCallStack();
void contextMenuSlot(const QPoint pos);