mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01: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:
@@ -24,11 +24,16 @@
|
||||
@brief QetGraphicsHandlerItem::QetGraphicsHandlerItem
|
||||
@param size : the size of the handler
|
||||
*/
|
||||
QetGraphicsHandlerItem::QetGraphicsHandlerItem(qreal size) :
|
||||
m_size(size)
|
||||
QetGraphicsHandlerItem::QetGraphicsHandlerItem(qreal size)
|
||||
{
|
||||
setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
||||
|
||||
setSize(size);
|
||||
}
|
||||
|
||||
void QetGraphicsHandlerItem::setSize(qreal size)
|
||||
{
|
||||
prepareGeometryChange();
|
||||
m_size = size;
|
||||
m_handler_rect.setRect(0-m_size/2, 0-m_size/2, m_size, m_size);
|
||||
m_br.setRect(-1-m_size/2, -1-m_size/2, m_size+2, m_size+2);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ class QetGraphicsHandlerItem : public QGraphicsItem
|
||||
{
|
||||
public:
|
||||
QetGraphicsHandlerItem(qreal size = 10);
|
||||
void setSize(qreal size);
|
||||
QRectF boundingRect() const override;
|
||||
|
||||
enum { Type = UserType + 1200};
|
||||
|
||||
Reference in New Issue
Block a user