git-svn-id: svn://db.shs.com.ru/libs@460 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -287,6 +287,7 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
|
||||
foreach (QToolButton * b, buttons_align)
|
||||
connect(b, SIGNAL(clicked(bool)), this, SLOT(alignClicked()));
|
||||
connect(ui->buttonImage, SIGNAL(clicked(bool)), this, SLOT(buttonImage_clicked()));
|
||||
connect(ui->buttonImagePaste, SIGNAL(clicked(bool)), this, SLOT(buttonImagePaste_clicked()));
|
||||
connect(ui->buttonFont, SIGNAL(clicked(bool)), this, SLOT(buttonFont_clicked()));
|
||||
connect(ui->buttonTextEdit, SIGNAL(clicked(bool)), this, SLOT(buttonTextEdit_clicked()));
|
||||
connect(ui->spinWidth, SIGNAL(valueChanged(double)), this, SLOT(propertyChanged()));
|
||||
@@ -800,6 +801,20 @@ void DrawTools::buttonImage_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void DrawTools::buttonImagePaste_clicked() {
|
||||
QGraphicsPixmapItem * pi = qgraphicsitem_cast<QGraphicsPixmapItem * >(cur_item);
|
||||
if (!pi) return;
|
||||
QPixmap pm = QApplication::clipboard()->pixmap();
|
||||
if (pm.isNull()) return;
|
||||
QRectF obr = pi->boundingRect();
|
||||
pi->setPixmap(pm);
|
||||
QRectF nbr = pi->boundingRect();
|
||||
QSizeF ds = (obr.size() - nbr.size()) / 2.;
|
||||
pi->setPos(pi->pos() + QPointF(ds.width(), ds.height()));
|
||||
changeFinished();
|
||||
}
|
||||
|
||||
|
||||
void DrawTools::buttonFont_clicked() {
|
||||
if (!cur_item) return;
|
||||
QGraphicsSimpleTextItem * ti = qgraphicsitem_cast<QGraphicsSimpleTextItem * >(cur_item);
|
||||
|
||||
Reference in New Issue
Block a user