Commit f6d04cce authored by Nikita Sirgienko's avatar Nikita Sirgienko
Browse files

Add border for ImageResult, for better UX

parent e1593152
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
WorksheetImageItem::WorksheetImageItem(QGraphicsObject* parent) WorksheetImageItem::WorksheetImageItem(QGraphicsObject* parent)
: QGraphicsObject(parent) : QGraphicsObject(parent)
{ {
setFlag(QGraphicsItem::ItemIsFocusable, true);
connect(this, SIGNAL(menuCreated(QMenu*,QPointF)), parent, connect(this, SIGNAL(menuCreated(QMenu*,QPointF)), parent,
SLOT(populateMenu(QMenu*,QPointF)), Qt::DirectConnection); SLOT(populateMenu(QMenu*,QPointF)), Qt::DirectConnection);
} }
...@@ -106,6 +107,11 @@ void WorksheetImageItem::paint(QPainter *painter, ...@@ -106,6 +107,11 @@ void WorksheetImageItem::paint(QPainter *painter,
Q_UNUSED(widget); Q_UNUSED(widget);
painter->drawPixmap(QRectF(QPointF(0,0), m_size), m_pixmap, painter->drawPixmap(QRectF(QPointF(0,0), m_size), m_pixmap,
m_pixmap.rect()); m_pixmap.rect());
if (hasFocus())
{
painter->setPen(Qt::DashLine);
painter->drawRect(0, 0, width(), height());
}
} }
void WorksheetImageItem::setEps(const QUrl& url) void WorksheetImageItem::setEps(const QUrl& url)
......
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