code brush

This commit is contained in:
Бычков Андрей
2022-07-01 17:30:34 +03:00
parent 2fb937a090
commit 883612e835
15 changed files with 49 additions and 260 deletions

View File

@@ -26,7 +26,6 @@ _DTSizeItem::_DTSizeItem(): QGraphicsObject() {
rects[i].setRect(-5, -5, 10, 10);
rects[i].setPen(QPen(Qt::darkBlue));
rects[i].setBrush(QBrush(QColor(64, 64, 255, 128)));
//rects[i].setData(bvidBlockDecor, true);
}
}
@@ -110,10 +109,10 @@ void _DTSizeItem::doubleClick() {
AlignedTextItem * iatext = qgraphicsitem_cast<AlignedTextItem*>(cur_item);
QGraphicsPixmapItem * ipixmap = qgraphicsitem_cast<QGraphicsPixmapItem*>(cur_item);
if (itext || iatext) {
QMetaObject::invokeMethod(this, "textEditRequest", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, [this](){textEditRequest();}, Qt::QueuedConnection);
}
if (ipixmap) {
QMetaObject::invokeMethod(this, "pixmapEditRequest", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, [this](){pixmapEditRequest();}, Qt::QueuedConnection);
}
}
@@ -323,8 +322,6 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
DrawTools::~DrawTools() {
size_item.assignObject(0);
//delete ui;
//delete widget_props;
}
@@ -381,7 +378,6 @@ bool DrawTools::eventFilter(QObject * o, QEvent * e) {
foreach (QAction * a, actions_add)
a->setChecked(false);
new_type = -1;
//view_->setCursor(Qt::ArrowCursor);
return true;
}
}
@@ -420,7 +416,6 @@ bool DrawTools::eventFilter(QObject * o, QEvent * e) {
if (me->buttons().testFlag(Qt::LeftButton)) {
if (new_item) {
mr = new_item->mapRectFromScene(QRectF(pp, sp).normalized());
//mr = QRectF(pp, sp).normalized();
switch (new_type) {
case 0:
((AlignedTextItem*)new_item)->setPos(sp);
@@ -458,7 +453,6 @@ bool DrawTools::eventFilter(QObject * o, QEvent * e) {
foreach (QAction * a, actions_add)
a->setChecked(false);
new_type = -1;
//view_->setCursor(Qt::ArrowCursor);
}
return true;
}
@@ -485,15 +479,6 @@ QComboBox * DrawTools::textEditCombo() const {
return ui->comboText;
}
/*
void DrawTools::changeEvent(QEvent * e) {
if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
return;
}
QObject::changeEvent(e);
}
*/
QAction * DrawTools::newAction(const QIcon & icon, int type) {
QAction * ret = new QAction(icon, QString(), this);