Commit 43193ea4 authored by hjk's avatar hjk

Debugger: Left-elide path names in breakpoint view

Task-number: QTCREATORBUG-11089
Change-Id: I97e11957c92c4127e3b3de73699ce16b8852c891
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 0b30cad8
......@@ -47,11 +47,25 @@
#include <QLineEdit>
#include <QMenu>
#include <QSpinBox>
#include <QStyledItemDelegate>
#include <QTextEdit>
namespace Debugger {
namespace Internal {
class LeftElideDelegate : public QStyledItemDelegate
{
public:
LeftElideDelegate(QObject *parent) : QStyledItemDelegate(parent) {}
void paint(QPainter *pain, const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
QStyleOptionViewItem opt = option;
opt.textElideMode = Qt::ElideLeft;
QStyledItemDelegate::paint(pain, opt, index);
}
};
class SmallTextEdit : public QTextEdit
{
public:
......@@ -681,6 +695,7 @@ BreakTreeView::BreakTreeView()
{
setWindowIcon(Icons::BREAKPOINTS.icon());
setSelectionMode(QAbstractItemView::ExtendedSelection);
setItemDelegateForColumn(2, new LeftElideDelegate(this));
connect(action(UseAddressInBreakpointsView), &QAction::toggled,
this, &BreakTreeView::showAddressColumn);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment