mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-05 03:39:58 +02:00
Add toolbar widget for edit size of handler in diagram editor.
Add a combo box in the tool bar of diagram editor to quickly change the size of the graphics handler item. The sarto commit :D NOTE only available for diagram editor, element editor will come later.
This commit is contained in:
@@ -766,6 +766,7 @@ void QetGraphicsTableItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
adjustHandlerPos();
|
||||
this->scene()->addItem(&m_handler_item);
|
||||
m_handler_item.setSize(QETUtils::graphicsHandlerSize(this));
|
||||
m_handler_item.installSceneEventFilter(this);
|
||||
}
|
||||
QGraphicsObject::hoverEnterEvent(event);
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "conductortextitem.h"
|
||||
#include "element.h"
|
||||
#include "../QetGraphicsItemModeler/qetgraphicshandleritem.h"
|
||||
#include "../utils/qetutils.h"
|
||||
|
||||
#include <QMultiHash>
|
||||
#include <QtDebug>
|
||||
@@ -860,7 +861,7 @@ void Conductor::addHandler()
|
||||
{
|
||||
if (m_handler_vector.isEmpty() && scene())
|
||||
{
|
||||
m_handler_vector = QetGraphicsHandlerItem::handlerForPoint(mapToScene(handlerPoints()));
|
||||
m_handler_vector = QetGraphicsHandlerItem::handlerForPoint(mapToScene(handlerPoints()), QETUtils::graphicsHandlerSize(this));
|
||||
|
||||
for(QetGraphicsHandlerItem *handler : m_handler_vector)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "../qeticons.h"
|
||||
#include "../qetxml.h"
|
||||
#include "../ui/shapegraphicsitempropertieswidget.h"
|
||||
#include "../utils/qetutils.h"
|
||||
|
||||
/**
|
||||
@brief QetShapeItem::QetShapeItem
|
||||
@@ -591,9 +592,9 @@ void QetShapeItem::addHandler()
|
||||
|
||||
if(!points_vector.isEmpty() && scene())
|
||||
{
|
||||
m_handler_vector = QetGraphicsHandlerItem::handlerForPoint(mapToScene(points_vector));
|
||||
m_handler_vector = QetGraphicsHandlerItem::handlerForPoint(mapToScene(points_vector), QETUtils::graphicsHandlerSize(this));
|
||||
|
||||
for(QetGraphicsHandlerItem *handler : m_handler_vector)
|
||||
for(const auto handler : qAsConst(m_handler_vector))
|
||||
{
|
||||
handler->setZValue(this->zValue()+1);
|
||||
handler->setColor(Qt::blue);
|
||||
|
||||
Reference in New Issue
Block a user