git-svn-id: svn://db.shs.com.ru/libs@411 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -68,6 +68,7 @@ void BlockView::_init() {
|
|||||||
nav_anim.setPropertyName("_nav");
|
nav_anim.setPropertyName("_nav");
|
||||||
nav_anim.setEasingCurve(QEasingCurve::InQuad);
|
nav_anim.setEasingCurve(QEasingCurve::InQuad);
|
||||||
nav_anim.setDuration(200);
|
nav_anim.setDuration(200);
|
||||||
|
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(checkPaste()));
|
||||||
connect(&nav_anim, SIGNAL(finished()), this, SLOT(_navFinished()));
|
connect(&nav_anim, SIGNAL(finished()), this, SLOT(_navFinished()));
|
||||||
connect(scene_, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(adjustThumb()));
|
connect(scene_, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(adjustThumb()));
|
||||||
connect(scene_, SIGNAL(selectionChanged()), this, SLOT(sceneSelectionChanged()));
|
connect(scene_, SIGNAL(selectionChanged()), this, SLOT(sceneSelectionChanged()));
|
||||||
@@ -87,6 +88,7 @@ void BlockView::_init() {
|
|||||||
sel_rect.setPen(pen);
|
sel_rect.setPen(pen);
|
||||||
sc.setAlphaF(0.2);
|
sc.setAlphaF(0.2);
|
||||||
sel_rect.setBrush(QBrush(sc));
|
sel_rect.setBrush(QBrush(sc));
|
||||||
|
checkPaste(true);
|
||||||
|
|
||||||
/*AlignedTextItem * ti = new AlignedTextItem("This is text!");
|
/*AlignedTextItem * ti = new AlignedTextItem("This is text!");
|
||||||
ti->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
ti->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
@@ -1655,6 +1657,16 @@ void BlockView::pinHoverInOut(BlockItemPin * pin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BlockView::checkPaste(bool queued) {
|
||||||
|
const QMimeData * mime = QApplication::clipboard()->mimeData();
|
||||||
|
bool ret = false;
|
||||||
|
if (mime)
|
||||||
|
ret = mime->hasFormat(_BlockView_Mime_);
|
||||||
|
if (queued) QMetaObject::invokeMethod(this, "pasteEnabledChanged", Qt::QueuedConnection, Q_ARG(bool, ret));
|
||||||
|
else emit pasteEnabledChanged(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void BlockView::newBranchTrace(BlockBusItem * item, QPointF to) {
|
void BlockView::newBranchTrace(BlockBusItem * item, QPointF to) {
|
||||||
trace(item->press_pos, to, &tmp_bus);
|
trace(item->press_pos, to, &tmp_bus);
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ protected slots:
|
|||||||
void startBusPointMove(int bus_type);
|
void startBusPointMove(int bus_type);
|
||||||
void endBusPointMove();
|
void endBusPointMove();
|
||||||
void pinHoverInOut(BlockItemPin * pin);
|
void pinHoverInOut(BlockItemPin * pin);
|
||||||
|
void checkPaste(bool queued = false);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setGridPen(const QPen & pen) {grid_pen = pen; _updateBack();}
|
void setGridPen(const QPen & pen) {grid_pen = pen; _updateBack();}
|
||||||
@@ -244,6 +245,7 @@ signals:
|
|||||||
void blockRemoved(BlockItem * item);
|
void blockRemoved(BlockItem * item);
|
||||||
void connectionsChanged();
|
void connectionsChanged();
|
||||||
void copyEnabledChanged(bool);
|
void copyEnabledChanged(bool);
|
||||||
|
void pasteEnabledChanged(bool);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user