mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 04:33:03 +03:00
Qt4 build fixed
This commit is contained in:
parent
d0cf6f4961
commit
1700576394
@ -94,7 +94,7 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
virtual void updateProperty(const QString &name, const QVariant &value, bool enableSubPropertyHandling);
|
virtual void updateProperty(const QString &name, const QVariant &value, bool enableSubPropertyHandling);
|
||||||
// Additional signals of designer property editor
|
// Additional signals of designer property editor
|
||||||
virtual void updatePropertyComment(const QString &name, const QString &value);
|
// virtual void updatePropertyComment(const QString &name, const QString &value);
|
||||||
virtual void resetProperty(const QString &name);
|
virtual void resetProperty(const QString &name);
|
||||||
virtual void addDynamicProperty(const QString &name, const QVariant &value);
|
virtual void addDynamicProperty(const QString &name, const QVariant &value);
|
||||||
virtual void removeDynamicProperty(const QString &name);
|
virtual void removeDynamicProperty(const QString &name);
|
||||||
|
@ -11,7 +11,15 @@ lessThan(QT_MAJOR_VERSION, 5){
|
|||||||
DEFINES += HAVE_QTDESIGNER_INTEGRATION
|
DEFINES += HAVE_QTDESIGNER_INTEGRATION
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QT += designer designercomponents-private
|
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
|
QT *= designer designercomponents-private
|
||||||
|
|
||||||
|
} else {
|
||||||
|
CONFIG *= designer
|
||||||
|
qtAddLibrary( QtDesignerComponents )
|
||||||
|
}
|
||||||
|
#QT += designer designercomponents-private
|
||||||
|
|
||||||
SOURCES += $$PWD/lrdialogdesigner.cpp
|
SOURCES += $$PWD/lrdialogdesigner.cpp
|
||||||
HEADERS += $$PWD/lrdialogdesigner.h
|
HEADERS += $$PWD/lrdialogdesigner.h
|
||||||
|
@ -3,9 +3,6 @@
|
|||||||
#include <QPluginLoader>
|
#include <QPluginLoader>
|
||||||
|
|
||||||
#include <QDesignerComponents>
|
#include <QDesignerComponents>
|
||||||
#include <QDesignerIntegration>
|
|
||||||
#include <abstractobjectinspector.h>
|
|
||||||
|
|
||||||
#include <QDesignerFormEditorInterface>
|
#include <QDesignerFormEditorInterface>
|
||||||
#include <QDesignerFormWindowInterface>
|
#include <QDesignerFormWindowInterface>
|
||||||
#include <QDesignerFormWindowManagerInterface>
|
#include <QDesignerFormWindowManagerInterface>
|
||||||
@ -19,10 +16,17 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include "pluginmanager_p.h"
|
|
||||||
//#include <QExtensionManager>
|
|
||||||
|
|
||||||
|
#if HAVE_QT5
|
||||||
|
#include <QDesignerIntegration>
|
||||||
|
#endif
|
||||||
|
#if HAVE_QT4
|
||||||
|
#include "qdesigner_integration_p.h"
|
||||||
|
#include <QtDesigner/QDesignerIntegrationInterface>
|
||||||
|
#endif
|
||||||
|
#include "pluginmanager_p.h"
|
||||||
#include "widgethost.h"
|
#include "widgethost.h"
|
||||||
|
#include <abstractobjectinspector.h>
|
||||||
|
|
||||||
namespace LimeReport{
|
namespace LimeReport{
|
||||||
|
|
||||||
@ -98,7 +102,12 @@ DialogDesignerManager::DialogDesignerManager(QObject *parent) : QObject(parent)
|
|||||||
m_designerToolWindows.append(m_actionEditor);
|
m_designerToolWindows.append(m_actionEditor);
|
||||||
connect(m_actionEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) );
|
connect(m_actionEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) );
|
||||||
|
|
||||||
|
#ifdef HAVE_QT4
|
||||||
|
m_designerIntegration = new qdesigner_internal::QDesignerIntegration(m_formEditor,this);
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_QT5
|
||||||
m_designerIntegration = new QDesignerIntegration(m_formEditor,this);
|
m_designerIntegration = new QDesignerIntegration(m_formEditor,this);
|
||||||
|
#endif
|
||||||
m_formEditor->setIntegration(m_designerIntegration);
|
m_formEditor->setIntegration(m_designerIntegration);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -151,7 +160,7 @@ QWidget *DialogDesignerManager::createFormEditor(const QString &content)
|
|||||||
|
|
||||||
DialogDesigner* dialogDesigner = new DialogDesigner(wnd, m_formEditor);
|
DialogDesigner* dialogDesigner = new DialogDesigner(wnd, m_formEditor);
|
||||||
|
|
||||||
connect(dialogDesigner, SIGNAL(dialogChanged()), this, SLOT(slotDialogChanged()));
|
connect(dialogDesigner, SIGNAL(dialogChanged(QString)), this, SIGNAL(dialogChanged(QString)));
|
||||||
connect(dialogDesigner, SIGNAL(dialogNameChanged(QString,QString)), this, SIGNAL(dialogNameChanged(QString,QString)));
|
connect(dialogDesigner, SIGNAL(dialogNameChanged(QString,QString)), this, SIGNAL(dialogNameChanged(QString,QString)));
|
||||||
connect(dialogDesigner, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)));
|
connect(dialogDesigner, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)));
|
||||||
|
|
||||||
@ -253,14 +262,6 @@ void DialogDesignerManager::slotActiveFormWindowChanged(QDesignerFormWindowInter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogDesignerManager::slotDialogChanged()
|
|
||||||
{
|
|
||||||
DialogDesigner* dialogDesigner = dynamic_cast<DialogDesigner*>(sender());
|
|
||||||
if (dialogDesigner){
|
|
||||||
emit dialogChanged(dialogDesigner->dialogName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString DialogDesignerManager::iconPathByName(const QString &name)
|
QString DialogDesignerManager::iconPathByName(const QString &name)
|
||||||
{
|
{
|
||||||
if (name.compare("__qt_edit_signals_slots_action") == 0)
|
if (name.compare("__qt_edit_signals_slots_action") == 0)
|
||||||
@ -276,8 +277,7 @@ DialogDesigner::DialogDesigner(QDesignerFormWindowInterface* wnd, QDesignerFormE
|
|||||||
:QWidget(parent, flags), m_formEditor(formEditor)
|
:QWidget(parent, flags), m_formEditor(formEditor)
|
||||||
{
|
{
|
||||||
m_dialogName = wnd->mainContainer()->objectName();
|
m_dialogName = wnd->mainContainer()->objectName();
|
||||||
connect(wnd, SIGNAL(changed()), this, SIGNAL(dialogChanged()));
|
connect(wnd, SIGNAL(changed()), this, SLOT(slotDialogChanged()));
|
||||||
connect(wnd->mainContainer(), SIGNAL(objectNameChanged(QString)), this, SLOT(slotMainContainerNameChanged(QString)));
|
|
||||||
|
|
||||||
m_designerHolder = new SharedTools::WidgetHost(this,wnd);
|
m_designerHolder = new SharedTools::WidgetHost(this,wnd);
|
||||||
m_designerHolder->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
|
m_designerHolder->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
|
||||||
@ -308,7 +308,7 @@ bool DialogDesigner::isChanged()
|
|||||||
|
|
||||||
void DialogDesigner::setChanged(bool value)
|
void DialogDesigner::setChanged(bool value)
|
||||||
{
|
{
|
||||||
m_designerHolder->formWindow()->setDirty(false);
|
m_designerHolder->formWindow()->setDirty(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray DialogDesigner::dialogContent()
|
QByteArray DialogDesigner::dialogContent()
|
||||||
@ -342,4 +342,17 @@ void DialogDesigner::slotMainContainerNameChanged(QString newName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogDesigner::slotDialogChanged()
|
||||||
|
{
|
||||||
|
Q_ASSERT(m_designerHolder != NULL);
|
||||||
|
if (m_designerHolder && m_designerHolder->formWindow()){
|
||||||
|
if ( m_designerHolder->formWindow()->mainContainer()->objectName().compare(m_dialogName) !=0 ){
|
||||||
|
emit dialogNameChanged(m_dialogName, m_designerHolder->formWindow()->mainContainer()->objectName());
|
||||||
|
m_dialogName = m_designerHolder->formWindow()->mainContainer()->objectName();
|
||||||
|
}
|
||||||
|
emit dialogChanged(m_dialogName);
|
||||||
|
m_designerHolder->formWindow()->setDirty(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
|
#include <QActionGroup>
|
||||||
|
|
||||||
class QDesignerFormEditorInterface;
|
class QDesignerFormEditorInterface;
|
||||||
class QDesignerFormWindowInterface;
|
class QDesignerFormWindowInterface;
|
||||||
@ -23,7 +24,7 @@ namespace LimeReport{
|
|||||||
class DialogDesigner : public QWidget{
|
class DialogDesigner : public QWidget{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DialogDesigner(QDesignerFormWindowInterface *wnd, QDesignerFormEditorInterface* formEditor, QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
|
DialogDesigner(QDesignerFormWindowInterface *wnd, QDesignerFormEditorInterface* formEditor, QWidget *parent = NULL, Qt::WindowFlags flags = Qt::WindowFlags());
|
||||||
~DialogDesigner();
|
~DialogDesigner();
|
||||||
QString dialogName() const;
|
QString dialogName() const;
|
||||||
void setDialogName(const QString &dialogName);
|
void setDialogName(const QString &dialogName);
|
||||||
@ -34,11 +35,11 @@ public slots:
|
|||||||
void undo();
|
void undo();
|
||||||
void redo();
|
void redo();
|
||||||
signals:
|
signals:
|
||||||
void dialogChanged();
|
void dialogChanged(QString dialogName);
|
||||||
void dialogNameChanged(QString oldName, QString newName);
|
void dialogNameChanged(QString oldName, QString newName);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotMainContainerNameChanged(QString newName);
|
void slotMainContainerNameChanged(QString newName);
|
||||||
|
void slotDialogChanged();
|
||||||
private:
|
private:
|
||||||
QString m_dialogName;
|
QString m_dialogName;
|
||||||
SharedTools::WidgetHost* m_designerHolder;
|
SharedTools::WidgetHost* m_designerHolder;
|
||||||
@ -69,7 +70,6 @@ private slots:
|
|||||||
void slotObjectDestroyed(QObject* object);
|
void slotObjectDestroyed(QObject* object);
|
||||||
void slotEditWidgets();
|
void slotEditWidgets();
|
||||||
void slotActiveFormWindowChanged(QDesignerFormWindowInterface *formWindow);
|
void slotActiveFormWindowChanged(QDesignerFormWindowInterface *formWindow);
|
||||||
void slotDialogChanged();
|
|
||||||
private:
|
private:
|
||||||
QString iconPathByName(const QString& name);
|
QString iconPathByName(const QString& name);
|
||||||
private:
|
private:
|
||||||
|
@ -163,8 +163,12 @@ void PreviewReportWidget::print()
|
|||||||
QPrinter printer(QPrinter::HighResolution);
|
QPrinter printer(QPrinter::HighResolution);
|
||||||
|
|
||||||
if (!pi.defaultPrinter().isNull())
|
if (!pi.defaultPrinter().isNull())
|
||||||
printer.setPrinterName(pi.defaultPrinterName());
|
#ifdef HAVE_QT4
|
||||||
|
printer.setPrinterName(pi.defaultPrinter().printerName());
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_QT5
|
||||||
|
printer.setPrinterName(pi.defaultPrinterName());
|
||||||
|
#endif
|
||||||
QPrintDialog dialog(&printer,QApplication::activeWindow());
|
QPrintDialog dialog(&printer,QApplication::activeWindow());
|
||||||
if (dialog.exec()==QDialog::Accepted){
|
if (dialog.exec()==QDialog::Accepted){
|
||||||
if (!d_ptr->m_reportPages.isEmpty())
|
if (!d_ptr->m_reportPages.isEmpty())
|
||||||
|
@ -274,7 +274,12 @@ bool ReportEnginePrivate::printReport(QPrinter* printer)
|
|||||||
if (!printer&&!m_printerSelected){
|
if (!printer&&!m_printerSelected){
|
||||||
QPrinterInfo pi;
|
QPrinterInfo pi;
|
||||||
if (!pi.defaultPrinter().isNull())
|
if (!pi.defaultPrinter().isNull())
|
||||||
|
#ifdef HAVE_QT4
|
||||||
|
m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_QT5
|
||||||
m_printer.data()->setPrinterName(pi.defaultPrinterName());
|
m_printer.data()->setPrinterName(pi.defaultPrinterName());
|
||||||
|
#endif
|
||||||
QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
|
QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
|
||||||
m_printerSelected = dialog.exec()!=QDialog::Rejected;
|
m_printerSelected = dialog.exec()!=QDialog::Rejected;
|
||||||
}
|
}
|
||||||
@ -301,7 +306,12 @@ bool ReportEnginePrivate::printPages(ReportPages pages, QPrinter *printer, Print
|
|||||||
if (!printer&&!m_printerSelected){
|
if (!printer&&!m_printerSelected){
|
||||||
QPrinterInfo pi;
|
QPrinterInfo pi;
|
||||||
if (!pi.defaultPrinter().isNull())
|
if (!pi.defaultPrinter().isNull())
|
||||||
|
#ifdef HAVE_QT4
|
||||||
|
m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_QT5
|
||||||
m_printer.data()->setPrinterName(pi.defaultPrinterName());
|
m_printer.data()->setPrinterName(pi.defaultPrinterName());
|
||||||
|
#endif
|
||||||
QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
|
QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
|
||||||
m_printerSelected = dialog.exec()!=QDialog::Rejected;
|
m_printerSelected = dialog.exec()!=QDialog::Rejected;
|
||||||
if (m_printerSelected){
|
if (m_printerSelected){
|
||||||
|
Loading…
Reference in New Issue
Block a user