Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1139318732 | |||
| 7a0d3262ac |
@@ -1 +0,0 @@
|
||||
/build/
|
||||
+5
-10
@@ -18,14 +18,9 @@
|
||||
#
|
||||
# $Id$
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.21)
|
||||
PROJECT(qlscribe VERSION 0.20 LANGUAGES CXX)
|
||||
PROJECT( qlscribe )
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
SET(CMAKE_AUTOUIC ON)
|
||||
SET(CMAKE_AUTORCC ON)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
|
||||
|
||||
SET( FINAL_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Final install path")
|
||||
SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
|
||||
@@ -37,6 +32,6 @@ SET( QLSCRIBE_DBUS_PATH /org/lightscribe )
|
||||
SET( QLSCRIBE_DBUS_MANAGER_PATH ${QLSCRIBE_DBUS_PATH}/printManager ) # path to manager
|
||||
SET( QLSCRIBE_DBUS_DRIVES_PATH ${QLSCRIBE_DBUS_PATH}/drives ) # base path under which drives located
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(resources)
|
||||
ADD_SUBDIRECTORY(lscribed)
|
||||
SUBDIRS( src )
|
||||
SUBDIRS( resources )
|
||||
SUBDIRS( lscribed )
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
NEWS - list of user-visible changes between releases of qlscribe
|
||||
|
||||
New in 0.19
|
||||
-----------
|
||||
* Fixed desktop-entry conformance and packaging cache integration.
|
||||
|
||||
New in 0.18
|
||||
-----------
|
||||
* Fixed the mandatory 32-bit printing daemon build with GCC 15.
|
||||
* Fixed 32-bit D-Bus library detection on multilib Gentoo systems.
|
||||
|
||||
New in 0.17
|
||||
-----------
|
||||
* Ported the application and build system from Qt 4 to Qt 6.
|
||||
* Modernized the CMake build while retaining the required LightScribe daemon.
|
||||
|
||||
New in 0.16
|
||||
Fixed build on 64 bit Ubuntu Saucy
|
||||
Fixed bug with alarm() not found
|
||||
@@ -100,3 +86,4 @@ New in 0.2:
|
||||
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)
|
||||
|
||||
|
||||
+3
-10
@@ -22,16 +22,9 @@ FIND_PATH( DBUS_INCLUDE_DIR dbus/dbus.h
|
||||
PATH_SUFFIXES dbus-1.0 )
|
||||
|
||||
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
|
||||
# Gentoo's 32-bit ABI lives in /usr/lib. find_library() rewrites
|
||||
# that path to lib64 for a 64-bit CMake process, so select the
|
||||
# existing multilib file explicitly.
|
||||
IF(EXISTS "/usr/lib/libdbus-1.so")
|
||||
SET(DBUS_LIBRARY "/usr/lib/libdbus-1.so" CACHE FILEPATH
|
||||
"32-bit D-Bus library" FORCE)
|
||||
ELSEIF(EXISTS "/usr/lib32/libdbus-1.so")
|
||||
SET(DBUS_LIBRARY "/usr/lib32/libdbus-1.so" CACHE FILEPATH
|
||||
"32-bit D-Bus library" FORCE)
|
||||
ENDIF()
|
||||
FIND_LIBRARY( DBUS_LIBRARY dbus-1
|
||||
PATHS /lib32 /usr/lib32 /usr/local/lib32
|
||||
NO_DEFAULT_PATH )
|
||||
ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
|
||||
|
||||
FIND_LIBRARY( DBUS_LIBRARY dbus-1 )
|
||||
|
||||
@@ -60,8 +60,8 @@ ADD_DEFINITIONS( -Wall )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
|
||||
ADD_EXECUTABLE( lscribed ${LSCRIBED_SRCS} )
|
||||
SET_TARGET_PROPERTIES(lscribed PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC OFF)
|
||||
|
||||
TARGET_LINK_LIBRARIES( lscribed ${LSCRIBE_LIBRARIES} ${DBUS_LIBRARIES} pthread )
|
||||
|
||||
INSTALL( TARGETS lscribed DESTINATION sbin )
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include "dbuscpp.h"
|
||||
#include "lscribed.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
using namespace DBusCpp;
|
||||
|
||||
MessageHandler::~MessageHandler()
|
||||
@@ -218,3 +216,4 @@ const char *Message::member() const
|
||||
{
|
||||
return dbus_message_get_member( m_message );
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Encoding=UTF-8
|
||||
Name=Qt lightScribe
|
||||
Exec=qlscribe
|
||||
Icon=qlscribe
|
||||
Icon=qlscribe.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
MimeType=application/x-qlscribe;
|
||||
|
||||
+38
-6
@@ -18,7 +18,8 @@
|
||||
#
|
||||
# $Id$
|
||||
|
||||
FIND_PACKAGE(Qt6 6.5 REQUIRED COMPONENTS Core Gui Widgets DBus)
|
||||
FIND_PACKAGE( Qt4 REQUIRED )
|
||||
SET( QT_USE_QTDBUS 1 )
|
||||
|
||||
SET( QLSCRIBE_SRCS main.cpp mainwindow.cpp qcdscene.cpp qcdview.cpp
|
||||
qdialogpixmap.cpp qdialogroundtext.cpp qdialogtext.cpp qlightroundtextitem.cpp
|
||||
@@ -29,19 +30,50 @@ SET( QLSCRIBE_SRCS main.cpp mainwindow.cpp qcdscene.cpp qcdview.cpp
|
||||
SET( QLSCRIBE_UIS qdialogtext.ui qdialogroundtext.ui qdialogpixmap.ui
|
||||
qdialogprint.ui qdialogprogress.ui qdialogcdproperties.ui qdialogsettings.ui )
|
||||
|
||||
SET( QLSCRIBE_MOC_HDRS mainwindow.h qcdscene.h qdialogpixmap.h qdialogroundtext.h
|
||||
qdialogtext.h qlightscribe.h qdialogprint.h qdialogprogress.h
|
||||
qdialogcdproperties.h qconsoleprintprogress.h qdialogsettings.h previewinjector.h )
|
||||
|
||||
ADD_DEFINITIONS( -Wall )
|
||||
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/qlscribe.h.in ${CMAKE_CURRENT_BINARY_DIR}/qlscribe.h @ONLY )
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(lightscribe.xml PROPERTIES INCLUDE qlightscribe.h)
|
||||
QT6_ADD_DBUS_INTERFACE(QLSCRIBE_DBUS_SRCS lightscribe.xml lightscribe_interface)
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
|
||||
QT4_WRAP_UI( QLSCRIBE_UI_HDRS ${QLSCRIBE_UIS} )
|
||||
|
||||
QT4_WRAP_CPP( QLSCRIBE_MOC_SRCS ${QLSCRIBE_MOC_HDRS} )
|
||||
|
||||
QT4_ADD_RESOURCES( QLSCRIBE_RCC_SRCS ../resources/qlscribe.qrc )
|
||||
|
||||
MACRO(ADD_DBUS_INTERFACE _sources _interface _basename)
|
||||
GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE)
|
||||
SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
|
||||
SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
|
||||
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
|
||||
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -i qlightscribe.h -p ${_basename} ${_infile}
|
||||
DEPENDS ${_infile})
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
|
||||
|
||||
QT4_GENERATE_MOC(${_header} ${_moc})
|
||||
|
||||
SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
|
||||
MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
|
||||
ENDMACRO(ADD_DBUS_INTERFACE)
|
||||
|
||||
ADD_DBUS_INTERFACE( QLSCRIBE_DBUS_SRCS lightscribe.xml lightscribe_interface )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
|
||||
ADD_EXECUTABLE(qlscribe ${QLSCRIBE_SRCS} ${QLSCRIBE_UIS}
|
||||
${QLSCRIBE_DBUS_SRCS} ../resources/qlscribe.qrc)
|
||||
ADD_EXECUTABLE( qlscribe ${QLSCRIBE_SRCS} ${QLSCRIBE_MOC_SRCS}
|
||||
${QLSCRIBE_RCC_SRCS} ${QLSCRIBE_UI_HDRS}
|
||||
${QLSCRIBE_DBUS_SRCS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES(qlscribe PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::DBus)
|
||||
TARGET_LINK_LIBRARIES( qlscribe ${QT_LIBRARIES} )
|
||||
|
||||
INSTALL( TARGETS qlscribe
|
||||
DESTINATION bin )
|
||||
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@
|
||||
<node>
|
||||
<interface name="org.lightscribe.printManager">
|
||||
<method name="getDrives">
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QObject2StringMap"/>
|
||||
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QObject2StringMap"/>
|
||||
<arg type="a{ss}" direction="out"/>
|
||||
</method>
|
||||
</interface>
|
||||
@@ -44,15 +44,15 @@
|
||||
<arg name="status" type="i" direction="out"/>
|
||||
</signal>
|
||||
<method name="preview">
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QSize"/>
|
||||
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<annotation name="com.trolltech.QtDBus.QtTypeName.In2" value="QSize"/>
|
||||
<arg type="s" direction="out"/>
|
||||
<arg name="params" type="(iiiii)" direction="in"/>
|
||||
<arg name="image" type="ay" direction="in"/>
|
||||
<arg name="previewSize" type="(ii)" direction="in"/>
|
||||
</method>
|
||||
<method name="print">
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<arg name="params" type="(iiiii)" direction="in"/>
|
||||
<arg name="image" type="ay" direction="in"/>
|
||||
</method>
|
||||
|
||||
+4
-3
@@ -34,7 +34,7 @@
|
||||
|
||||
std::ostream &operator<<( std::ostream &os, const QString &str )
|
||||
{
|
||||
return os << str.toUtf8().constData();
|
||||
return os << str.toAscii().data();
|
||||
}
|
||||
|
||||
void usage()
|
||||
@@ -57,8 +57,9 @@ int main( int argc, char **argv )
|
||||
{
|
||||
QApplication app( argc, argv );
|
||||
app.setApplicationName( "qlscribe" );
|
||||
app.setOrganizationName( "disconnected-by-peer.at" );
|
||||
app.setOrganizationDomain( "disconnected-by-peer.at" );
|
||||
//app.setOrganizationName( "" );
|
||||
app.setOrganizationDomain( "qlscribe.sourceforge.org" );
|
||||
app.addLibraryPath( "/usr/lib32/qt4/plugins" );
|
||||
app.setWindowIcon( QIcon( ":/qlscribe64.png" ) );
|
||||
|
||||
bool doPrint = false;
|
||||
|
||||
+5
-9
@@ -41,7 +41,6 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QSettings>
|
||||
#include <QImageReader>
|
||||
#include <QPicture>
|
||||
@@ -76,8 +75,7 @@ MainWindow::MainWindow( bool enablePrint )
|
||||
SLOT(map()) );
|
||||
m_newLabelMapper->setMapping( action, modeTitle );
|
||||
}
|
||||
connect(m_newLabelMapper, &QSignalMapper::mappedInt,
|
||||
this, &MainWindow::onMenuNewLabel);
|
||||
connect( m_newLabelMapper, SIGNAL(mapped(int)), this, SLOT(onMenuNewLabel(int)) );
|
||||
|
||||
m_menuFile->addAction( tr( "Open...", "Menu item \"Open\"" ),
|
||||
this,
|
||||
@@ -171,8 +169,7 @@ MainWindow::MainWindow( bool enablePrint )
|
||||
m_insertMapper->setMapping( action, i->first );
|
||||
connect( action, SIGNAL(triggered()), m_insertMapper, SLOT(map()) );
|
||||
}
|
||||
connect(m_insertMapper, &QSignalMapper::mappedInt,
|
||||
this, &MainWindow::onMenuInsert);
|
||||
connect( m_insertMapper, SIGNAL(mapped(int)), this, SLOT(onMenuInsert(int)) );
|
||||
|
||||
connect( QApplication::clipboard(), SIGNAL(changed(QClipboard::Mode)),
|
||||
this, SLOT(updateMenu()) );
|
||||
@@ -547,11 +544,10 @@ void MainWindow::onMenuAbout()
|
||||
{
|
||||
QMessageBox::about( this,
|
||||
tr( "About" ),
|
||||
tr( "<h3>qlscribe - Qt LightScribe</h3>"
|
||||
"<p>release 0.20</p>"
|
||||
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
|
||||
"<p>release 0.16 $Revision$</p>"
|
||||
"<p>visit project at home page "
|
||||
"<a href=\"https://gitea.disconnected-by-peer.at/geos_one/qlscribe\">"
|
||||
"gitea.disconnected-by-peer.at/geos_one/qlscribe</a></p>" ) );
|
||||
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
|
||||
}
|
||||
|
||||
void MainWindow::onMenuQtAbout()
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QtGui/QMainWindow>
|
||||
|
||||
class QMdiArea;
|
||||
class QSignalMapper;
|
||||
|
||||
@@ -12,7 +12,7 @@ PreviewInjector::PreviewInjector( QFileDialog * dl ) :
|
||||
if( !dl )
|
||||
return;
|
||||
|
||||
QSplitter *sp = dl->findChild<QSplitter *>("splitter");
|
||||
QSplitter *sp = qFindChild<QSplitter *>( dl, "splitter" );
|
||||
if( !sp )
|
||||
return;
|
||||
|
||||
@@ -58,3 +58,4 @@ void PreviewInjector::onSelectionChanged(QString file)
|
||||
}
|
||||
m_label->setPixmap( QPixmap::fromImage( img ) );
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -31,10 +31,11 @@
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QMessageBox>
|
||||
#include <QGraphicsView>
|
||||
#include <QRegExp>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QFileInfo>
|
||||
#include <QRegExp>
|
||||
|
||||
QCDScene::QCDScene( QObject * parent )
|
||||
: QGraphicsScene( parent ),
|
||||
@@ -82,7 +83,7 @@ void QCDScene::start( LabelMode mode )
|
||||
|
||||
bool QCDScene::load( const QString &fileName, QString *errMessage )
|
||||
{
|
||||
if (fileName.endsWith(".qlx", Qt::CaseInsensitive)) {
|
||||
if( QRegExp( ".*.\\.qlx$", Qt::CaseInsensitive ).exactMatch( fileName ) ) {
|
||||
QFile file( fileName );
|
||||
if( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
if( errMessage )
|
||||
@@ -187,7 +188,9 @@ void QCDScene::setName()
|
||||
}
|
||||
m_name = "Unnamed_" + QString::number( m_index );
|
||||
} else {
|
||||
m_name = QFileInfo(m_fileName).completeBaseName();
|
||||
QRegExp rx( "(.*/)?(.*)\\.qlx" );
|
||||
rx.indexIn( m_fileName );
|
||||
m_name = rx.cap( 2 );
|
||||
}
|
||||
|
||||
updateTitles();
|
||||
@@ -402,7 +405,7 @@ void QCDScene::getItemFromClipboard()
|
||||
|
||||
void QCDScene::contextMenuEvent( QGraphicsSceneContextMenuEvent *mouseEvent )
|
||||
{
|
||||
QGraphicsItem *item = itemAt(mouseEvent->scenePos(), QTransform());
|
||||
QGraphicsItem *item = itemAt( mouseEvent->scenePos() );
|
||||
if( !item )
|
||||
return;
|
||||
item->setSelected( true );
|
||||
@@ -517,3 +520,4 @@ void QCDScene::unredo( bool undo )
|
||||
}
|
||||
setChanged( false );
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -160,9 +160,7 @@ void QCDView::drawForeground ( QPainter * painter, const QRectF & rect )
|
||||
QPainter paint( &alpha );
|
||||
paint.setWorldTransform( painter->transform() );
|
||||
drawCD( &paint, rectf, true );
|
||||
QImage maskImage = m_mask->toImage().convertToFormat(QImage::Format_ARGB32);
|
||||
maskImage.setAlphaChannel(alpha.toImage());
|
||||
*m_mask = QPixmap::fromImage(maskImage);
|
||||
m_mask->setAlphaChannel( alpha );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef QDIALOGCDPROPERTIES_H
|
||||
#define QDIALOGCDPROPERTIES_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QDialogCDProperties;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#ifndef QDIALOGPRINT_H
|
||||
#define QDIALOGPRINT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
#include "qlightscribe.h"
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <QMessageBox>
|
||||
#include <QAbstractButton>
|
||||
#include <QTime>
|
||||
#include <QElapsedTimer>
|
||||
#include <QTimer>
|
||||
#include <QSettings>
|
||||
|
||||
@@ -35,7 +34,7 @@ QDialogProgress::QDialogProgress( QWidget *parent, QLightDrive *drive )
|
||||
: QDialog(parent),
|
||||
m_ui(new Ui::QDialogProgress),
|
||||
m_drive( drive ),
|
||||
m_start(new QElapsedTimer),
|
||||
m_start( new QTime ),
|
||||
m_timer( new QTimer( this ) )
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef QDIALOGPROGRESS_H
|
||||
#define QDIALOGPROGRESS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QDialogProgress;
|
||||
@@ -29,7 +29,7 @@ namespace Ui {
|
||||
|
||||
class QCDScene;
|
||||
class QAbstractButton;
|
||||
class QElapsedTimer;
|
||||
class QTime;
|
||||
class QTimer;
|
||||
class QLightDrive;
|
||||
|
||||
@@ -56,7 +56,7 @@ private:
|
||||
|
||||
Ui::QDialogProgress *m_ui;
|
||||
QLightDrive *m_drive;
|
||||
QElapsedTimer *m_start;
|
||||
QTime *m_start;
|
||||
QTimer *m_timer;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef QDIALOGSETTINGS_H
|
||||
#define QDIALOGSETTINGS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QDialogSettings;
|
||||
|
||||
@@ -129,7 +129,7 @@ QPainterPath QLightRoundTextItem::shape() const
|
||||
const double pad = 1;
|
||||
|
||||
for( int i = 0; i < m_text.size(); ++i )
|
||||
arcAngle += mcs.horizontalAdvance(m_text[i]);
|
||||
arcAngle += mcs.width( m_text[ i ] );
|
||||
|
||||
double height = ( mcs.height() * 2 ) / 3;
|
||||
double in, out;
|
||||
@@ -192,10 +192,10 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
|
||||
switch( m_alignment ) {
|
||||
case Qt::AlignCenter :
|
||||
case Qt::AlignHCenter :
|
||||
angle += mcs.horizontalAdvance(m_text) / diam * ( m_outside ? -1 : 1 );
|
||||
angle += mcs.width( m_text ) / diam * ( m_outside ? -1 : 1 );
|
||||
break;
|
||||
case Qt::AlignRight :
|
||||
angle += mcs.horizontalAdvance(m_text) / radi * ( m_outside ? -1 : 1 );
|
||||
angle += mcs.width( m_text ) / radi * ( m_outside ? -1 : 1 );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -213,12 +213,12 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
|
||||
for( int i = 0; i < m_text.size(); ++i ) {
|
||||
QChar ch = m_text[ i ];
|
||||
|
||||
double d = (prevWidth + mcs.horizontalAdvance(ch)) / diam;
|
||||
double d = ( prevWidth + mcs.width( ch ) ) / diam;
|
||||
trans.reset();
|
||||
trans.rotateRadians( m_outside ? d : -d );
|
||||
painter->setWorldTransform( trans, true );
|
||||
|
||||
prevWidth = mcs.horizontalAdvance(ch);
|
||||
prevWidth = mcs.width( ch );
|
||||
|
||||
painter->drawText( int( -prevWidth / 2.0 ),
|
||||
int( m_outside ? -m_radius : m_radius ),
|
||||
@@ -371,3 +371,4 @@ void QShapeControllerRoundText::readData( const QString &element,
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void printScene( QCDScene *scene, QByteArray &array )
|
||||
image.save( &buffer, "bmp", 100 );
|
||||
}
|
||||
|
||||
QPixmap QLightDrive::preview(const PrintParameters ¶ms, QCDScene *scene, const QSize &size)
|
||||
QPixmap QLightDrive::preview( const PrintParameters ¶ms, QCDScene *scene, const QSize &size ) throw( QString )
|
||||
{
|
||||
qApp->setOverrideCursor( Qt::WaitCursor );
|
||||
QByteArray array;
|
||||
@@ -150,7 +150,7 @@ QPixmap QLightDrive::preview(const PrintParameters ¶ms, QCDScene *scene, con
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
void QLightDrive::print(const PrintParameters ¶ms, QCDScene *scene)
|
||||
void QLightDrive::print( const PrintParameters ¶ms, QCDScene *scene ) throw( QString )
|
||||
{
|
||||
qApp->setOverrideCursor( Qt::WaitCursor );
|
||||
QByteArray array;
|
||||
|
||||
+2
-3
@@ -24,7 +24,6 @@
|
||||
#include "qlscribe.h"
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QObject>
|
||||
#include <QMap>
|
||||
#include <QMetaType>
|
||||
|
||||
@@ -87,8 +86,8 @@ public:
|
||||
double innerRadius() const { return m_innerRadius; }
|
||||
double outerRadius() const { return m_outerRadius; }
|
||||
|
||||
QPixmap preview(const PrintParameters ¶ms, QCDScene *scene, const QSize &size);
|
||||
void print(const PrintParameters ¶ms, QCDScene *scene);
|
||||
QPixmap preview( const PrintParameters ¶ms, QCDScene *scene, const QSize &size ) throw( QString );
|
||||
void print( const PrintParameters ¶ms, QCDScene *scene ) throw( QString );
|
||||
|
||||
friend class QLightScribe;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user