mirror of
https://github.com/fralx/LimeReport.git
synced 2025-10-01 03:29:49 +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
|
||||
|
Reference in New Issue
Block a user