Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa2ed7da93 | |||
| 56902bc871 | |||
| e467e60bd7 | |||
| 78b56ec751 | |||
| dc96e6f6d8 | |||
| de8eceae1b | |||
| b45ed50368 | |||
| 9d756d716c | |||
| 3e38fc464a | |||
| 6b2b9dee08 |
@@ -0,0 +1 @@
|
||||
/build/
|
||||
+10
-5
@@ -18,9 +18,14 @@
|
||||
#
|
||||
# $Id$
|
||||
|
||||
PROJECT( qlscribe )
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.21)
|
||||
PROJECT(qlscribe VERSION 0.20 LANGUAGES CXX)
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
SET(CMAKE_AUTOUIC ON)
|
||||
SET(CMAKE_AUTORCC ON)
|
||||
|
||||
SET( FINAL_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Final install path")
|
||||
SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
|
||||
@@ -32,6 +37,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
|
||||
|
||||
SUBDIRS( src )
|
||||
SUBDIRS( resources )
|
||||
SUBDIRS( lscribed )
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(resources)
|
||||
ADD_SUBDIRECTORY(lscribed)
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
* For historical reasons: this is when I imported qlscribe into
|
||||
SourceForge.
|
||||
|
||||
$Revision:$ $Date:$
|
||||
$Revision$ $Date$
|
||||
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
Qt lightScribe Installaton instructions
|
||||
=======================================
|
||||
|
||||
To compile qlscribe succesfully you may need additional packages installed.
|
||||
|
||||
So for Ubuntu folowing packages are required:
|
||||
build-essential
|
||||
cmake
|
||||
libqt4-dev
|
||||
libdbus-1-dev
|
||||
|
||||
For 64 bit Ubuntu you need also to install folowing packages:
|
||||
ia32-libs
|
||||
libc6-dev-i386 (maverick only, see notes)
|
||||
g++-multilib
|
||||
|
||||
(Note: this will work for maverick (10.10) version, for lucid and karmic
|
||||
/usr/lib32/libstdc++.so.5 is missing in ia32-libs so you would have to
|
||||
find it see https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/431091 )
|
||||
(Note: On 64 bit if you get "undefined reference std::_Rb_tree_increment..." link error it is
|
||||
possible that link /usr/lib32/libstdc++.so points to /usr/lib32/libstdc++.so.5... change it
|
||||
so it points /usr/lib32/libstdc++.so.6...)
|
||||
|
||||
For 64 bit Ubuntu libdbus-1-dev does not have link for i386 libdbus-1.so you may need to create one manually:
|
||||
sudo ln -s libdbus-1.so.3 /lib/i386-linux-gnu/libdbus-1.so
|
||||
|
||||
|
||||
To compile and install, first download release from http://qlscribe.sourceforge.net/
|
||||
or check out project from subversion repository for particular release:
|
||||
|
||||
@@ -30,7 +54,7 @@ Include files should be in ${LIGHTSCRIBEDIR}/include and lib in ${LIGHTSCRIBEDIR
|
||||
You need manually install dbus config and service files. They are located in INSTALL_PATH/share/qlscribe
|
||||
So on my ubuntu system I do
|
||||
sudo cp /usr/local/share/qlscribe/lightscribe.conf /etc/dbus-1/system.d/
|
||||
sudo cp /usr/local/share/qlscribe/org.lightscribe.Manager.service /usr/share/dbus-1/system-services/
|
||||
sudo cp /usr/local/share/qlscribe/org.lightscribe.printManager.service /usr/share/dbus-1/system-services/
|
||||
sudo /etc/init.d/dbus reload
|
||||
|
||||
Your system may have different path please refer dbus system daemon documentation
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
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
|
||||
Added instructions for 64 bit
|
||||
|
||||
New in 0.15
|
||||
Added ability to align regular text to left, right or center the same way as rounded text
|
||||
Fixed issue with filters in open dialog
|
||||
@@ -81,4 +100,3 @@ 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)
|
||||
|
||||
|
||||
+11
-4
@@ -22,9 +22,16 @@ FIND_PATH( DBUS_INCLUDE_DIR dbus/dbus.h
|
||||
PATH_SUFFIXES dbus-1.0 )
|
||||
|
||||
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
|
||||
FIND_LIBRARY( DBUS_LIBRARY dbus-1
|
||||
PATHS /lib32 /usr/lib32 /usr/local/lib32
|
||||
NO_DEFAULT_PATH )
|
||||
# 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()
|
||||
ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
|
||||
|
||||
FIND_LIBRARY( DBUS_LIBRARY dbus-1 )
|
||||
@@ -32,7 +39,7 @@ FIND_LIBRARY( DBUS_LIBRARY dbus-1 )
|
||||
get_filename_component( _dbusLibPath ${DBUS_LIBRARY} PATH )
|
||||
|
||||
FIND_PATH( DBUS_LIBINCLUDE_DIR dbus/dbus-arch-deps.h
|
||||
PATHS /lib /usr/lib /usr/local/lib ${_dbusLibPath}
|
||||
PATHS /lib /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu ${_dbusLibPath}
|
||||
PATH_SUFFIXES dbus-1.0/include )
|
||||
|
||||
if( DBUS_INCLUDE_DIR AND DBUS_LIBINCLUDE_DIR AND DBUS_LIBRARY )
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,5 @@
|
||||
qlscribe (0.15-0ubuntu1) unstable; urgency=low
|
||||
qlscribe (0.15-0lenny1) unstable; urgency=low
|
||||
* Release 0.16 imported
|
||||
* Release 0.15 imported
|
||||
* Release 0.14 imported
|
||||
* Release 0.13 imported
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ Source: qlscribe
|
||||
Section: qt
|
||||
Priority: optional
|
||||
Maintainer: Vyacheslav Kononenko <vyacheslav@kononenko.net>
|
||||
Build-Depends: debhelper (>= 7)
|
||||
Build-Depends: debhelper (>= 7), cmake, qt4-qmake, libqt4-dev, libdbus-1-dev, lightscribepublicsdk, lightscribe
|
||||
Standards-Version: 3.7.3
|
||||
Homepage: http://qlscribe.sourceforge.net/
|
||||
|
||||
|
||||
@@ -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,6 +21,8 @@
|
||||
#include "dbuscpp.h"
|
||||
#include "lscribed.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
using namespace DBusCpp;
|
||||
|
||||
MessageHandler::~MessageHandler()
|
||||
@@ -216,4 +218,3 @@ const char *Message::member() const
|
||||
{
|
||||
return dbus_message_get_member( m_message );
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ void Drive::routine()
|
||||
|
||||
function = "LS_DiscPrintMgr_EnumDiscPrinters";
|
||||
EnumDiscPrinters printers = manager.EnumDiscPrinters();
|
||||
if( m_index >= printers.Count() )
|
||||
if( m_index >= int( printers.Count() ) )
|
||||
throw std::string( "internal error: invalid index" );
|
||||
|
||||
DiscPrinter printer = printers.Item( m_index );
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "lscribed.h"
|
||||
#include "dbuscpp.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Encoding=UTF-8
|
||||
Name=Qt lightScribe
|
||||
Exec=qlscribe
|
||||
Icon=qlscribe.png
|
||||
Icon=qlscribe
|
||||
Terminal=false
|
||||
Type=Application
|
||||
MimeType=application/x-qlscribe;
|
||||
|
||||
+6
-38
@@ -18,8 +18,7 @@
|
||||
#
|
||||
# $Id$
|
||||
|
||||
FIND_PACKAGE( Qt4 REQUIRED )
|
||||
SET( QT_USE_QTDBUS 1 )
|
||||
FIND_PACKAGE(Qt6 6.5 REQUIRED COMPONENTS Core Gui Widgets DBus)
|
||||
|
||||
SET( QLSCRIBE_SRCS main.cpp mainwindow.cpp qcdscene.cpp qcdview.cpp
|
||||
qdialogpixmap.cpp qdialogroundtext.cpp qdialogtext.cpp qlightroundtextitem.cpp
|
||||
@@ -30,50 +29,19 @@ 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 )
|
||||
|
||||
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 )
|
||||
SET_SOURCE_FILES_PROPERTIES(lightscribe.xml PROPERTIES INCLUDE qlightscribe.h)
|
||||
QT6_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_MOC_SRCS}
|
||||
${QLSCRIBE_RCC_SRCS} ${QLSCRIBE_UI_HDRS}
|
||||
${QLSCRIBE_DBUS_SRCS} )
|
||||
ADD_EXECUTABLE(qlscribe ${QLSCRIBE_SRCS} ${QLSCRIBE_UIS}
|
||||
${QLSCRIBE_DBUS_SRCS} ../resources/qlscribe.qrc)
|
||||
|
||||
TARGET_LINK_LIBRARIES( qlscribe ${QT_LIBRARIES} )
|
||||
TARGET_LINK_LIBRARIES(qlscribe PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::DBus)
|
||||
|
||||
INSTALL( TARGETS qlscribe
|
||||
DESTINATION bin )
|
||||
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@
|
||||
<node>
|
||||
<interface name="org.lightscribe.printManager">
|
||||
<method name="getDrives">
|
||||
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QObject2StringMap"/>
|
||||
<annotation name="org.qtproject.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="com.trolltech.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<annotation name="com.trolltech.QtDBus.QtTypeName.In2" value="QSize"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<annotation name="org.qtproject.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="com.trolltech.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="const PrintParameters &"/>
|
||||
<arg name="params" type="(iiiii)" direction="in"/>
|
||||
<arg name="image" type="ay" direction="in"/>
|
||||
</method>
|
||||
|
||||
+3
-4
@@ -34,7 +34,7 @@
|
||||
|
||||
std::ostream &operator<<( std::ostream &os, const QString &str )
|
||||
{
|
||||
return os << str.toAscii().data();
|
||||
return os << str.toUtf8().constData();
|
||||
}
|
||||
|
||||
void usage()
|
||||
@@ -57,9 +57,8 @@ int main( int argc, char **argv )
|
||||
{
|
||||
QApplication app( argc, argv );
|
||||
app.setApplicationName( "qlscribe" );
|
||||
//app.setOrganizationName( "" );
|
||||
app.setOrganizationDomain( "qlscribe.sourceforge.org" );
|
||||
app.addLibraryPath( "/usr/lib32/qt4/plugins" );
|
||||
app.setOrganizationName( "disconnected-by-peer.at" );
|
||||
app.setOrganizationDomain( "disconnected-by-peer.at" );
|
||||
app.setWindowIcon( QIcon( ":/qlscribe64.png" ) );
|
||||
|
||||
bool doPrint = false;
|
||||
|
||||
+9
-5
@@ -41,6 +41,7 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QSettings>
|
||||
#include <QImageReader>
|
||||
#include <QPicture>
|
||||
@@ -75,7 +76,8 @@ MainWindow::MainWindow( bool enablePrint )
|
||||
SLOT(map()) );
|
||||
m_newLabelMapper->setMapping( action, modeTitle );
|
||||
}
|
||||
connect( m_newLabelMapper, SIGNAL(mapped(int)), this, SLOT(onMenuNewLabel(int)) );
|
||||
connect(m_newLabelMapper, &QSignalMapper::mappedInt,
|
||||
this, &MainWindow::onMenuNewLabel);
|
||||
|
||||
m_menuFile->addAction( tr( "Open...", "Menu item \"Open\"" ),
|
||||
this,
|
||||
@@ -169,7 +171,8 @@ MainWindow::MainWindow( bool enablePrint )
|
||||
m_insertMapper->setMapping( action, i->first );
|
||||
connect( action, SIGNAL(triggered()), m_insertMapper, SLOT(map()) );
|
||||
}
|
||||
connect( m_insertMapper, SIGNAL(mapped(int)), this, SLOT(onMenuInsert(int)) );
|
||||
connect(m_insertMapper, &QSignalMapper::mappedInt,
|
||||
this, &MainWindow::onMenuInsert);
|
||||
|
||||
connect( QApplication::clipboard(), SIGNAL(changed(QClipboard::Mode)),
|
||||
this, SLOT(updateMenu()) );
|
||||
@@ -544,10 +547,11 @@ void MainWindow::onMenuAbout()
|
||||
{
|
||||
QMessageBox::about( this,
|
||||
tr( "About" ),
|
||||
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
|
||||
"<p>release 0.15 $Revision$</p>"
|
||||
tr( "<h3>qlscribe - Qt LightScribe</h3>"
|
||||
"<p>release 0.20</p>"
|
||||
"<p>visit project at home page "
|
||||
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
|
||||
"<a href=\"https://gitea.disconnected-by-peer.at/geos_one/qlscribe\">"
|
||||
"gitea.disconnected-by-peer.at/geos_one/qlscribe</a></p>" ) );
|
||||
}
|
||||
|
||||
void MainWindow::onMenuQtAbout()
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QMainWindow>
|
||||
|
||||
class QMdiArea;
|
||||
class QSignalMapper;
|
||||
|
||||
@@ -12,7 +12,7 @@ PreviewInjector::PreviewInjector( QFileDialog * dl ) :
|
||||
if( !dl )
|
||||
return;
|
||||
|
||||
QSplitter *sp = qFindChild<QSplitter *>( dl, "splitter" );
|
||||
QSplitter *sp = dl->findChild<QSplitter *>("splitter");
|
||||
if( !sp )
|
||||
return;
|
||||
|
||||
@@ -58,4 +58,3 @@ void PreviewInjector::onSelectionChanged(QString file)
|
||||
}
|
||||
m_label->setPixmap( QPixmap::fromImage( img ) );
|
||||
}
|
||||
|
||||
|
||||
+4
-8
@@ -31,11 +31,10 @@
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QMessageBox>
|
||||
#include <QGraphicsView>
|
||||
#include <QRegExp>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QRegExp>
|
||||
#include <QFileInfo>
|
||||
|
||||
QCDScene::QCDScene( QObject * parent )
|
||||
: QGraphicsScene( parent ),
|
||||
@@ -83,7 +82,7 @@ void QCDScene::start( LabelMode mode )
|
||||
|
||||
bool QCDScene::load( const QString &fileName, QString *errMessage )
|
||||
{
|
||||
if( QRegExp( ".*.\\.qlx$", Qt::CaseInsensitive ).exactMatch( fileName ) ) {
|
||||
if (fileName.endsWith(".qlx", Qt::CaseInsensitive)) {
|
||||
QFile file( fileName );
|
||||
if( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
if( errMessage )
|
||||
@@ -188,9 +187,7 @@ void QCDScene::setName()
|
||||
}
|
||||
m_name = "Unnamed_" + QString::number( m_index );
|
||||
} else {
|
||||
QRegExp rx( "(.*/)?(.*)\\.qlx" );
|
||||
rx.indexIn( m_fileName );
|
||||
m_name = rx.cap( 2 );
|
||||
m_name = QFileInfo(m_fileName).completeBaseName();
|
||||
}
|
||||
|
||||
updateTitles();
|
||||
@@ -405,7 +402,7 @@ void QCDScene::getItemFromClipboard()
|
||||
|
||||
void QCDScene::contextMenuEvent( QGraphicsSceneContextMenuEvent *mouseEvent )
|
||||
{
|
||||
QGraphicsItem *item = itemAt( mouseEvent->scenePos() );
|
||||
QGraphicsItem *item = itemAt(mouseEvent->scenePos(), QTransform());
|
||||
if( !item )
|
||||
return;
|
||||
item->setSelected( true );
|
||||
@@ -520,4 +517,3 @@ void QCDScene::unredo( bool undo )
|
||||
}
|
||||
setChanged( false );
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -160,7 +160,9 @@ void QCDView::drawForeground ( QPainter * painter, const QRectF & rect )
|
||||
QPainter paint( &alpha );
|
||||
paint.setWorldTransform( painter->transform() );
|
||||
drawCD( &paint, rectf, true );
|
||||
m_mask->setAlphaChannel( alpha );
|
||||
QImage maskImage = m_mask->toImage().convertToFormat(QImage::Format_ARGB32);
|
||||
maskImage.setAlphaChannel(alpha.toImage());
|
||||
*m_mask = QPixmap::fromImage(maskImage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef QDIALOGCDPROPERTIES_H
|
||||
#define QDIALOGCDPROPERTIES_H
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QDialogCDProperties;
|
||||
|
||||
@@ -123,7 +123,7 @@ void QDialogPixmap::onLoadImage()
|
||||
filter += tr( ");;All Files (*.*)" );
|
||||
|
||||
QFileDialog fd( this, "Load image:", QString(), filter );
|
||||
fd.setOption( QFileDialog::DontUseNativeDialog ); // for testing
|
||||
//fd.setOption( QFileDialog::DontUseNativeDialog ); // for testing
|
||||
|
||||
bool injectPreview = QSettings().value( cfgInjectPreview, true ).toBool();
|
||||
PreviewInjector pj( injectPreview ? &fd : 0 );
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#ifndef QDIALOGPRINT_H
|
||||
#define QDIALOGPRINT_H
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
#include <QDialog>
|
||||
|
||||
#include "qlightscribe.h"
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QMessageBox>
|
||||
#include <QAbstractButton>
|
||||
#include <QTime>
|
||||
#include <QElapsedTimer>
|
||||
#include <QTimer>
|
||||
#include <QSettings>
|
||||
|
||||
@@ -34,7 +35,7 @@ QDialogProgress::QDialogProgress( QWidget *parent, QLightDrive *drive )
|
||||
: QDialog(parent),
|
||||
m_ui(new Ui::QDialogProgress),
|
||||
m_drive( drive ),
|
||||
m_start( new QTime ),
|
||||
m_start(new QElapsedTimer),
|
||||
m_timer( new QTimer( this ) )
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef QDIALOGPROGRESS_H
|
||||
#define QDIALOGPROGRESS_H
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QDialogProgress;
|
||||
@@ -29,7 +29,7 @@ namespace Ui {
|
||||
|
||||
class QCDScene;
|
||||
class QAbstractButton;
|
||||
class QTime;
|
||||
class QElapsedTimer;
|
||||
class QTimer;
|
||||
class QLightDrive;
|
||||
|
||||
@@ -56,7 +56,7 @@ private:
|
||||
|
||||
Ui::QDialogProgress *m_ui;
|
||||
QLightDrive *m_drive;
|
||||
QTime *m_start;
|
||||
QElapsedTimer *m_start;
|
||||
QTimer *m_timer;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef QDIALOGSETTINGS_H
|
||||
#define QDIALOGSETTINGS_H
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QDialogSettings;
|
||||
|
||||
@@ -123,7 +123,7 @@ void QShapeControllerPixmap::readData( const QString &element,
|
||||
}
|
||||
pixmapItem->imageName( data );
|
||||
pixmapItem->setPixmap( pixmap );
|
||||
pixmapItem->setOffset( -QPointF( pixmap.size().height(), pixmap.size().width() ) / 2.0 );
|
||||
pixmapItem->setOffset( -QPointF( pixmap.size().width(), pixmap.size().height() ) / 2.0 );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ QPainterPath QLightRoundTextItem::shape() const
|
||||
const double pad = 1;
|
||||
|
||||
for( int i = 0; i < m_text.size(); ++i )
|
||||
arcAngle += mcs.width( m_text[ i ] );
|
||||
arcAngle += mcs.horizontalAdvance(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.width( m_text ) / diam * ( m_outside ? -1 : 1 );
|
||||
angle += mcs.horizontalAdvance(m_text) / diam * ( m_outside ? -1 : 1 );
|
||||
break;
|
||||
case Qt::AlignRight :
|
||||
angle += mcs.width( m_text ) / radi * ( m_outside ? -1 : 1 );
|
||||
angle += mcs.horizontalAdvance(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.width( ch ) ) / diam;
|
||||
double d = (prevWidth + mcs.horizontalAdvance(ch)) / diam;
|
||||
trans.reset();
|
||||
trans.rotateRadians( m_outside ? d : -d );
|
||||
painter->setWorldTransform( trans, true );
|
||||
|
||||
prevWidth = mcs.width( ch );
|
||||
prevWidth = mcs.horizontalAdvance(ch);
|
||||
|
||||
painter->drawText( int( -prevWidth / 2.0 ),
|
||||
int( m_outside ? -m_radius : m_radius ),
|
||||
@@ -371,4 +371,3 @@ void QShapeControllerRoundText::readData( const QString &element,
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-15
@@ -109,24 +109,25 @@ QLightDrive::QLightDrive( QObject *parent, const QString &path, const QString &n
|
||||
static
|
||||
void printScene( QCDScene *scene, QByteArray &array )
|
||||
{
|
||||
QImage image( 2772, 2772, QImage::Format_RGB888 );
|
||||
image.fill( 0xFFFFFFFF );
|
||||
const int resolution = 2772;
|
||||
QImage image( resolution, resolution, QImage::Format_RGB888 );
|
||||
image.fill( 0xFFFFFFFF );
|
||||
|
||||
scene->clearSelection();
|
||||
{
|
||||
QPainter painter( &image );
|
||||
scene->render( &painter, image.rect() );
|
||||
}
|
||||
image.setDotsPerMeterX( 23622 );
|
||||
image.setDotsPerMeterY( 23622 );
|
||||
scene->clearSelection();
|
||||
{
|
||||
QPainter painter( &image );
|
||||
scene->render( &painter, image.rect() );
|
||||
}
|
||||
image.setDotsPerMeterX( resolution * 8 );
|
||||
image.setDotsPerMeterY( resolution * 8 );
|
||||
|
||||
array.clear();
|
||||
QBuffer buffer( &array );
|
||||
buffer.open( QIODevice::WriteOnly );
|
||||
image.save( &buffer, "bmp", 100 );
|
||||
array.clear();
|
||||
QBuffer buffer( &array );
|
||||
buffer.open( QIODevice::WriteOnly );
|
||||
image.save( &buffer, "bmp", 100 );
|
||||
}
|
||||
|
||||
QPixmap QLightDrive::preview( const PrintParameters ¶ms, QCDScene *scene, const QSize &size ) throw( QString )
|
||||
QPixmap QLightDrive::preview(const PrintParameters ¶ms, QCDScene *scene, const QSize &size)
|
||||
{
|
||||
qApp->setOverrideCursor( Qt::WaitCursor );
|
||||
QByteArray array;
|
||||
@@ -149,7 +150,7 @@ QPixmap QLightDrive::preview( const PrintParameters ¶ms, QCDScene *scene, co
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
void QLightDrive::print( const PrintParameters ¶ms, QCDScene *scene ) throw( QString )
|
||||
void QLightDrive::print(const PrintParameters ¶ms, QCDScene *scene)
|
||||
{
|
||||
qApp->setOverrideCursor( Qt::WaitCursor );
|
||||
QByteArray array;
|
||||
|
||||
+3
-2
@@ -24,6 +24,7 @@
|
||||
#include "qlscribe.h"
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QObject>
|
||||
#include <QMap>
|
||||
#include <QMetaType>
|
||||
|
||||
@@ -86,8 +87,8 @@ public:
|
||||
double innerRadius() const { return m_innerRadius; }
|
||||
double outerRadius() const { return m_outerRadius; }
|
||||
|
||||
QPixmap preview( const PrintParameters ¶ms, QCDScene *scene, const QSize &size ) throw( QString );
|
||||
void print( const PrintParameters ¶ms, QCDScene *scene ) throw( QString );
|
||||
QPixmap preview(const PrintParameters ¶ms, QCDScene *scene, const QSize &size);
|
||||
void print(const PrintParameters ¶ms, QCDScene *scene);
|
||||
|
||||
friend class QLightScribe;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user