mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-23 08:29:07 +03:00
plugin extracted
This commit is contained in:
@@ -31,23 +31,31 @@
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
|
||||
: ItemEditorWidget(reportEditor,title,parent), m_ignoreSlots(false) {
|
||||
initEditor();
|
||||
}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
//FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
|
||||
// : ItemEditorWidget(reportEditor,title,parent), m_ignoreSlots(false) {
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
|
||||
:ItemEditorWidget(reportEditor,parent), m_ignoreSlots(false) {
|
||||
initEditor();
|
||||
}
|
||||
//FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
|
||||
// :ItemEditorWidget(reportEditor,parent), m_ignoreSlots(false) {
|
||||
// initEditor();
|
||||
//}
|
||||
//#endif
|
||||
|
||||
FontEditorWidget::FontEditorWidget(PageDesignIntf *page, const QString &title, QWidget *parent)
|
||||
:ItemEditorWidget(page,title,parent), m_ignoreSlots(false) {
|
||||
initEditor();
|
||||
}
|
||||
//FontEditorWidget::FontEditorWidget(PageDesignIntf *page, const QString &title, QWidget *parent)
|
||||
// :ItemEditorWidget(page,title,parent), m_ignoreSlots(false) {
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
FontEditorWidget::FontEditorWidget(LimeReport::PageDesignIntf *page, QWidget *parent)
|
||||
:ItemEditorWidget(page,parent), m_ignoreSlots(false){
|
||||
//FontEditorWidget::FontEditorWidget(LimeReport::PageDesignIntf *page, QWidget *parent)
|
||||
// :ItemEditorWidget(page,parent), m_ignoreSlots(false){
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
FontEditorWidget::FontEditorWidget(const QString& title, QWidget* parent)
|
||||
:ItemEditorWidget(title, parent), m_ignoreSlots(false)
|
||||
{
|
||||
initEditor();
|
||||
}
|
||||
|
||||
@@ -101,10 +109,13 @@ void FontEditorWidget::initEditor()
|
||||
connect(m_fontUnderline,SIGNAL(toggled(bool)),this,SLOT(slotFontAttribsChanged(bool)));
|
||||
addAction(m_fontUnderline);
|
||||
|
||||
if (reportEditor()){
|
||||
connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor()){
|
||||
// connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
// this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
// }
|
||||
//#endif
|
||||
|
||||
}
|
||||
|
||||
void FontEditorWidget::updateValues(const QFont& font)
|
||||
@@ -118,34 +129,41 @@ void FontEditorWidget::updateValues(const QFont& font)
|
||||
m_ignoreSlots=false;
|
||||
}
|
||||
|
||||
bool FontEditorWidget::ignoreSlots() const
|
||||
{
|
||||
return m_ignoreSlots;
|
||||
}
|
||||
|
||||
|
||||
void FontEditorWidget::slotFontChanged(const QFont &font)
|
||||
{
|
||||
if (reportEditor() && !m_ignoreSlots) reportEditor()->setFont(font);
|
||||
if (page()) page()->setFont(font);
|
||||
// if (page()) page()->setFont(font);
|
||||
}
|
||||
|
||||
void FontEditorWidget::slotFontSizeChanged(const QString &value)
|
||||
{
|
||||
if (m_ignoreSlots) return;
|
||||
|
||||
QFont resFont(fontNameEditor()->currentFont());
|
||||
resFont.setPointSize(value.toInt());
|
||||
|
||||
if (reportEditor()) reportEditor()->setFont(resFont);
|
||||
if (page()) page()->setFont(resFont);
|
||||
m_resFont = fontNameEditor()->currentFont();
|
||||
m_resFont.setPointSize(value.toInt());
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor()) reportEditor()->setFont(resFont);
|
||||
//#endif
|
||||
// if (page()) page()->setFont(resFont);
|
||||
}
|
||||
|
||||
void FontEditorWidget::slotFontAttribsChanged(bool)
|
||||
{
|
||||
if (m_ignoreSlots) return;
|
||||
|
||||
QFont resFont(m_fontNameEditor->currentFont());
|
||||
resFont.setBold(m_fontBold->isChecked());
|
||||
resFont.setItalic(m_fontItalic->isChecked());
|
||||
resFont.setUnderline(m_fontUnderline->isChecked());
|
||||
if (reportEditor()) reportEditor()->setFont(resFont);
|
||||
if (page()) page()->setFont(resFont);
|
||||
m_resFont = m_fontNameEditor->currentFont();
|
||||
m_resFont.setBold(m_fontBold->isChecked());
|
||||
m_resFont.setItalic(m_fontItalic->isChecked());
|
||||
m_resFont.setUnderline(m_fontUnderline->isChecked());
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor()) reportEditor()->setFont(resFont);
|
||||
//#endif
|
||||
// if (page()) page()->setFont(resFont);
|
||||
|
||||
}
|
||||
|
||||
@@ -159,4 +177,49 @@ void FontEditorWidget::slotPropertyChanged(const QString &objectName, const QStr
|
||||
}
|
||||
|
||||
|
||||
void FontEditorWidgetForPage::slotFontChanged(const QFont& font)
|
||||
{
|
||||
m_page->setFont(font);
|
||||
}
|
||||
|
||||
void FontEditorWidgetForPage::slotFontSizeChanged(const QString& value)
|
||||
{
|
||||
FontEditorWidget::slotFontSizeChanged(value);
|
||||
m_page->setFont(resFont());
|
||||
}
|
||||
|
||||
void FontEditorWidgetForPage::slotFontAttribsChanged(bool value)
|
||||
{
|
||||
FontEditorWidget::slotFontAttribsChanged(value);
|
||||
m_page->setFont(resFont());
|
||||
}
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
void FontEditorWidgetForDesigner::initEditor()
|
||||
{
|
||||
FontEditorWidget::initEditor();
|
||||
connect(m_reportEditor,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
}
|
||||
|
||||
void FontEditorWidgetForDesigner::slotFontChanged(const QFont& font)
|
||||
{
|
||||
if (!ignoreSlots()) m_reportEditor->setFont(font);
|
||||
}
|
||||
|
||||
void FontEditorWidgetForDesigner::slotFontSizeChanged(const QString& value)
|
||||
{
|
||||
FontEditorWidget::slotFontSizeChanged(value);
|
||||
m_reportEditor->setFont(resFont());
|
||||
}
|
||||
|
||||
void FontEditorWidgetForDesigner::slotFontAttribsChanged(bool value)
|
||||
{
|
||||
FontEditorWidget::slotFontAttribsChanged(value);
|
||||
m_reportEditor->setFont(resFont());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} //namespace LimeReport
|
||||
|
@@ -35,7 +35,10 @@
|
||||
#include <QStringListModel>
|
||||
#include <QAction>
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#include "lrreportdesignwidget.h"
|
||||
#endif
|
||||
|
||||
#include "lritemeditorwidget.h"
|
||||
|
||||
namespace LimeReport{
|
||||
@@ -43,20 +46,27 @@ namespace LimeReport{
|
||||
class FontEditorWidget :public ItemEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FontEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
explicit FontEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
explicit FontEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
|
||||
explicit FontEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
|
||||
explicit FontEditorWidget(const QString &title, QWidget *parent = 0);
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// explicit FontEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
// explicit FontEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
//#endif
|
||||
// explicit FontEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
|
||||
// explicit FontEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
|
||||
bool ignoreSlots() const;
|
||||
protected:
|
||||
void setItemEvent(BaseDesignIntf *item);
|
||||
QFontComboBox* fontNameEditor(){return m_fontNameEditor;}
|
||||
private slots:
|
||||
void slotFontChanged(const QFont& font);
|
||||
void slotFontSizeChanged(const QString& value);
|
||||
void slotFontAttribsChanged(bool);
|
||||
virtual void initEditor();
|
||||
protected slots:
|
||||
virtual void slotFontChanged(const QFont& font);
|
||||
virtual void slotFontSizeChanged(const QString& value);
|
||||
virtual void slotFontAttribsChanged(bool);
|
||||
void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
|
||||
protected:
|
||||
QFont resFont(){return m_resFont;}
|
||||
private:
|
||||
void initEditor();
|
||||
|
||||
void updateValues(const QFont &font);
|
||||
|
||||
QFontComboBox* m_fontNameEditor;
|
||||
@@ -68,9 +78,41 @@ private:
|
||||
QAction* m_fontUnderline;
|
||||
|
||||
bool m_ignoreSlots;
|
||||
QFont m_resFont;
|
||||
|
||||
};
|
||||
|
||||
class FontEditorWidgetForPage : public FontEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FontEditorWidgetForPage(PageDesignIntf* page, const QString &title, QWidget *parent = 0)
|
||||
: FontEditorWidget(title, parent), m_page(page){}
|
||||
protected slots:
|
||||
virtual void slotFontChanged(const QFont& font);
|
||||
virtual void slotFontSizeChanged(const QString& value);
|
||||
virtual void slotFontAttribsChanged(bool value);
|
||||
private:
|
||||
PageDesignIntf* m_page;
|
||||
};
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
class FontEditorWidgetForDesigner : public FontEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FontEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0)
|
||||
: FontEditorWidget(title, parent), m_reportEditor(reportEditor){}
|
||||
|
||||
protected:
|
||||
void initEditor();
|
||||
protected slots:
|
||||
virtual void slotFontChanged(const QFont& font);
|
||||
virtual void slotFontSizeChanged(const QString& value);
|
||||
virtual void slotFontAttribsChanged(bool value);
|
||||
private:
|
||||
ReportDesignWidget* m_reportEditor;
|
||||
};
|
||||
#endif
|
||||
|
||||
} //namespace LimeReport
|
||||
|
||||
#endif // LRFONTEDITORWIDGET_H
|
||||
|
@@ -31,25 +31,35 @@
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
|
||||
:QToolBar(title,parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
|
||||
{
|
||||
}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
//ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
|
||||
// :QToolBar(title,parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
|
||||
//{
|
||||
//}
|
||||
|
||||
ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
|
||||
:QToolBar(parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
|
||||
{
|
||||
}
|
||||
//ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
|
||||
// :QToolBar(parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
|
||||
//{
|
||||
//}
|
||||
//#endif
|
||||
|
||||
ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
|
||||
:QToolBar(title,parent), m_reportEditor(0), m_item(0), m_page(page)
|
||||
{
|
||||
}
|
||||
//ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
|
||||
// :QToolBar(title,parent),
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// m_reportEditor(0),
|
||||
//#endif
|
||||
// m_item(0), m_page(page)
|
||||
//{
|
||||
//}
|
||||
|
||||
ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, QWidget* parent)
|
||||
:QToolBar(parent), m_reportEditor(0), m_item(0), m_page(page)
|
||||
{
|
||||
}
|
||||
//ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, QWidget* parent)
|
||||
// :QToolBar(parent),
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// m_reportEditor(0),
|
||||
//#endif
|
||||
// m_item(0), m_page(page)
|
||||
//{
|
||||
//}
|
||||
|
||||
void ItemEditorWidget::setItem(BaseDesignIntf* item)
|
||||
{
|
||||
|
@@ -31,7 +31,11 @@
|
||||
#define LRITEMEDITORWIDGET_H
|
||||
|
||||
#include <QToolBar>
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#include "lrreportdesignwidget.h"
|
||||
#endif
|
||||
#include "lrpagedesignintf.h"
|
||||
|
||||
namespace LimeReport {
|
||||
|
||||
@@ -39,26 +43,35 @@ class ItemEditorWidget : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ItemEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
explicit ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
explicit ItemEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
|
||||
explicit ItemEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
|
||||
|
||||
explicit ItemEditorWidget(const QString &title, QWidget *parent = 0)
|
||||
: QToolBar(title, parent), m_item(0){}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// explicit ItemEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
// explicit ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
//#endif
|
||||
// explicit ItemEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
|
||||
// explicit ItemEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
|
||||
void setItem(BaseDesignIntf *item);
|
||||
void setReportEditor(ReportDesignWidget* editor){m_reportEditor = editor;}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// void setReportEditor(ReportDesignWidget* editor){m_reportEditor = editor;}
|
||||
//#endif
|
||||
protected:
|
||||
virtual void setItemEvent(BaseDesignIntf*){}
|
||||
virtual void properyChangedEvent(const QString& propertName, const QVariant& oldValue, const QVariant& newValue);
|
||||
BaseDesignIntf* item(){return m_item;}
|
||||
ReportDesignWidget* reportEditor(){return m_reportEditor;}
|
||||
PageDesignIntf* page(){return m_page;}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// ReportDesignWidget* reportEditor(){return m_reportEditor;}
|
||||
//#endif
|
||||
// PageDesignIntf* page(){return m_page;}
|
||||
private slots:
|
||||
void slotItemDestroyed(QObject* item);
|
||||
void slotPropertyChanged(const QString& propertName, const QVariant& oldValue, const QVariant& newValue);
|
||||
private:
|
||||
ReportDesignWidget* m_reportEditor;
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// ReportDesignWidget* m_reportEditor;
|
||||
//#endif
|
||||
BaseDesignIntf* m_item;
|
||||
PageDesignIntf* m_page;
|
||||
// PageDesignIntf* m_page;
|
||||
};
|
||||
|
||||
} // namespace LimeReport
|
||||
|
@@ -31,19 +31,19 @@
|
||||
#include <QAction>
|
||||
|
||||
namespace LimeReport{
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
//ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
|
||||
// : ItemEditorWidget(reportEditor,title,parent), m_changing(false)
|
||||
//{
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
|
||||
: ItemEditorWidget(reportEditor,title,parent), m_changing(false)
|
||||
{
|
||||
initEditor();
|
||||
}
|
||||
|
||||
ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
|
||||
: ItemEditorWidget(reportEditor,parent), m_changing(false)
|
||||
{
|
||||
initEditor();
|
||||
}
|
||||
|
||||
//ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
|
||||
// : ItemEditorWidget(reportEditor,parent), m_changing(false)
|
||||
//{
|
||||
// initEditor();
|
||||
//}
|
||||
//#endif
|
||||
void ItemsBordersEditorWidget::setItemEvent(BaseDesignIntf* item)
|
||||
{
|
||||
QVariant borders=item->property("borders");
|
||||
@@ -65,8 +65,10 @@ void ItemsBordersEditorWidget::properyChangedEvent(const QString& property, cons
|
||||
|
||||
void ItemsBordersEditorWidget::noBordesClicked()
|
||||
{
|
||||
if (reportEditor())
|
||||
reportEditor()->setBorders(0);
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor())
|
||||
// reportEditor()->setBorders(0);
|
||||
//#endif
|
||||
updateValues(0);
|
||||
}
|
||||
|
||||
@@ -78,14 +80,15 @@ void ItemsBordersEditorWidget::allBordesClicked()
|
||||
BaseDesignIntf::BottomLine;
|
||||
|
||||
updateValues((BaseDesignIntf::BorderLines)borders);
|
||||
if (reportEditor())
|
||||
reportEditor()->setBorders((BaseDesignIntf::BorderLines)borders);
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor())
|
||||
// reportEditor()->setBorders((BaseDesignIntf::BorderLines)borders);
|
||||
//#endif
|
||||
}
|
||||
|
||||
void ItemsBordersEditorWidget::buttonClicked(bool)
|
||||
{
|
||||
if (!m_changing&&reportEditor())
|
||||
reportEditor()->setBorders(createBorders());
|
||||
|
||||
}
|
||||
|
||||
void ItemsBordersEditorWidget::initEditor()
|
||||
@@ -151,4 +154,29 @@ BaseDesignIntf::BorderLines ItemsBordersEditorWidget::createBorders()
|
||||
return (BaseDesignIntf::BorderLines)borders;
|
||||
}
|
||||
|
||||
bool ItemsBordersEditorWidget::changing() const
|
||||
{
|
||||
return m_changing;
|
||||
}
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
void ItemsBordersEditorWidgetForDesigner::buttonClicked(bool)
|
||||
{
|
||||
if (!changing())
|
||||
m_reportEditor->setBorders(createBorders());
|
||||
}
|
||||
|
||||
void ItemsBordersEditorWidgetForDesigner::noBordesClicked()
|
||||
{
|
||||
m_reportEditor->setBorders(0);
|
||||
ItemsBordersEditorWidget::noBordesClicked();
|
||||
}
|
||||
|
||||
void ItemsBordersEditorWidgetForDesigner::allBordesClicked()
|
||||
{
|
||||
ItemsBordersEditorWidget::allBordesClicked();
|
||||
m_reportEditor->setBorders(createBorders());
|
||||
}
|
||||
#endif
|
||||
|
||||
} //namespace LimeReport
|
||||
|
@@ -36,23 +36,32 @@
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
|
||||
|
||||
class ItemsBordersEditorWidget : public ItemEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
private slots:
|
||||
void noBordesClicked();
|
||||
void allBordesClicked();
|
||||
void buttonClicked(bool);
|
||||
explicit ItemsBordersEditorWidget(const QString &title, QWidget *parent = 0)
|
||||
: ItemEditorWidget(title, parent), m_changing(false), m_borders(0){
|
||||
initEditor();
|
||||
}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
// explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
//#endif
|
||||
bool changing() const;
|
||||
protected slots:
|
||||
virtual void noBordesClicked();
|
||||
virtual void allBordesClicked();
|
||||
virtual void buttonClicked(bool);
|
||||
protected:
|
||||
void setItemEvent(BaseDesignIntf *item);
|
||||
void properyChangedEvent(const QString &property, const QVariant &oldValue, const QVariant &newValue);
|
||||
BaseDesignIntf::BorderLines createBorders();
|
||||
private:
|
||||
void initEditor();
|
||||
void updateValues(BaseDesignIntf::BorderLines borders);
|
||||
BaseDesignIntf::BorderLines createBorders();
|
||||
QAction* m_noLines;
|
||||
QAction* m_leftLine;
|
||||
QAction* m_rightLine;
|
||||
@@ -60,8 +69,25 @@ private:
|
||||
QAction* m_bottomLine;
|
||||
QAction* m_allLines;
|
||||
bool m_changing;
|
||||
int m_borders;
|
||||
};
|
||||
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
class ItemsBordersEditorWidgetForDesigner : public ItemsBordersEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ItemsBordersEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title="", QWidget *parent = 0)
|
||||
: ItemsBordersEditorWidget(title,parent), m_reportEditor(reportEditor){}
|
||||
protected slots:
|
||||
void buttonClicked(bool);
|
||||
void noBordesClicked();
|
||||
void allBordesClicked();
|
||||
private:
|
||||
ReportDesignWidget* m_reportEditor;
|
||||
};
|
||||
#endif
|
||||
|
||||
}//namespace LimeReport
|
||||
|
||||
#endif // LRITEMSBORDERSEDITORWIDGET_H
|
||||
|
@@ -30,30 +30,36 @@
|
||||
#include "lrtextalignmenteditorwidget.h"
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
|
||||
:ItemEditorWidget(reportEditor,title,parent), m_textAttibutesIsChanging(false)
|
||||
TextAlignmentEditorWidget::TextAlignmentEditorWidget(const QString& title, QWidget* parent)
|
||||
:ItemEditorWidget(title, parent), m_textAttibutesIsChanging(false), m_flag(0)
|
||||
{
|
||||
initEditor();
|
||||
}
|
||||
|
||||
TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
|
||||
:ItemEditorWidget(reportEditor,parent), m_textAttibutesIsChanging(false)
|
||||
{
|
||||
initEditor();
|
||||
}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
//TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
|
||||
// :ItemEditorWidget(reportEditor,title,parent), m_textAttibutesIsChanging(false)
|
||||
//{
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
|
||||
:ItemEditorWidget(page,title,parent), m_textAttibutesIsChanging(false)
|
||||
{
|
||||
initEditor();
|
||||
}
|
||||
//TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
|
||||
// :ItemEditorWidget(reportEditor,parent), m_textAttibutesIsChanging(false)
|
||||
//{
|
||||
// initEditor();
|
||||
//}
|
||||
//#endif
|
||||
//TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
|
||||
// :ItemEditorWidget(page,title,parent), m_textAttibutesIsChanging(false)
|
||||
//{
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, QWidget* parent)
|
||||
:ItemEditorWidget(page,parent), m_textAttibutesIsChanging(false)
|
||||
{
|
||||
initEditor();
|
||||
}
|
||||
//TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, QWidget* parent)
|
||||
// :ItemEditorWidget(page,parent), m_textAttibutesIsChanging(false)
|
||||
//{
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
void TextAlignmentEditorWidget::setItemEvent(BaseDesignIntf *item)
|
||||
{
|
||||
@@ -109,21 +115,22 @@ void TextAlignmentEditorWidget::initEditor()
|
||||
m_textAliginBottom->setCheckable(true);
|
||||
connect(m_textAliginBottom,SIGNAL(toggled(bool)),this,SLOT(slotTextVAttribsChanged(bool)));
|
||||
addAction(m_textAliginBottom);
|
||||
|
||||
if (reportEditor()){
|
||||
connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
}
|
||||
if (page()){
|
||||
connect(page(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
}
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor()){
|
||||
// connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
// this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
// }
|
||||
//#endif
|
||||
// if (page()){
|
||||
// connect(page(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
// this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
// }
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
void TextAlignmentEditorWidget::updateValues(const Qt::Alignment &align)
|
||||
{
|
||||
m_textAttibutesIsChanging=true;
|
||||
m_textAttibutesIsChanging=true;
|
||||
m_textAliginLeft->setChecked((align & Qt::AlignLeft)==Qt::AlignLeft);
|
||||
m_textAliginRight->setChecked((align & Qt::AlignRight)==Qt::AlignRight);
|
||||
m_textAliginHCenter->setChecked((align & Qt::AlignHCenter)==Qt::AlignHCenter);
|
||||
@@ -157,17 +164,18 @@ void TextAlignmentEditorWidget::slotTextHAttribsChanged(bool)
|
||||
m_textAliginRight->setChecked(sender()==m_textAliginRight);
|
||||
m_textAliginJustify->setChecked(sender()==m_textAliginJustify);
|
||||
|
||||
int flag = 0;
|
||||
if (sender()==m_textAliginLeft) flag |= Qt::AlignLeft;
|
||||
if (sender()==m_textAliginHCenter) flag |= Qt::AlignHCenter;
|
||||
if (sender()==m_textAliginRight) flag |= Qt::AlignRight;
|
||||
if (sender()==m_textAliginJustify) flag |= Qt::AlignJustify;
|
||||
|
||||
if (reportEditor()) reportEditor()->setTextAlign(true,Qt::AlignmentFlag(flag));
|
||||
if (page()) {
|
||||
//page()->setTextAlign(createAlignment());
|
||||
page()->changeSelectedGrpoupTextAlignPropperty(true,Qt::AlignmentFlag(flag));
|
||||
}
|
||||
m_flag = 0;
|
||||
if (sender()==m_textAliginLeft) m_flag |= Qt::AlignLeft;
|
||||
if (sender()==m_textAliginHCenter) m_flag |= Qt::AlignHCenter;
|
||||
if (sender()==m_textAliginRight) m_flag |= Qt::AlignRight;
|
||||
if (sender()==m_textAliginJustify) m_flag |= Qt::AlignJustify;
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor()) reportEditor()->setTextAlign(true,Qt::AlignmentFlag(flag));
|
||||
//#endif
|
||||
// if (page()) {
|
||||
// //page()->setTextAlign(createAlignment());
|
||||
// page()->changeSelectedGrpoupTextAlignPropperty(true,Qt::AlignmentFlag(flag));
|
||||
// }
|
||||
m_textAttibutesIsChanging = false;
|
||||
}
|
||||
|
||||
@@ -180,13 +188,14 @@ void TextAlignmentEditorWidget::slotTextVAttribsChanged(bool)
|
||||
m_textAliginVCenter->setChecked(sender()==m_textAliginVCenter);
|
||||
m_textAliginBottom->setChecked(sender()==m_textAliginBottom);
|
||||
|
||||
int flag = 0;
|
||||
if (sender()==m_textAliginTop) flag |= Qt::AlignTop;
|
||||
if (sender()==m_textAliginVCenter) flag |= Qt::AlignVCenter;
|
||||
if (sender()==m_textAliginBottom) flag |= Qt::AlignBottom;
|
||||
|
||||
if (reportEditor()) reportEditor()->setTextAlign(false,Qt::AlignmentFlag(flag));
|
||||
if (page()) page()->changeSelectedGrpoupTextAlignPropperty(false,Qt::AlignmentFlag(flag) );
|
||||
m_flag = 0;
|
||||
if (sender()==m_textAliginTop) m_flag |= Qt::AlignTop;
|
||||
if (sender()==m_textAliginVCenter) m_flag |= Qt::AlignVCenter;
|
||||
if (sender()==m_textAliginBottom) m_flag |= Qt::AlignBottom;
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor()) reportEditor()->setTextAlign(false,Qt::AlignmentFlag(flag));
|
||||
//#endif
|
||||
// if (page()) page()->changeSelectedGrpoupTextAlignPropperty(false,Qt::AlignmentFlag(flag) );
|
||||
m_textAttibutesIsChanging = false;
|
||||
}
|
||||
|
||||
@@ -200,5 +209,63 @@ void TextAlignmentEditorWidget::slotPropertyChanged(const QString &objectName, c
|
||||
}
|
||||
}
|
||||
|
||||
int TextAlignmentEditorWidget::flag() const
|
||||
{
|
||||
return m_flag;
|
||||
}
|
||||
|
||||
void TextAlignmentEditorWidgetForPage::initEditor()
|
||||
{
|
||||
TextAlignmentEditorWidget::initEditor();
|
||||
connect(m_page,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
}
|
||||
|
||||
void TextAlignmentEditorWidgetForPage::slotTextHAttribsChanged(bool value)
|
||||
{
|
||||
|
||||
TextAlignmentEditorWidget::slotTextHAttribsChanged(value);
|
||||
if (m_textAttibutesIsChanging) return;
|
||||
m_textAttibutesIsChanging = true;
|
||||
m_page->changeSelectedGrpoupTextAlignPropperty(true,Qt::AlignmentFlag(flag()));
|
||||
m_textAttibutesIsChanging = false;
|
||||
}
|
||||
|
||||
void TextAlignmentEditorWidgetForPage::slotTextVAttribsChanged(bool value)
|
||||
{
|
||||
TextAlignmentEditorWidget::slotTextVAttribsChanged(value);
|
||||
if (m_textAttibutesIsChanging) return;
|
||||
m_textAttibutesIsChanging = true;
|
||||
m_page->changeSelectedGrpoupTextAlignPropperty(false,Qt::AlignmentFlag(flag()) );
|
||||
m_textAttibutesIsChanging = false;
|
||||
}
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
void TextAlignmentEditorWidgetForDesigner::initEditor()
|
||||
{
|
||||
TextAlignmentEditorWidget::initEditor();
|
||||
connect(m_reportEditor,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
|
||||
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
|
||||
|
||||
}
|
||||
|
||||
void TextAlignmentEditorWidgetForDesigner::slotTextHAttribsChanged(bool value)
|
||||
{
|
||||
TextAlignmentEditorWidget::slotTextHAttribsChanged(value);
|
||||
if (m_textAttibutesIsChanging) return;
|
||||
m_textAttibutesIsChanging = true;
|
||||
m_reportEditor->setTextAlign(true,Qt::AlignmentFlag(flag()));
|
||||
m_textAttibutesIsChanging = false;
|
||||
}
|
||||
|
||||
void TextAlignmentEditorWidgetForDesigner::slotTextVAttribsChanged(bool value)
|
||||
{
|
||||
TextAlignmentEditorWidget::slotTextVAttribsChanged(value);
|
||||
if (m_textAttibutesIsChanging) return;
|
||||
m_textAttibutesIsChanging = true;
|
||||
m_reportEditor->setTextAlign(false,Qt::AlignmentFlag(flag()));
|
||||
m_textAttibutesIsChanging = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
} //namespace LimeReport
|
||||
|
@@ -41,23 +41,26 @@ class TextAlignmentEditorWidget:public ItemEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
explicit TextAlignmentEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
|
||||
explicit TextAlignmentEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
|
||||
explicit TextAlignmentEditorWidget(const QString &title, QWidget *parent = 0);
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
|
||||
// explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
|
||||
//#endif
|
||||
// explicit TextAlignmentEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
|
||||
// explicit TextAlignmentEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
|
||||
int flag() const;
|
||||
protected:
|
||||
void setItemEvent(BaseDesignIntf *item);
|
||||
virtual void initEditor();
|
||||
bool m_textAttibutesIsChanging;
|
||||
private:
|
||||
void initEditor();
|
||||
void updateValues(const Qt::Alignment& align);
|
||||
Qt::Alignment createAlignment();
|
||||
private slots:
|
||||
void slotTextHAttribsChanged(bool);
|
||||
void slotTextVAttribsChanged(bool);
|
||||
void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
|
||||
protected slots:
|
||||
virtual void slotTextHAttribsChanged(bool);
|
||||
virtual void slotTextVAttribsChanged(bool);
|
||||
virtual void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
|
||||
private:
|
||||
bool m_textAttibutesIsChanging;
|
||||
|
||||
QAction* m_textAliginLeft;
|
||||
QAction* m_textAliginRight;
|
||||
QAction* m_textAliginHCenter;
|
||||
@@ -66,8 +69,40 @@ private:
|
||||
QAction* m_textAliginBottom;
|
||||
QAction* m_textAliginVCenter;
|
||||
|
||||
int m_flag;
|
||||
|
||||
};
|
||||
|
||||
class TextAlignmentEditorWidgetForPage: public TextAlignmentEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TextAlignmentEditorWidgetForPage(PageDesignIntf* page, const QString &title, QWidget *parent = 0)
|
||||
:TextAlignmentEditorWidget(title, parent), m_page(page){}
|
||||
protected:
|
||||
void initEditor();
|
||||
protected slots:
|
||||
void slotTextHAttribsChanged(bool value);
|
||||
void slotTextVAttribsChanged(bool value);
|
||||
private:
|
||||
PageDesignIntf* m_page;
|
||||
};
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
class TextAlignmentEditorWidgetForDesigner: public TextAlignmentEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TextAlignmentEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0)
|
||||
:TextAlignmentEditorWidget(title, parent), m_reportEditor(reportEditor){}
|
||||
protected:
|
||||
void initEditor();
|
||||
protected slots:
|
||||
void slotTextHAttribsChanged(bool value);
|
||||
void slotTextVAttribsChanged(bool value);
|
||||
private:
|
||||
ReportDesignWidget* m_reportEditor;
|
||||
};
|
||||
#endif
|
||||
|
||||
} //namespace LimeReport
|
||||
|
||||
#endif // LRTEXTALIGNMENTEDITORWIDGET_H
|
||||
|
@@ -1,8 +1,8 @@
|
||||
include(../common.pri)
|
||||
|
||||
contains(CONFIG,dialogdesigner){
|
||||
include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
|
||||
}
|
||||
#contains(CONFIG,dialogdesigner){
|
||||
# include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
|
||||
#}
|
||||
|
||||
DEFINES += INSPECT_BASEDESIGN
|
||||
|
||||
@@ -11,9 +11,10 @@ INCLUDEPATH += \
|
||||
$$REPORT_PATH/items \
|
||||
$$REPORT_PATH/bands \
|
||||
$$REPORT_PATH/base \
|
||||
$$REPORT_PATH/objectinspector \
|
||||
$$REPORT_PATH/databrowser \
|
||||
# $$REPORT_PATH/objectinspector \
|
||||
# $$REPORT_PATH/databrowser \
|
||||
$$REPORT_PATH/scripteditor
|
||||
# $$REPORT_PATH/../designer_plugin
|
||||
|
||||
SOURCES += \
|
||||
$$REPORT_PATH/bands/lrpageheader.cpp \
|
||||
@@ -24,59 +25,59 @@ SOURCES += \
|
||||
$$REPORT_PATH/bands/lrgroupbands.cpp \
|
||||
$$REPORT_PATH/bands/lrsubdetailband.cpp \
|
||||
$$REPORT_PATH/bands/lrtearoffband.cpp \
|
||||
$$REPORT_PATH/databrowser/lrdatabrowser.cpp \
|
||||
$$REPORT_PATH/databrowser/lrsqleditdialog.cpp \
|
||||
$$REPORT_PATH/databrowser/lrconnectiondialog.cpp \
|
||||
$$REPORT_PATH/databrowser/lrvariabledialog.cpp \
|
||||
$$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \
|
||||
# $$REPORT_PATH/databrowser/lrdatabrowser.cpp \
|
||||
# $$REPORT_PATH/databrowser/lrsqleditdialog.cpp \
|
||||
# $$REPORT_PATH/databrowser/lrconnectiondialog.cpp \
|
||||
# $$REPORT_PATH/databrowser/lrvariabledialog.cpp \
|
||||
# $$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \
|
||||
$$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
|
||||
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
|
||||
$$REPORT_PATH/serializators/lrxmlreader.cpp \
|
||||
$$REPORT_PATH/serializators/lrxmlwriter.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.cpp \
|
||||
$$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.cpp \
|
||||
$$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.cpp \
|
||||
$$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.cpp \
|
||||
$$REPORT_PATH/objectinspector/editors/lrfonteditor.cpp \
|
||||
$$REPORT_PATH/objectinspector/editors/lrimageeditor.cpp \
|
||||
$$REPORT_PATH/objectinspector/editors/lrcoloreditor.cpp \
|
||||
$$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.cpp \
|
||||
$$REPORT_PATH/objectinspector/lrobjectinspectorwidget.cpp \
|
||||
$$REPORT_PATH/objectinspector/lrobjectitemmodel.cpp \
|
||||
$$REPORT_PATH/objectinspector/lrobjectpropitem.cpp \
|
||||
$$REPORT_PATH/objectinspector/lrpropertydelegate.cpp \
|
||||
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
|
||||
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.cpp \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.cpp \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.cpp \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.cpp \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrfonteditor.cpp \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrimageeditor.cpp \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrcoloreditor.cpp \
|
||||
# $$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.cpp \
|
||||
# $$REPORT_PATH/objectinspector/lrobjectinspectorwidget.cpp \
|
||||
# $$REPORT_PATH/objectinspector/lrobjectitemmodel.cpp \
|
||||
# $$REPORT_PATH/objectinspector/lrobjectpropitem.cpp \
|
||||
# $$REPORT_PATH/objectinspector/lrpropertydelegate.cpp \
|
||||
# $$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
|
||||
# $$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \
|
||||
$$REPORT_PATH/scripteditor/lrscripteditor.cpp \
|
||||
$$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
|
||||
$$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
|
||||
$$REPORT_PATH/items/lrsubitemparentpropitem.cpp \
|
||||
$$REPORT_PATH/items/lralignpropitem.cpp \
|
||||
# $$REPORT_PATH/items/lrsubitemparentpropitem.cpp \
|
||||
# $$REPORT_PATH/items/lralignpropitem.cpp \
|
||||
$$REPORT_PATH/items/lrhorizontallayout.cpp \
|
||||
$$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
|
||||
$$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
|
||||
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
|
||||
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
|
||||
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
|
||||
# $$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
|
||||
# $$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
|
||||
$$REPORT_PATH/items/lrsimpletagparser.cpp \
|
||||
$$REPORT_PATH/items/lrimageitem.cpp \
|
||||
$$REPORT_PATH/items/lrtextitemeditor.cpp \
|
||||
$$REPORT_PATH/items/lrshapeitem.cpp \
|
||||
$$REPORT_PATH/items/lrtextitem.cpp \
|
||||
$$REPORT_PATH/translationeditor/translationeditor.cpp \
|
||||
# $$REPORT_PATH/translationeditor/translationeditor.cpp \
|
||||
$$REPORT_PATH/lrbanddesignintf.cpp \
|
||||
$$REPORT_PATH/lrpageitemdesignintf.cpp \
|
||||
$$REPORT_PATH/lrpagedesignintf.cpp \
|
||||
@@ -84,11 +85,11 @@ SOURCES += \
|
||||
$$REPORT_PATH/lrglobal.cpp \
|
||||
$$REPORT_PATH/lritemdesignintf.cpp \
|
||||
$$REPORT_PATH/lrdatadesignintf.cpp \
|
||||
$$REPORT_PATH/lrreportdesignwidget.cpp \
|
||||
# $$REPORT_PATH/lrreportdesignwidget.cpp \
|
||||
$$REPORT_PATH/lrbasedesignintf.cpp \
|
||||
$$REPORT_PATH/lrreportengine.cpp \
|
||||
$$REPORT_PATH/lrdatasourcemanager.cpp \
|
||||
$$REPORT_PATH/lrreportdesignwindow.cpp \
|
||||
# $$REPORT_PATH/lrreportdesignwindow.cpp \
|
||||
$$REPORT_PATH/lrreportrender.cpp \
|
||||
$$REPORT_PATH/lrscriptenginemanager.cpp \
|
||||
$$REPORT_PATH/lrpreviewreportwindow.cpp \
|
||||
@@ -104,7 +105,7 @@ SOURCES += \
|
||||
$$REPORT_PATH/items/lrchartitem.cpp \
|
||||
$$REPORT_PATH/items/lrchartitemeditor.cpp \
|
||||
$$REPORT_PATH/lrreporttranslation.cpp \
|
||||
$$REPORT_PATH/translationeditor/languageselectdialog.cpp
|
||||
# $$REPORT_PATH/translationeditor/languageselectdialog.cpp
|
||||
|
||||
contains(CONFIG, staticlib){
|
||||
SOURCES += $$REPORT_PATH/lrfactoryinitializer.cpp
|
||||
@@ -126,11 +127,11 @@ HEADERS += \
|
||||
$$REPORT_PATH/bands/lrtearoffband.h \
|
||||
$$REPORT_PATH/bands/lrsubdetailband.h \
|
||||
$$REPORT_PATH/bands/lrgroupbands.h \
|
||||
$$REPORT_PATH/databrowser/lrdatabrowser.h \
|
||||
$$REPORT_PATH/databrowser/lrsqleditdialog.h \
|
||||
$$REPORT_PATH/databrowser/lrconnectiondialog.h \
|
||||
$$REPORT_PATH/databrowser/lrvariabledialog.h \
|
||||
$$REPORT_PATH/databrowser/lrdatabrowsertree.h \
|
||||
# $$REPORT_PATH/databrowser/lrdatabrowser.h \
|
||||
# $$REPORT_PATH/databrowser/lrsqleditdialog.h \
|
||||
# $$REPORT_PATH/databrowser/lrconnectiondialog.h \
|
||||
# $$REPORT_PATH/databrowser/lrvariabledialog.h \
|
||||
# $$REPORT_PATH/databrowser/lrdatabrowsertree.h \
|
||||
$$REPORT_PATH/serializators/lrserializatorintf.h \
|
||||
$$REPORT_PATH/serializators/lrstorageintf.h \
|
||||
$$REPORT_PATH/serializators/lrxmlqrectserializator.h \
|
||||
@@ -138,50 +139,50 @@ HEADERS += \
|
||||
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.h \
|
||||
$$REPORT_PATH/serializators/lrxmlreader.h \
|
||||
$$REPORT_PATH/serializators/lrxmlwriter.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.h \
|
||||
$$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.h \
|
||||
$$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.h \
|
||||
$$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.h \
|
||||
$$REPORT_PATH/objectinspector/editors/lrimageeditor.h \
|
||||
$$REPORT_PATH/objectinspector/editors/lrcoloreditor.h \
|
||||
$$REPORT_PATH/objectinspector/editors/lrfonteditor.h \
|
||||
$$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.h \
|
||||
$$REPORT_PATH/objectinspector/lrobjectinspectorwidget.h \
|
||||
$$REPORT_PATH/objectinspector/lrobjectitemmodel.h \
|
||||
$$REPORT_PATH/objectinspector/lrobjectpropitem.h \
|
||||
$$REPORT_PATH/objectinspector/lrpropertydelegate.h \
|
||||
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.h \
|
||||
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.h \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.h \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.h \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.h \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrimageeditor.h \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrcoloreditor.h \
|
||||
# $$REPORT_PATH/objectinspector/editors/lrfonteditor.h \
|
||||
# $$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.h \
|
||||
# $$REPORT_PATH/objectinspector/lrobjectinspectorwidget.h \
|
||||
# $$REPORT_PATH/objectinspector/lrobjectitemmodel.h \
|
||||
# $$REPORT_PATH/objectinspector/lrobjectpropitem.h \
|
||||
# $$REPORT_PATH/objectinspector/lrpropertydelegate.h \
|
||||
# $$REPORT_PATH/objectsbrowser/lrobjectbrowser.h \
|
||||
# $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
|
||||
$$REPORT_PATH/scripteditor/lrscripteditor.h \
|
||||
$$REPORT_PATH/scripteditor/lrcodeeditor.h \
|
||||
$$REPORT_PATH/scripteditor/lrscripthighlighter.h \
|
||||
$$REPORT_PATH/items/editors/lritemeditorwidget.h \
|
||||
$$REPORT_PATH/items/editors/lrfonteditorwidget.h \
|
||||
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
|
||||
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
|
||||
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
|
||||
# $$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
|
||||
# $$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
|
||||
$$REPORT_PATH/items/lrtextitem.h \
|
||||
$$REPORT_PATH/items/lrsubitemparentpropitem.h \
|
||||
$$REPORT_PATH/items/lralignpropitem.h \
|
||||
# $$REPORT_PATH/items/lrsubitemparentpropitem.h \
|
||||
# $$REPORT_PATH/items/lralignpropitem.h \
|
||||
$$REPORT_PATH/items/lrhorizontallayout.h \
|
||||
$$REPORT_PATH/items/lrtextitemeditor.h \
|
||||
$$REPORT_PATH/items/lrshapeitem.h \
|
||||
$$REPORT_PATH/items/lrimageitem.h \
|
||||
$$REPORT_PATH/items/lrsimpletagparser.h \
|
||||
$$REPORT_PATH/translationeditor/translationeditor.h \
|
||||
# $$REPORT_PATH/translationeditor/translationeditor.h \
|
||||
$$REPORT_PATH/lrfactoryinitializer.h \
|
||||
$$REPORT_PATH/lrbanddesignintf.h \
|
||||
$$REPORT_PATH/lrpageitemdesignintf.h \
|
||||
@@ -190,10 +191,10 @@ HEADERS += \
|
||||
$$REPORT_PATH/lrdatadesignintf.h \
|
||||
$$REPORT_PATH/lrcollection.h \
|
||||
$$REPORT_PATH/lrpagedesignintf.h \
|
||||
$$REPORT_PATH/lrreportdesignwidget.h \
|
||||
# $$REPORT_PATH/lrreportdesignwidget.h \
|
||||
$$REPORT_PATH/lrreportengine_p.h \
|
||||
$$REPORT_PATH/lrdatasourcemanager.h \
|
||||
$$REPORT_PATH/lrreportdesignwindow.h \
|
||||
# $$REPORT_PATH/lrreportdesignwindow.h \
|
||||
$$REPORT_PATH/lrreportrender.h \
|
||||
$$REPORT_PATH/lrpreviewreportwindow.h \
|
||||
$$REPORT_PATH/lrpreviewreportwidget.h \
|
||||
@@ -216,9 +217,9 @@ HEADERS += \
|
||||
$$REPORT_PATH/lritemscontainerdesignitf.h \
|
||||
$$REPORT_PATH/lrcolorindicator.h \
|
||||
$$REPORT_PATH/items/lrchartitem.h \
|
||||
$$REPORT_PATH/items/lrchartitemeditor.h \
|
||||
$$REPORT_PATH/lrreporttranslation.h \
|
||||
$$REPORT_PATH/translationeditor/languageselectdialog.h
|
||||
$$REPORT_PATH/items/lrchartitemeditor.h
|
||||
# $$REPORT_PATH/lrreporttranslation.h \
|
||||
# $$REPORT_PATH/translationeditor/languageselectdialog.h
|
||||
|
||||
contains(CONFIG, staticlib){
|
||||
HEADERS += $$REPORT_PATH/lrfactoryinitializer.h
|
||||
@@ -229,26 +230,26 @@ contains(CONFIG,zint){
|
||||
}
|
||||
|
||||
FORMS += \
|
||||
$$REPORT_PATH/databrowser/lrsqleditdialog.ui \
|
||||
$$REPORT_PATH/databrowser/lrconnectiondialog.ui \
|
||||
$$REPORT_PATH/databrowser/lrdatabrowser.ui \
|
||||
$$REPORT_PATH/databrowser/lrvariabledialog.ui \
|
||||
$$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
|
||||
# $$REPORT_PATH/databrowser/lrsqleditdialog.ui \
|
||||
# $$REPORT_PATH/databrowser/lrconnectiondialog.ui \
|
||||
# $$REPORT_PATH/databrowser/lrdatabrowser.ui \
|
||||
# $$REPORT_PATH/databrowser/lrvariabledialog.ui \
|
||||
# $$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
|
||||
$$REPORT_PATH/lrpreviewreportwindow.ui \
|
||||
$$REPORT_PATH/lrpreviewreportwidget.ui \
|
||||
$$REPORT_PATH/items/lrtextitemeditor.ui \
|
||||
$$REPORT_PATH/lraboutdialog.ui \
|
||||
$$REPORT_PATH/lrsettingdialog.ui \
|
||||
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
|
||||
# $$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
|
||||
$$REPORT_PATH/items/lrchartitemeditor.ui \
|
||||
$$REPORT_PATH/translationeditor/translationeditor.ui \
|
||||
$$REPORT_PATH/translationeditor/languageselectdialog.ui \
|
||||
# $$REPORT_PATH/translationeditor/translationeditor.ui \
|
||||
# $$REPORT_PATH/translationeditor/languageselectdialog.ui \
|
||||
$$REPORT_PATH/scripteditor/lrscripteditor.ui
|
||||
|
||||
RESOURCES += \
|
||||
$$REPORT_PATH/objectinspector/lobjectinspector.qrc \
|
||||
$$REPORT_PATH/databrowser/lrdatabrowser.qrc \
|
||||
# $$REPORT_PATH/objectinspector/lobjectinspector.qrc \
|
||||
# $$REPORT_PATH/databrowser/lrdatabrowser.qrc \
|
||||
$$REPORT_PATH/report.qrc \
|
||||
$$REPORT_PATH/items/items.qrc \
|
||||
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.qrc \
|
||||
$$REPORT_PATH/translationeditor/translationeditor.qrc
|
||||
$$REPORT_PATH/items/items.qrc
|
||||
# $$REPORT_PATH/scriptbrowser/lrscriptbrowser.qrc \
|
||||
# $$REPORT_PATH/translationeditor/translationeditor.qrc
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#define LRDESIGNELEMENTSFACTORY_H
|
||||
|
||||
#include "lrbanddesignintf.h"
|
||||
#include "lrpageheader.h"
|
||||
//#include "lrpageheader.h"
|
||||
#include "lrattribsabstractfactory.h"
|
||||
#include "lrsimpleabstractfactory.h"
|
||||
#include "lrsingleton.h"
|
||||
|
30
limereport/lrdesignerplugininterface.h
Normal file
30
limereport/lrdesignerplugininterface.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef LRDESIGNERPLUGININTERFACE_H
|
||||
#define LRDESIGNERPLUGININTERFACE_H
|
||||
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
#include <QtPlugin>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QSettings;
|
||||
class QMainWindow;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace LimeReport {
|
||||
class ReportDesignWindow;
|
||||
class ReportEnginePrivateInterface;
|
||||
}
|
||||
|
||||
class LimeReportPluginInterface {
|
||||
public:
|
||||
virtual ~LimeReportPluginInterface() { }
|
||||
|
||||
virtual QString getString() const = 0;
|
||||
virtual QVariant getVar() const = 0;
|
||||
virtual QMainWindow* getDesignerWindow(LimeReport::ReportEnginePrivateInterface* report, QWidget *parent = 0, QSettings* settings=0) = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE( LimeReportPluginInterface, "ru.limereport.LimeReport.DesignerPluginInterface/1.0" )
|
||||
|
||||
#endif // LRDESIGNERPLUGININTERFACE_H
|
@@ -66,10 +66,10 @@ PreviewReportWindow::PreviewReportWindow(ReportEngine *report, QWidget *parent,
|
||||
connect(m_previewReportWidget->d_ptr->m_previewPage,SIGNAL(selectionChanged()),this,SLOT(slotSelectionChanged()));
|
||||
connect(m_pagesNavigator,SIGNAL(valueChanged(int)),this,SLOT(slotPageNavigatorChanged(int)));
|
||||
|
||||
m_fontEditor = new FontEditorWidget(m_previewReportWidget->d_ptr->m_previewPage,tr("Font"),this);
|
||||
m_fontEditor = new FontEditorWidgetForPage(m_previewReportWidget->d_ptr->m_previewPage,tr("Font"),this);
|
||||
m_fontEditor->setObjectName("fontTools");
|
||||
m_fontEditor->setIconSize(ui->toolBar->iconSize());
|
||||
m_textAlignmentEditor = new TextAlignmentEditorWidget(m_previewReportWidget->d_ptr->m_previewPage,tr("Text align"),this);
|
||||
m_textAlignmentEditor = new TextAlignmentEditorWidgetForPage(m_previewReportWidget->d_ptr->m_previewPage,tr("Text align"),this);
|
||||
m_textAlignmentEditor->setObjectName("textAlignmentTools");
|
||||
m_textAlignmentEditor->setIconSize(ui->toolBar->iconSize());
|
||||
addToolBar(Qt::TopToolBarArea,m_fontEditor);
|
||||
|
@@ -51,7 +51,7 @@ namespace LimeReport {
|
||||
|
||||
// ReportDesignIntf
|
||||
|
||||
ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWindow, QWidget *parent) :
|
||||
ReportDesignWidget::ReportDesignWidget(ReportEnginePrivateInterface* report, QMainWindow *mainWindow, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||
m_dialogDesignerManager(new DialogDesignerManager(this)),
|
||||
@@ -72,20 +72,20 @@ ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWi
|
||||
mainLayout->addWidget(m_tabWidget);
|
||||
setLayout(mainLayout);
|
||||
|
||||
if (!report) {
|
||||
m_report=new ReportEnginePrivate(this);
|
||||
m_report->setObjectName("report");
|
||||
m_report->appendPage("page1");
|
||||
}
|
||||
else {
|
||||
m_report=report->d_ptr;
|
||||
// if (!report) {
|
||||
// m_report=new ReportEnginePrivate(this);
|
||||
// m_report->setObjectName("report");
|
||||
// m_report->appendPage("page1");
|
||||
// }
|
||||
// else {
|
||||
m_report=report;//report->d_ptr;
|
||||
if (!m_report->pageCount()) m_report->appendPage("page1");
|
||||
}
|
||||
// }
|
||||
|
||||
createTabs();
|
||||
|
||||
connect(m_report,SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
|
||||
connect(m_report,SIGNAL(cleared()),this,SIGNAL(cleared()));
|
||||
connect(dynamic_cast<QObject*>(m_report), SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
|
||||
connect(dynamic_cast<QObject*>(m_report), SIGNAL(cleared()),this,SIGNAL(cleared()));
|
||||
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int)));
|
||||
#ifdef HAVE_UI_LOADER
|
||||
connect(m_report->scriptContext(), SIGNAL(dialogDeleted(QString)), this, SLOT(slotDialogDeleted(QString)));
|
||||
@@ -241,9 +241,11 @@ void ReportDesignWidget::createTabs(){
|
||||
view->setFrameShape(QFrame::NoFrame);
|
||||
view->setScene(m_report->pageAt(i));
|
||||
|
||||
foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
|
||||
item->setSelected(false);
|
||||
}
|
||||
// foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
|
||||
// item->setSelected(false);
|
||||
// }
|
||||
|
||||
m_report->pageAt(i)->clearSelection();
|
||||
|
||||
view->centerOn(0,0);
|
||||
view->scale(0.5,0.5);
|
||||
@@ -796,7 +798,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
|
||||
QGraphicsView* view = dynamic_cast<QGraphicsView*>(m_tabWidget->widget(index));
|
||||
if (view) {
|
||||
if (view->scene()){
|
||||
foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
|
||||
//foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
|
||||
view->scene()->clearSelection();
|
||||
}
|
||||
m_zoomer->setView(view);
|
||||
}
|
||||
@@ -807,7 +810,7 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
|
||||
updateDialogs();
|
||||
#endif
|
||||
if (activeTabType() == Translations){
|
||||
m_traslationEditor->setReportEngine(report());
|
||||
m_traslationEditor->setReportEngine(dynamic_cast<ITranslationContainer*>(report()));
|
||||
}
|
||||
|
||||
if (activeTabType() == Script){
|
||||
@@ -816,6 +819,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
|
||||
}
|
||||
|
||||
emit activePageChanged();
|
||||
|
||||
if (view) view->centerOn(0,0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||
|
@@ -84,7 +84,7 @@ public:
|
||||
Translations,
|
||||
TabTypeCount
|
||||
};
|
||||
ReportDesignWidget(ReportEngine* report, QMainWindow *mainWindow, QWidget *parent = 0);
|
||||
ReportDesignWidget(ReportEnginePrivateInterface* report, QMainWindow *mainWindow, QWidget *parent = 0);
|
||||
~ReportDesignWidget();
|
||||
void createStartPage();
|
||||
void clear();
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
QList<QGraphicsItem *> selectedItems();
|
||||
QStringList datasourcesNames();
|
||||
void scale( qreal sx, qreal sy);
|
||||
ReportEnginePrivate* report(){return m_report;}
|
||||
ReportEnginePrivateInterface* report(){return m_report;}
|
||||
QString reportFileName();
|
||||
bool isNeedToSave();
|
||||
bool emitLoadReport();
|
||||
@@ -200,7 +200,7 @@ protected:
|
||||
private:
|
||||
bool eventFilter(QObject *target, QEvent *event);
|
||||
private:
|
||||
ReportEnginePrivate* m_report;
|
||||
ReportEnginePrivateInterface* m_report;
|
||||
QGraphicsView *m_view;
|
||||
ScriptEditor* m_scriptEditor;
|
||||
TranslationEditor* m_traslationEditor;
|
||||
|
@@ -62,7 +62,7 @@ namespace LimeReport{
|
||||
|
||||
ReportDesignWindow* ReportDesignWindow::m_instance=0;
|
||||
|
||||
ReportDesignWindow::ReportDesignWindow(ReportEngine *report, QWidget *parent, QSettings* settings) :
|
||||
ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWidget *parent, QSettings* settings) :
|
||||
QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
|
||||
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page), m_reportItemIsLocked(false)
|
||||
{
|
||||
@@ -309,11 +309,11 @@ void ReportDesignWindow::createToolBars()
|
||||
|
||||
//m_mainToolBar->addAction(m_printReportAction);
|
||||
|
||||
m_fontEditorBar = new FontEditorWidget(m_reportDesignWidget,tr("Font"),this);
|
||||
m_fontEditorBar = new FontEditorWidgetForDesigner(m_reportDesignWidget,tr("Font"),this);
|
||||
m_fontEditorBar->setIconSize(m_mainToolBar->iconSize());
|
||||
m_fontEditorBar->setObjectName("fontTools");
|
||||
addToolBar(m_fontEditorBar);
|
||||
m_textAlignmentEditorBar = new TextAlignmentEditorWidget(m_reportDesignWidget,tr("Text alignment"),this);
|
||||
m_textAlignmentEditorBar = new TextAlignmentEditorWidgetForDesigner(m_reportDesignWidget,tr("Text alignment"),this);
|
||||
m_textAlignmentEditorBar->setIconSize(m_mainToolBar->iconSize());
|
||||
m_textAlignmentEditorBar->setObjectName("textAlignmentTools");
|
||||
addToolBar(m_textAlignmentEditorBar);
|
||||
@@ -324,7 +324,7 @@ void ReportDesignWindow::createToolBars()
|
||||
m_itemsAlignmentEditorBar->insertAction(m_itemsAlignmentEditorBar->actions().at(1),m_useMagnetAction);
|
||||
m_itemsAlignmentEditorBar->insertSeparator(m_itemsAlignmentEditorBar->actions().at(2));
|
||||
addToolBar(m_itemsAlignmentEditorBar);
|
||||
m_itemsBordersEditorBar = new ItemsBordersEditorWidget(m_reportDesignWidget,tr("Borders"),this);
|
||||
m_itemsBordersEditorBar = new ItemsBordersEditorWidgetForDesigner(m_reportDesignWidget,tr("Borders"),this);
|
||||
m_itemsBordersEditorBar->setIconSize(m_mainToolBar->iconSize());
|
||||
m_itemsBordersEditorBar->setObjectName("itemsBorderTools");
|
||||
addToolBar(m_itemsBordersEditorBar);
|
||||
@@ -459,7 +459,7 @@ void ReportDesignWindow::createMainMenu()
|
||||
m_recentFilesMenu->setDisabled(m_recentFiles.isEmpty());
|
||||
}
|
||||
|
||||
void ReportDesignWindow::initReportEditor(ReportEngine* report)
|
||||
void ReportDesignWindow::initReportEditor(ReportEnginePrivateInterface* report)
|
||||
{
|
||||
m_reportDesignWidget=new ReportDesignWidget(report,this,this);
|
||||
setCentralWidget(m_reportDesignWidget);
|
||||
@@ -472,16 +472,16 @@ void ReportDesignWindow::initReportEditor(ReportEngine* report)
|
||||
connect(m_reportDesignWidget,SIGNAL(itemInserted(LimeReport::PageDesignIntf*,QPointF,QString)),
|
||||
this,SLOT(slotItemInserted(LimeReport::PageDesignIntf*,QPointF,QString)));
|
||||
connect(m_reportDesignWidget,SIGNAL(itemInsertCanceled(QString)),this,SLOT(slotItemInsertCanceled(QString)));
|
||||
connect(m_reportDesignWidget->report(),SIGNAL(datasourceCollectionLoadFinished(QString)),this,SLOT(slotUpdateDataBrowser(QString)));
|
||||
connect(dynamic_cast<QObject*>(report), SIGNAL(datasourceCollectionLoadFinished(QString)),this,SLOT(slotUpdateDataBrowser(QString)));
|
||||
connect(m_reportDesignWidget,SIGNAL(commandHistoryChanged()),this,SLOT(slotCommandHistoryChanged()));
|
||||
connect(m_reportDesignWidget,SIGNAL(activePageChanged()),this,SLOT(slotActivePageChanged()));
|
||||
connect(m_reportDesignWidget, SIGNAL(bandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
|
||||
this, SLOT(slotBandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
||||
connect(m_reportDesignWidget, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
|
||||
this, SLOT(slotBandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
||||
connect(m_reportDesignWidget->report(), SIGNAL(renderStarted()), this, SLOT(renderStarted()));
|
||||
connect(m_reportDesignWidget->report(), SIGNAL(renderPageFinished(int)), this, SLOT(renderPageFinished(int)));
|
||||
connect(m_reportDesignWidget->report(), SIGNAL(renderFinished()), this, SLOT(renderFinished()));
|
||||
connect(dynamic_cast<QObject*>(report), SIGNAL(renderStarted()), this, SLOT(renderStarted()));
|
||||
connect(dynamic_cast<QObject*>(report), SIGNAL(renderPageFinished(int)), this, SLOT(renderPageFinished(int)));
|
||||
connect(dynamic_cast<QObject*>(report), SIGNAL(renderFinished()), this, SLOT(renderFinished()));
|
||||
connect(m_reportDesignWidget, SIGNAL(pageAdded(PageDesignIntf*)), this, SLOT(slotPageAdded(PageDesignIntf*)));
|
||||
connect(m_reportDesignWidget, SIGNAL(pageDeleted()), this, SLOT(slotPageDeleted()));
|
||||
}
|
||||
@@ -1311,7 +1311,7 @@ void ReportDesignWindow::renderStarted()
|
||||
{
|
||||
if (m_showProgressDialog){
|
||||
m_progressDialog = new QProgressDialog(tr("Rendering report"),tr("Abort"),0,0,this);
|
||||
m_progressDialog->open(m_reportDesignWidget->report(),SLOT(cancelRender()));
|
||||
m_progressDialog->open(dynamic_cast<QObject*>(m_reportDesignWidget->report()), SLOT(cancelRender()));
|
||||
QApplication::processEvents();
|
||||
}
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ class ReportDesignWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ReportDesignWindow(ReportEngine *report, QWidget *parent = 0, QSettings* settings=0);
|
||||
explicit ReportDesignWindow(ReportEnginePrivateInterface *report, QWidget *parent = 0, QSettings* settings=0);
|
||||
~ReportDesignWindow();
|
||||
static ReportDesignWindow* instance(){return m_instance;}
|
||||
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
void createItemsActions();
|
||||
void createObjectInspector();
|
||||
void createObjectsBrowser();
|
||||
void initReportEditor(ReportEngine *report);
|
||||
void initReportEditor(ReportEnginePrivateInterface* report);
|
||||
void createDataWindow();
|
||||
void createScriptWindow();
|
||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QPluginLoader>
|
||||
|
||||
#include "time.h"
|
||||
|
||||
@@ -42,8 +43,9 @@
|
||||
|
||||
#include "lrpagedesignintf.h"
|
||||
#include "lrdatasourcemanager.h"
|
||||
#include "lrdatabrowser.h"
|
||||
#include "lrreportdesignwindow.h"
|
||||
//#include "lrdatabrowser.h"
|
||||
//#include "lrreportdesignwindow.h"
|
||||
|
||||
|
||||
#include "serializators/lrxmlwriter.h"
|
||||
#include "serializators/lrxmlreader.h"
|
||||
@@ -51,6 +53,8 @@
|
||||
#include "lrpreviewreportwindow.h"
|
||||
#include "lrpreviewreportwidget.h"
|
||||
#include "lrpreviewreportwidget_p.h"
|
||||
|
||||
|
||||
#ifdef HAVE_STATIC_BUILD
|
||||
#include "lrfactoryinitializer.h"
|
||||
#endif
|
||||
@@ -64,7 +68,7 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
|
||||
m_showProgressDialog(true), m_reportName(""), m_activePreview(0),
|
||||
m_previewWindowIcon(":/report/images/logo32"), m_previewWindowTitle(tr("Preview")),
|
||||
m_reportRendering(false), m_resultIsEditable(true), m_passPhrase("HjccbzHjlbyfCkjy"),
|
||||
m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage)
|
||||
m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage), m_designerFactory(0)
|
||||
{
|
||||
#ifdef HAVE_STATIC_BUILD
|
||||
initResources();
|
||||
@@ -83,6 +87,29 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
|
||||
m_datasources->setObjectName("datasources");
|
||||
connect(m_datasources,SIGNAL(loadCollectionFinished(QString)),this,SLOT(slotDataSourceCollectionLoaded(QString)));
|
||||
connect(m_fileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(slotLoadFromFile(const QString &)));
|
||||
|
||||
QDir pluginsDir( "../lib" );
|
||||
foreach( const QString& pluginName, pluginsDir.entryList( QDir::Files ) ) {
|
||||
qDebug() << "===============================================================================";
|
||||
qDebug() << "Found:" << pluginName;
|
||||
|
||||
QPluginLoader loader( pluginsDir.absoluteFilePath( pluginName ) );
|
||||
if( loader.load() ) {
|
||||
if( LimeReportPluginInterface* myPlugin = qobject_cast< LimeReportPluginInterface* >( loader.instance() ) ) {
|
||||
qDebug() << "Testing: \n" <<
|
||||
"(1)" << myPlugin->getString() << "\n" <<
|
||||
"(2)" << myPlugin->getVar();
|
||||
m_designerFactory = myPlugin;
|
||||
}
|
||||
//loader.unload();
|
||||
} else {
|
||||
qDebug() << "Failed to load :(";
|
||||
qDebug() << loader.errorString();
|
||||
}
|
||||
|
||||
qDebug() << "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ReportEnginePrivate::~ReportEnginePrivate()
|
||||
@@ -619,21 +646,32 @@ PageDesignIntf* ReportEngine::createPreviewScene(QObject* parent){
|
||||
void ReportEnginePrivate::designReport()
|
||||
{
|
||||
if (!m_designerWindow) {
|
||||
Q_Q(ReportEngine);
|
||||
m_designerWindow = new LimeReport::ReportDesignWindow(q,QApplication::activeWindow(),settings());
|
||||
m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
|
||||
m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
|
||||
m_designerWindow->setShowProgressDialog(m_showProgressDialog);
|
||||
// Q_Q(ReportEngine);
|
||||
if (m_designerFactory){
|
||||
settings()->beginGroup("DesignerWindow");
|
||||
settings()->setValue("showProgressDialog",m_showProgressDialog);
|
||||
settings()->endGroup();
|
||||
m_designerWindow = m_designerFactory->getDesignerWindow(this,QApplication::activeWindow(),settings());
|
||||
//m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
|
||||
//m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
|
||||
//m_designerWindow->setShowProgressDialog(m_showProgressDialog);
|
||||
} else {
|
||||
//m_designerWindow = new LimeReport::ReportDesignWindow(this,QApplication::activeWindow(),settings());
|
||||
//m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
|
||||
//m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
|
||||
//m_designerWindow->setShowProgressDialog(m_showProgressDialog);
|
||||
}
|
||||
}
|
||||
m_datasources->updateDatasourceModel();
|
||||
#ifdef Q_OS_WIN
|
||||
m_designerWindow->setWindowModality(Qt::ApplicationModal);
|
||||
#endif
|
||||
if (QApplication::activeWindow()==0){
|
||||
m_designerWindow->show();;
|
||||
} else {
|
||||
m_designerWindow->showModal();
|
||||
}
|
||||
// if (QApplication::activeWindow()==0){
|
||||
// m_designerWindow->show();;
|
||||
// } else {
|
||||
// m_designerWindow->showModal();
|
||||
// }
|
||||
m_designerWindow->show();
|
||||
}
|
||||
|
||||
void ReportEnginePrivate::setSettings(QSettings* value)
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "serializators/lrstorageintf.h"
|
||||
#include "lrscriptenginemanager.h"
|
||||
#include "lrreporttranslation.h"
|
||||
#include "lrdesignerplugininterface.h"
|
||||
|
||||
class QFileSystemWatcher;
|
||||
|
||||
@@ -53,7 +54,40 @@ class ReportDesignWindow;
|
||||
|
||||
//TODO: Add on render callback
|
||||
|
||||
class ReportEnginePrivate : public QObject, public ICollectionContainer, public ITranslationContainer
|
||||
class ReportEnginePrivateInterface {
|
||||
public:
|
||||
virtual PageDesignIntf* appendPage(const QString& pageName="") = 0;
|
||||
virtual bool deletePage(PageDesignIntf *page) = 0;
|
||||
virtual void reorderPages(const QList<PageDesignIntf *> &reorderedPages) = 0;
|
||||
virtual int pageCount() = 0;
|
||||
virtual PageDesignIntf* pageAt(int index) = 0;
|
||||
virtual void clearReport() = 0;
|
||||
virtual ScriptEngineContext* scriptContext() = 0;
|
||||
virtual ScriptEngineManager* scriptManager() = 0;
|
||||
virtual DataSourceManager* dataManager() = 0;
|
||||
virtual QString reportFileName() = 0;
|
||||
virtual void setReportFileName(const QString& reportFileName) = 0;
|
||||
virtual void emitSaveFinished() = 0;
|
||||
virtual bool isNeedToSave() = 0;
|
||||
virtual void emitSaveReport() = 0;
|
||||
virtual bool saveToFile() = 0;
|
||||
virtual bool saveToFile(const QString& fileName) = 0;
|
||||
virtual bool isSaved() = 0;
|
||||
virtual QString reportName() = 0;
|
||||
virtual bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange) = 0;
|
||||
virtual bool emitLoadReport() = 0;
|
||||
virtual void clearSelection() = 0;
|
||||
virtual bool printReport(QPrinter *printer=0) = 0;
|
||||
virtual void previewReport(PreviewHints hints = PreviewBarsUserSetting) = 0;
|
||||
virtual void setCurrentReportsDir(const QString& dirName) = 0;
|
||||
virtual QString currentReportsDir() = 0;
|
||||
virtual bool suppressFieldAndVarError() const = 0;
|
||||
virtual void setSuppressFieldAndVarError(bool suppressFieldAndVarError) = 0;
|
||||
|
||||
};
|
||||
|
||||
class ReportEnginePrivate : public QObject, public ICollectionContainer, public ITranslationContainer,
|
||||
public ReportEnginePrivateInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PUBLIC(ReportEngine)
|
||||
@@ -195,7 +229,7 @@ private:
|
||||
QMainWindow* m_activePreview;
|
||||
QIcon m_previewWindowIcon;
|
||||
QString m_previewWindowTitle;
|
||||
QPointer<ReportDesignWindow> m_designerWindow;
|
||||
QPointer<QMainWindow> m_designerWindow;
|
||||
ReportSettings m_reportSettings;
|
||||
bool m_reportRendering;
|
||||
bool m_resultIsEditable;
|
||||
@@ -205,6 +239,7 @@ private:
|
||||
QLocale::Language m_reportLanguage;
|
||||
void activateLanguage(QLocale::Language language);
|
||||
Qt::LayoutDirection m_previewLayoutDirection;
|
||||
LimeReportPluginInterface* m_designerFactory;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ void ScriptEditor::initEditor(DataSourceManager* dm)
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditor::setReportEngine(ReportEnginePrivate* reportEngine)
|
||||
void ScriptEditor::setReportEngine(ReportEnginePrivateInterface* reportEngine)
|
||||
{
|
||||
m_reportEngine = reportEngine;
|
||||
DataSourceManager* dm = m_reportEngine->dataManager();
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
class ReportEnginePrivate;
|
||||
class ReportEnginePrivateInterface;
|
||||
class BaseDesignIntf;
|
||||
class PageDesignIntf;
|
||||
class BandDesignIntf;
|
||||
@@ -25,7 +25,7 @@ class ScriptEditor : public QWidget
|
||||
public:
|
||||
explicit ScriptEditor(QWidget *parent = 0);
|
||||
~ScriptEditor();
|
||||
void setReportEngine(ReportEnginePrivate* reportEngine);
|
||||
void setReportEngine(LimeReport::ReportEnginePrivateInterface* reportEngine);
|
||||
void setReportPage(PageDesignIntf* page);
|
||||
void setPageBand(BandDesignIntf* band);
|
||||
void initCompleter();
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
void addItemToCompleater(const QString& pageName, BaseDesignIntf* item, QStringList& dataWords);
|
||||
private:
|
||||
Ui::ScriptEditor *ui;
|
||||
ReportEnginePrivate* m_reportEngine;
|
||||
ReportEnginePrivateInterface* m_reportEngine;
|
||||
PageDesignIntf* m_page;
|
||||
QCompleter* m_completer;
|
||||
|
||||
|
Reference in New Issue
Block a user