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);
|
||||
|
||||
@@ -105,6 +105,7 @@ private slots:
|
||||
void moveZDownAvailable(bool yes) {actions_Z_down.setEnabled(yes); actions_Z_bottom.setEnabled(yes);}
|
||||
|
||||
void buttonImage_clicked();
|
||||
void buttonImagePaste_clicked();
|
||||
void buttonFont_clicked();
|
||||
void buttonTextEdit_clicked();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedProperties">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pageText">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
@@ -596,6 +596,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonImagePaste">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Paste image ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="qad_blockview.qrc">
|
||||
<normaloff>:/icons/view-preview.png</normaloff>:/icons/view-preview.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
@@ -680,10 +697,10 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorButton" name="colorButtonPen">
|
||||
<property name="useNativeDialog" stdset="0">
|
||||
<property name="useNativeDialog">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="useAlphaChannel" stdset="0">
|
||||
<property name="useAlphaChannel">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -716,10 +733,10 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorButton" name="colorButtonBrush">
|
||||
<property name="useNativeDialog" stdset="0">
|
||||
<property name="useNativeDialog">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="useAlphaChannel" stdset="0">
|
||||
<property name="useAlphaChannel">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user