Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 55a282b326 | |||
| efebbd450f | |||
| b1be23c186 | |||
| f6adb5e773 | |||
| d2eac1cb69 | |||
| cb36403f64 |
@@ -0,0 +1,33 @@
|
||||
Qt lightScribe Installaton instructions
|
||||
=======================================
|
||||
|
||||
To compile and install, first download release from http://qlscribe.sourceforge.net/
|
||||
or check out project from subversion repository for particular release:
|
||||
|
||||
svn co https://qlscribe.svn.sourceforge.net/svnroot/qlscribe/tags/release-N.M qlscribe
|
||||
|
||||
or if you want to test latest development version:
|
||||
|
||||
svn co https://qlscribe.svn.sourceforge.net/svnroot/qlscribe/trunk qlscribe
|
||||
|
||||
Then go to the source directory and type:
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
|
||||
(If you want to install in a different path, use instead:
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=/install/path)
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
Once installed, you can start Qt lightScribe by typing "qlscribe", but due to API
|
||||
requirement if you want to burn qlscribe has to be started by root "sudo qlscribe"
|
||||
|
||||
You need to download lightScribe SDK for qlscribe to build and lightScribe runtime
|
||||
for qlscribe to run. For details see lightScribe webpage:
|
||||
|
||||
http://www.lightscribe.org/
|
||||
|
||||
Enjoy!
|
||||
@@ -1,6 +1,11 @@
|
||||
NEWS - list of user-visible changes between releases of qlscribe
|
||||
|
||||
New in 0.1:
|
||||
* First release of qlscribe
|
||||
* *
|
||||
New in 0.2:
|
||||
Print progress dialog shows elapsed/estimated time
|
||||
Bugfix for not loading angle in round text item
|
||||
Image items can be scaled now
|
||||
|
||||
New in 0.1:
|
||||
Open/save as implemented. Text, round text and image items can be inserted and edited
|
||||
Print preview and print is working (no exclusive lock or tray lock on printing yet)
|
||||
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
qlscribe
|
||||
********
|
||||
Qt lightScribe V 0.1 by Vyacheslav Kononenko <vyacheslav@kononenko.net>
|
||||
|
||||
Introduction
|
||||
============
|
||||
Qt lightScribe is Qt base application to burn CD/DVD labels on lightScribe capable
|
||||
drives and medias
|
||||
|
||||
This is the first alpha release. Program functionality is very limited at this stage.
|
||||
Please check the project page for more information, and to report new bugs.
|
||||
|
||||
http://qlscribe.sourceforge.net/
|
||||
|
||||
Application based on lightScribe(c) API: http://www.lightscribe.org
|
||||
and requires lightScribe API, available to download from:
|
||||
|
||||
http://www.lightscribe.org/downloadSection/linux/index.aspx
|
||||
|
||||
Thanks and regards,
|
||||
Vyacheslav
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
app.addLibraryPath( "/usr/lib32/qt4/plugins" );
|
||||
MainWindow mwindow;
|
||||
mwindow.show();
|
||||
|
||||
|
||||
+1
-1
@@ -268,7 +268,7 @@ void MainWindow::onMenuAbout()
|
||||
QMessageBox::about( this,
|
||||
tr( "About" ),
|
||||
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
|
||||
"<p>$Revision$</p>"
|
||||
"<p>release 0.2 $Revision$</p>"
|
||||
"<p>visit project at home page "
|
||||
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
|
||||
}
|
||||
|
||||
+46
-1
@@ -66,11 +66,20 @@ bool QDialogPixmap::exec( QGraphicsItem *graphicsItem )
|
||||
m_item->setOffset( item->offset() );
|
||||
m_item->setPixmap( item->pixmap() );
|
||||
m_item->setData( 0, item->data( 0 ) );
|
||||
m_item->setTransform( item->transform() );
|
||||
|
||||
scene.addItem( m_item );
|
||||
|
||||
m_ui->spinX->setValue( m_item->pos().x() );
|
||||
m_ui->spinY->setValue( m_item->pos().y() );
|
||||
m_ui->lineEdit->setText( m_item->data( 0 ).toString() );
|
||||
if( !m_item->pixmap().isNull() ) {
|
||||
QSize size = m_item->pixmap().size();
|
||||
QPointF scale = m_item->transform().map( QPointF( size.width(), size.height() ) );
|
||||
m_ui->spinWidth->setValue( scale.x() );
|
||||
m_ui->spinHeight->setValue( scale.y() );
|
||||
m_ui->lockedRatio->setChecked( scale.x() == scale.y() ? Qt::Checked : Qt::Unchecked );
|
||||
}
|
||||
|
||||
connect( m_ui->spinX, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(posChanged()) );
|
||||
@@ -78,12 +87,25 @@ bool QDialogPixmap::exec( QGraphicsItem *graphicsItem )
|
||||
connect( m_ui->spinY, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(posChanged()) );
|
||||
|
||||
connect( m_ui->spinWidth, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(sizeChanged()) );
|
||||
|
||||
connect( m_ui->spinHeight, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(sizeChanged()) );
|
||||
|
||||
connect( m_ui->btnSizeReset, SIGNAL(clicked()),
|
||||
this, SLOT(onResetSize()) );
|
||||
|
||||
connect( m_ui->lockedRatio, SIGNAL(stateChanged(int)),
|
||||
this, SLOT(sizeChanged()) );
|
||||
|
||||
if( QDialog::exec() == Rejected ) return false;
|
||||
|
||||
item->setPos( m_item->pos() );
|
||||
item->setOffset( m_item->offset() );
|
||||
item->setPixmap( m_item->pixmap() );
|
||||
item->setData( 0, m_item->data( 0 ) );
|
||||
item->setTransform( m_item->transform() );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -109,13 +131,36 @@ void QDialogPixmap::onLoadImage()
|
||||
}
|
||||
m_item->setPixmap( pixmap );
|
||||
m_item->setData( 0, fileName );
|
||||
m_item->setOffset( -QPointF( pixmap.size().height(), pixmap.size().width() ) / 2.0 );
|
||||
m_item->setOffset( -QPointF( pixmap.size().width(), pixmap.size().height() ) / 2.0 );
|
||||
|
||||
m_ui->lineEdit->setText( fileName );
|
||||
m_ui->buttonBox->setStandardButtons( m_ui->buttonBox->standardButtons() | QDialogButtonBox::Ok );
|
||||
onResetSize();
|
||||
}
|
||||
|
||||
void QDialogPixmap::posChanged()
|
||||
{
|
||||
m_item->setPos( m_ui->spinX->value(), m_ui->spinY->value() );
|
||||
}
|
||||
|
||||
void QDialogPixmap::onResetSize()
|
||||
{
|
||||
m_ui->spinWidth->setValue( m_item->pixmap().size().width() / 10.0 );
|
||||
m_ui->spinHeight->setValue( m_item->pixmap().size().height() / 10.0 );
|
||||
}
|
||||
|
||||
void QDialogPixmap::sizeChanged()
|
||||
{
|
||||
if( m_ui->lockedRatio->checkState() == Qt::Checked ) {
|
||||
QObject *senderObj = sender();
|
||||
QSize size = m_item->pixmap().size();
|
||||
if( senderObj == m_ui->spinWidth || senderObj == m_ui->lockedRatio ) {
|
||||
m_ui->spinHeight->setValue( m_ui->spinWidth->value() / size.width() * size.height() );
|
||||
} else {
|
||||
m_ui->spinWidth->setValue( m_ui->spinHeight->value() / size.height() * size.width() );
|
||||
}
|
||||
|
||||
}
|
||||
m_item->setTransform( QTransform().scale( m_ui->spinWidth->value() / m_item->pixmap().size().width(),
|
||||
m_ui->spinHeight->value() / m_item->pixmap().size().height() ) );
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ protected:
|
||||
private slots:
|
||||
void onLoadImage();
|
||||
void posChanged();
|
||||
void onResetSize();
|
||||
void sizeChanged();
|
||||
|
||||
private:
|
||||
Ui::QDialogPixmap *m_ui;
|
||||
|
||||
+88
-22
@@ -8,12 +8,12 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>542</width>
|
||||
<height>649</height>
|
||||
<width>464</width>
|
||||
<height>618</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Text properties</string>
|
||||
<string>Image properties</string>
|
||||
</property>
|
||||
<property name="modal" >
|
||||
<bool>false</bool>
|
||||
@@ -32,15 +32,9 @@
|
||||
<property name="lineWidth" >
|
||||
<number>3</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||
<property name="sizeConstraint" >
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout" >
|
||||
<item row="0" column="0" >
|
||||
@@ -86,33 +80,105 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3" >
|
||||
<property name="fieldGrowthPolicy" >
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label_5" >
|
||||
<widget class="QLabel" name="label_3" >
|
||||
<property name="text" >
|
||||
<string>Image:</string>
|
||||
<string>Width:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLineEdit" name="lineEdit" >
|
||||
<property name="readOnly" >
|
||||
<bool>true</bool>
|
||||
<widget class="QDoubleSpinBox" name="spinWidth" >
|
||||
<property name="minimum" >
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum" >
|
||||
<double>70.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="label_4" >
|
||||
<property name="text" >
|
||||
<string>Height:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="btnImage" >
|
||||
<property name="text" >
|
||||
<string>Load image...</string>
|
||||
<widget class="QDoubleSpinBox" name="spinHeight" >
|
||||
<property name="minimum" >
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum" >
|
||||
<double>70.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||
<item>
|
||||
<widget class="QCheckBox" name="lockedRatio" >
|
||||
<property name="text" >
|
||||
<string>Locked ratio</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSizeReset" >
|
||||
<property name="text" >
|
||||
<string>Reset size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3" >
|
||||
<property name="fieldGrowthPolicy" >
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label_5" >
|
||||
<property name="text" >
|
||||
<string>Image:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLineEdit" name="lineEdit" >
|
||||
<property name="readOnly" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="btnImage" >
|
||||
<property name="text" >
|
||||
<string>Load image...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/* qlscribe - Qt based application to print lightScribe discs
|
||||
|
||||
Copyright (C) 2009 Vyacheslav Kononenko <vyacheslav@kononenko.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
$Id$ */
|
||||
|
||||
#include "qdialogprint.h"
|
||||
#include "ui_qdialogprint.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/* qlscribe - Qt based application to print lightScribe discs
|
||||
|
||||
Copyright (C) 2009 Vyacheslav Kononenko <vyacheslav@kononenko.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
$Id$ */
|
||||
|
||||
#ifndef QDIALOGPRINT_H
|
||||
#define QDIALOGPRINT_H
|
||||
|
||||
|
||||
+45
-2
@@ -1,3 +1,23 @@
|
||||
/* qlscribe - Qt based application to print lightScribe discs
|
||||
|
||||
Copyright (C) 2009 Vyacheslav Kononenko <vyacheslav@kononenko.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
$Id$ */
|
||||
|
||||
#include "qdialogprogress.h"
|
||||
#include "ui_qdialogprogress.h"
|
||||
#include "qlightscribe.h"
|
||||
@@ -5,17 +25,26 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QAbstractButton>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
|
||||
QDialogProgress::QDialogProgress(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
m_ui(new Ui::QDialogProgress)
|
||||
m_ui(new Ui::QDialogProgress),
|
||||
m_start( new QTime ),
|
||||
m_timer( new QTimer( this ) )
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_start->start();
|
||||
connect( m_timer, SIGNAL(timeout()), this, SLOT(onTimeout()) );
|
||||
m_timer->start( 500 );
|
||||
}
|
||||
|
||||
QDialogProgress::~QDialogProgress()
|
||||
{
|
||||
delete m_ui;
|
||||
delete m_start;
|
||||
delete m_timer;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void QDialogProgress::changeEvent(QEvent *e)
|
||||
@@ -75,14 +104,28 @@ void QDialogProgress::onLabelProgress( long current, long final )
|
||||
{
|
||||
m_ui->progressPrinting->setMaximum( final );
|
||||
m_ui->progressPrinting->setValue( current );
|
||||
|
||||
if( current && double( current ) / final > 0.1 ) {
|
||||
int elapsed = m_start->elapsed();
|
||||
int estimate = double( elapsed ) / current * final;
|
||||
m_ui->timeEstimated->setTime( QTime().addMSecs( estimate ) );
|
||||
}
|
||||
}
|
||||
|
||||
void QDialogProgress::onTimeEstimate( long time )
|
||||
{
|
||||
m_ui->timeEstimated->setTime( QTime().addSecs( time ) );
|
||||
}
|
||||
|
||||
void QDialogProgress::onFinished(int status )
|
||||
{
|
||||
m_timer->stop();
|
||||
m_ui->progressPrinting->setValue( m_ui->progressPrinting->maximum() );
|
||||
m_ui->lineResult->setText( status ? tr( "Failed - error code: 0x" ) + QString::number( status, 16 ) : tr( "Success" ) );
|
||||
m_ui->buttonBox->setStandardButtons( QDialogButtonBox::Close );
|
||||
}
|
||||
|
||||
void QDialogProgress::onTimeout()
|
||||
{
|
||||
m_ui->timeElapsed->setTime( QTime().addMSecs( m_start->elapsed() ) );
|
||||
}
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/* qlscribe - Qt based application to print lightScribe discs
|
||||
|
||||
Copyright (C) 2009 Vyacheslav Kononenko <vyacheslav@kononenko.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
$Id$ */
|
||||
|
||||
#ifndef QDIALOGPROGRESS_H
|
||||
#define QDIALOGPROGRESS_H
|
||||
|
||||
@@ -9,6 +29,8 @@ namespace Ui {
|
||||
|
||||
class QCDScene;
|
||||
class QAbstractButton;
|
||||
class QTime;
|
||||
class QTimer;
|
||||
|
||||
class QDialogProgress : public QDialog {
|
||||
Q_OBJECT
|
||||
@@ -22,6 +44,7 @@ protected slots:
|
||||
void onLabelProgress( long current, long final );
|
||||
void onTimeEstimate( long time );
|
||||
void onFinished(int status );
|
||||
void onTimeout();
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *e);
|
||||
@@ -31,6 +54,8 @@ private:
|
||||
virtual ~QDialogProgress();
|
||||
|
||||
Ui::QDialogProgress *m_ui;
|
||||
QTime *m_start;
|
||||
QTimer *m_timer;
|
||||
};
|
||||
|
||||
#endif // QDIALOGPROGRESS_H
|
||||
|
||||
+10
-1
@@ -10,7 +10,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Dialog</string>
|
||||
<string>Print progress</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||
<item>
|
||||
@@ -85,6 +85,9 @@
|
||||
<property name="displayFormat" >
|
||||
<string>hh:mm:ss</string>
|
||||
</property>
|
||||
<property name="currentSectionIndex" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
@@ -172,6 +175,12 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
<tabstop>lineResult</tabstop>
|
||||
<tabstop>timeEstimated</tabstop>
|
||||
<tabstop>timeElapsed</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
$Id:$ */
|
||||
$Id$ */
|
||||
|
||||
#include "qgraphicsroundtextitem.h"
|
||||
#include "qdialogroundtext.h"
|
||||
@@ -287,6 +287,11 @@ void QShapeControllerRoundText::readData( const QString &element,
|
||||
return;
|
||||
}
|
||||
|
||||
if( element == "angle" ) {
|
||||
textItem->setAngle( data.toDouble() );
|
||||
return;
|
||||
}
|
||||
|
||||
if( element == "alignment" ) {
|
||||
textItem->setAlignment( Qt::Alignment( data.toInt() ) );
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
TEMPLATE = app
|
||||
LANGUAGE = C++
|
||||
CONFIG += qt
|
||||
INCLUDEPATH += ../build/src
|
||||
QMAKE_CXXFLAGS += -m32
|
||||
QMAKE_LFLAGS += -m32
|
||||
QMAKE_LIBDIR = /usr/lib32
|
||||
|
||||
@@ -105,7 +105,11 @@ QString QShapeControllerPixmap::menuName() const
|
||||
|
||||
QGraphicsItem *QShapeControllerPixmap::create() const
|
||||
{
|
||||
return new QGraphicsPixmapItem;
|
||||
QGraphicsPixmapItem *item = new QGraphicsPixmapItem;
|
||||
item->setShapeMode( QGraphicsPixmapItem::BoundingRectShape );
|
||||
item->setTransformationMode( Qt::SmoothTransformation );
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
QItemDialog *QShapeControllerPixmap::createDialog( QWidget *parent ) const
|
||||
@@ -121,10 +125,16 @@ void QShapeControllerPixmap::writeData( QXmlStreamWriter &writer, const QGraphic
|
||||
writer.writeEmptyElement( "pos" );
|
||||
writer.writeAttribute(
|
||||
QXmlStreamAttribute( "x", QString::number( pixmapItem->pos().x() ) ) );
|
||||
|
||||
writer.writeAttribute(
|
||||
QXmlStreamAttribute( "y", QString::number( pixmapItem->pos().y() ) ) );
|
||||
|
||||
QPointF scale = pixmapItem->transform().map( QPointF( 1.0, 1.0 ) );
|
||||
writer.writeEmptyElement( "scale" );
|
||||
writer.writeAttribute(
|
||||
QXmlStreamAttribute( "sx", QString::number( scale.x() ) ) );
|
||||
writer.writeAttribute(
|
||||
QXmlStreamAttribute( "sy", QString::number( scale.y() ) ) );
|
||||
|
||||
writer.writeTextElement( "image", pixmapItem->data( 0 ).toString() );
|
||||
}
|
||||
|
||||
@@ -142,6 +152,11 @@ void QShapeControllerPixmap::readData( const QString &element,
|
||||
return;
|
||||
}
|
||||
|
||||
if( element == "scale" ) {
|
||||
pixmapItem->setTransform( QTransform().scale( attrs.value( "sx" ).toString().toDouble(),
|
||||
attrs.value( "sy" ).toString().toDouble() ) );
|
||||
}
|
||||
|
||||
if( element == "image" ) {
|
||||
pixmapItem->setData( 0, data );
|
||||
QPixmap pixmap( data );
|
||||
|
||||
Reference in New Issue
Block a user