mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-23 08:29:07 +03:00
plugin finished
This commit is contained in:
@@ -31,28 +31,6 @@
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
//#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();
|
||||
//}
|
||||
//#endif
|
||||
|
||||
//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){
|
||||
// initEditor();
|
||||
//}
|
||||
|
||||
FontEditorWidget::FontEditorWidget(const QString& title, QWidget* parent)
|
||||
:ItemEditorWidget(title, parent), m_ignoreSlots(false)
|
||||
{
|
||||
@@ -109,13 +87,6 @@ void FontEditorWidget::initEditor()
|
||||
connect(m_fontUnderline,SIGNAL(toggled(bool)),this,SLOT(slotFontAttribsChanged(bool)));
|
||||
addAction(m_fontUnderline);
|
||||
|
||||
//#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)
|
||||
@@ -135,7 +106,7 @@ bool FontEditorWidget::ignoreSlots() const
|
||||
}
|
||||
|
||||
|
||||
void FontEditorWidget::slotFontChanged(const QFont &font)
|
||||
void FontEditorWidget::slotFontChanged(const QFont /*&font*/)
|
||||
{
|
||||
// if (page()) page()->setFont(font);
|
||||
}
|
||||
@@ -143,28 +114,17 @@ void FontEditorWidget::slotFontChanged(const QFont &font)
|
||||
void FontEditorWidget::slotFontSizeChanged(const QString &value)
|
||||
{
|
||||
if (m_ignoreSlots) return;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
void FontEditorWidget::slotPropertyChanged(const QString &objectName, const QString &property, const QVariant& oldValue, const QVariant& newValue)
|
||||
@@ -194,7 +154,7 @@ void FontEditorWidgetForPage::slotFontAttribsChanged(bool value)
|
||||
m_page->setFont(resFont());
|
||||
}
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
void FontEditorWidgetForDesigner::initEditor()
|
||||
{
|
||||
FontEditorWidget::initEditor();
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include <QStringListModel>
|
||||
#include <QAction>
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
#include "lrreportdesignwidget.h"
|
||||
#endif
|
||||
|
||||
@@ -47,19 +47,13 @@ class FontEditorWidget :public ItemEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
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;}
|
||||
virtual void initEditor();
|
||||
protected slots:
|
||||
virtual void slotFontChanged(const QFont& font);
|
||||
virtual void slotFontChanged(const QFont);
|
||||
virtual void slotFontSizeChanged(const QString& value);
|
||||
virtual void slotFontAttribsChanged(bool);
|
||||
void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
|
||||
@@ -95,7 +89,7 @@ private:
|
||||
PageDesignIntf* m_page;
|
||||
};
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
class FontEditorWidgetForDesigner : public FontEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@@ -31,36 +31,6 @@
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
//#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)
|
||||
//{
|
||||
//}
|
||||
//#endif
|
||||
|
||||
//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),
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// m_reportEditor(0),
|
||||
//#endif
|
||||
// m_item(0), m_page(page)
|
||||
//{
|
||||
//}
|
||||
|
||||
void ItemEditorWidget::setItem(BaseDesignIntf* item)
|
||||
{
|
||||
if (m_item!=item){
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include <QToolBar>
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
#include "lrreportdesignwidget.h"
|
||||
#endif
|
||||
#include "lrpagedesignintf.h"
|
||||
@@ -45,33 +45,16 @@ class ItemEditorWidget : public QToolBar
|
||||
public:
|
||||
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);
|
||||
//#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;}
|
||||
//#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:
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// ReportDesignWidget* m_reportEditor;
|
||||
//#endif
|
||||
BaseDesignIntf* m_item;
|
||||
// PageDesignIntf* m_page;
|
||||
};
|
||||
|
||||
} // namespace LimeReport
|
||||
|
@@ -31,19 +31,7 @@
|
||||
#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, QWidget* parent)
|
||||
// : ItemEditorWidget(reportEditor,parent), m_changing(false)
|
||||
//{
|
||||
// initEditor();
|
||||
//}
|
||||
//#endif
|
||||
void ItemsBordersEditorWidget::setItemEvent(BaseDesignIntf* item)
|
||||
{
|
||||
QVariant borders=item->property("borders");
|
||||
@@ -65,10 +53,6 @@ void ItemsBordersEditorWidget::properyChangedEvent(const QString& property, cons
|
||||
|
||||
void ItemsBordersEditorWidget::noBordesClicked()
|
||||
{
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor())
|
||||
// reportEditor()->setBorders(0);
|
||||
//#endif
|
||||
updateValues(0);
|
||||
}
|
||||
|
||||
@@ -80,10 +64,6 @@ void ItemsBordersEditorWidget::allBordesClicked()
|
||||
BaseDesignIntf::BottomLine;
|
||||
|
||||
updateValues((BaseDesignIntf::BorderLines)borders);
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
// if (reportEditor())
|
||||
// reportEditor()->setBorders((BaseDesignIntf::BorderLines)borders);
|
||||
//#endif
|
||||
}
|
||||
|
||||
void ItemsBordersEditorWidget::buttonClicked(bool)
|
||||
@@ -159,7 +139,7 @@ bool ItemsBordersEditorWidget::changing() const
|
||||
return m_changing;
|
||||
}
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
void ItemsBordersEditorWidgetForDesigner::buttonClicked(bool)
|
||||
{
|
||||
if (!changing())
|
||||
|
@@ -36,8 +36,6 @@
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
|
||||
|
||||
class ItemsBordersEditorWidget : public ItemEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -46,10 +44,6 @@ public:
|
||||
: 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();
|
||||
@@ -72,8 +66,7 @@ private:
|
||||
int m_borders;
|
||||
};
|
||||
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
class ItemsBordersEditorWidgetForDesigner : public ItemsBordersEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@@ -36,31 +36,6 @@ TextAlignmentEditorWidget::TextAlignmentEditorWidget(const QString& title, QWidg
|
||||
initEditor();
|
||||
}
|
||||
|
||||
//#ifdef IS_REPORT_DESIGNER
|
||||
//TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
|
||||
// :ItemEditorWidget(reportEditor,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();
|
||||
//}
|
||||
|
||||
void TextAlignmentEditorWidget::setItemEvent(BaseDesignIntf *item)
|
||||
{
|
||||
QVariant align=item->property("alignment");
|
||||
@@ -115,16 +90,6 @@ void TextAlignmentEditorWidget::initEditor()
|
||||
m_textAliginBottom->setCheckable(true);
|
||||
connect(m_textAliginBottom,SIGNAL(toggled(bool)),this,SLOT(slotTextVAttribsChanged(bool)));
|
||||
addAction(m_textAliginBottom);
|
||||
//#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);
|
||||
}
|
||||
|
||||
@@ -169,13 +134,6 @@ void TextAlignmentEditorWidget::slotTextHAttribsChanged(bool)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -192,10 +150,6 @@ void TextAlignmentEditorWidget::slotTextVAttribsChanged(bool)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -240,7 +194,7 @@ void TextAlignmentEditorWidgetForPage::slotTextVAttribsChanged(bool value)
|
||||
m_textAttibutesIsChanging = false;
|
||||
}
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
void TextAlignmentEditorWidgetForDesigner::initEditor()
|
||||
{
|
||||
TextAlignmentEditorWidget::initEditor();
|
||||
|
@@ -42,12 +42,6 @@ class TextAlignmentEditorWidget:public ItemEditorWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
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);
|
||||
@@ -68,9 +62,7 @@ private:
|
||||
QAction* m_textAliginTop;
|
||||
QAction* m_textAliginBottom;
|
||||
QAction* m_textAliginVCenter;
|
||||
|
||||
int m_flag;
|
||||
|
||||
};
|
||||
|
||||
class TextAlignmentEditorWidgetForPage: public TextAlignmentEditorWidget{
|
||||
@@ -87,7 +79,7 @@ private:
|
||||
PageDesignIntf* m_page;
|
||||
};
|
||||
|
||||
#ifdef IS_REPORT_DESIGNER
|
||||
#ifdef HAVE_REPORT_DESIGNER
|
||||
class TextAlignmentEditorWidgetForDesigner: public TextAlignmentEditorWidget{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
Reference in New Issue
Block a user