Border editor little bit refactored

This commit is contained in:
Alexander Arin
2022-11-01 11:48:47 +03:00
64 changed files with 31582 additions and 1742 deletions

View File

@@ -3,13 +3,15 @@
#include <QDialog>
#include "lrbasedesignintf.h"
namespace LimeReport{
namespace Ui {
class BorderEditor;
class BorderEditor;
}
class BorderEditor : public QDialog
class LIMEREPORT_EXPORT BorderEditor : public QDialog
{
Q_OBJECT

View File

@@ -31,7 +31,7 @@
<string>No lines</string>
</property>
<property name="icon">
<iconset resource="../report.qrc">
<iconset>
<normaloff>:/report/images/noLines</normaloff>:/report/images/noLines</iconset>
</property>
<property name="checkable">
@@ -51,7 +51,7 @@
<string>Outline</string>
</property>
<property name="icon">
<iconset resource="../report.qrc">
<iconset>
<normaloff>:/report/images/allLines</normaloff>:/report/images/allLines</iconset>
</property>
<property name="toolButtonStyle">
@@ -81,7 +81,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../report.qrc">
<iconset>
<normaloff>:/report/images/topLine</normaloff>:/report/images/topLine</iconset>
</property>
<property name="checkable">
@@ -108,7 +108,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../report.qrc">
<iconset>
<normaloff>:/report/images/bottomLine</normaloff>:/report/images/bottomLine</iconset>
</property>
<property name="checkable">
@@ -129,7 +129,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../report.qrc">
<iconset>
<normaloff>:/report/images/leftLine</normaloff>:/report/images/leftLine</iconset>
</property>
<property name="checkable">
@@ -156,7 +156,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../report.qrc">
<iconset>
<normaloff>:/report/images/rightLine</normaloff>:/report/images/rightLine</iconset>
</property>
<property name="checkable">
@@ -364,14 +364,11 @@
<customwidget>
<class>LimeReport::BorderFrameEditor</class>
<extends>QWidget</extends>
<header>borderframeeditor.h</header>
<header>lrborderframeeditor.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../report.qrc"/>
<include location="../report.qrc"/>
</resources>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>

View File

@@ -5,9 +5,11 @@
#include <QPushButton>
#include <QPageSize>
namespace LimeReport{
PageEditor::PageEditor(QWidget *parent, LimeReport::PageItemDesignIntf *page) :
QDialog(parent),
ui(new Ui::lrpageeditor)
ui(new Ui::PageEditor)
{
ui->setupUi(this);
m_page = page;
@@ -59,7 +61,7 @@ void PageEditor::applyChanges()
QSizeF PageEditor::getRectByPageSize(const LimeReport::PageItemDesignIntf::PageSize& size)
{
if (size != LimeReport::PageItemDesignIntf::Custom) {
if (size != PageItemDesignIntf::Custom) {
QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 1))
@@ -78,6 +80,7 @@ QSizeF PageEditor::getRectByPageSize(const LimeReport::PageItemDesignIntf::PageS
return QSizeF(m_page->getItemWidth(), m_page->getItemHeight());
}
}
void PageEditor::on_format_currentIndexChanged(int index)
{
QPageSize ps = *new QPageSize();
@@ -102,6 +105,6 @@ void PageEditor::on_buttonBox_clicked(QAbstractButton *button)
accept();
}
}
} // namespace

View File

@@ -4,11 +4,13 @@
#include <QDialog>
#include "lrpageitemdesignintf.h"
#include <QPushButton>
namespace LimeReport{
namespace Ui {
class lrpageeditor;
class PageEditor;
}
class PageEditor : public QDialog
class LIMEREPORT_EXPORT PageEditor : public QDialog
{
Q_OBJECT
@@ -22,11 +24,13 @@ private slots:
void on_buttonBox_clicked(QAbstractButton *button);
private:
Ui::lrpageeditor *ui;
Ui::PageEditor *ui;
LimeReport::PageItemDesignIntf* m_page;
void applyChanges();
QSizeF getRectByPageSize(const LimeReport::PageItemDesignIntf::PageSize& size);
};
} // namespace LimeReport
#endif // LRPAGEEDITOR_H

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>lrpageeditor</class>
<widget class="QDialog" name="lrpageeditor">
<class>LimeReport::PageEditor</class>
<widget class="QDialog" name="LimeReport::PageEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>306</width>
<height>350</height>
<height>356</height>
</rect>
</property>
<property name="windowTitle">
@@ -131,6 +131,19 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
@@ -305,22 +318,6 @@
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>lrpageeditor</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>296</x>
<y>340</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>endlessHeight</sender>
<signal>clicked(bool)</signal>

View File

@@ -49,7 +49,7 @@ class ReportEnginePrivate;
class PageDesignIntf;
class BaseDesignIntf;
class Marker : public QGraphicsItem{
class LIMEREPORT_EXPORT Marker : public QGraphicsItem{
public:
Marker(QGraphicsItem* parent = 0, BaseDesignIntf* owner = 0): QGraphicsItem(parent), m_owner(owner){}
QRectF boundingRect() const;
@@ -65,7 +65,7 @@ private:
BaseDesignIntf* m_owner;
};
class SelectionMarker : public Marker{
class LIMEREPORT_EXPORT SelectionMarker : public Marker{
public:
SelectionMarker(QGraphicsItem* parent=0, BaseDesignIntf* owner = 0);
QColor color() const;
@@ -80,7 +80,7 @@ protected:
class DataSourceManager;
class ReportRender;
class BaseDesignIntf :
class LIMEREPORT_EXPORT BaseDesignIntf :
public QObject, public QGraphicsItem, public ICollectionContainer, public ObjectLoadingStateIntf {
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
@@ -515,7 +515,7 @@ signals:
void afterRender();
};
class BookmarkContainerDesignIntf: public BaseDesignIntf{
class LIMEREPORT_EXPORT BookmarkContainerDesignIntf: public BaseDesignIntf{
Q_OBJECT
public:
BookmarkContainerDesignIntf(const QString& storageTypeName, QObject* owner = 0, QGraphicsItem* parent = 0)

View File

@@ -35,7 +35,7 @@
#include "lrglobal.h"
class ACollectionProperty{
class LIMEREPORT_EXPORT ACollectionProperty{
public:
ACollectionProperty(){}
ACollectionProperty(const ACollectionProperty& ){}
@@ -45,8 +45,8 @@ Q_DECLARE_METATYPE(ACollectionProperty)
namespace LimeReport{
const int COLLECTION_TYPE_ID = qMetaTypeId<ACollectionProperty>();
class ICollectionContainer{
const int inline COLLECTION_TYPE_ID = qMetaTypeId<ACollectionProperty>();
class LIMEREPORT_EXPORT ICollectionContainer{
public:
virtual QObject* createElement(const QString& collectionName,const QString& elementType)=0;
virtual int elementsCount(const QString& collectionName)=0;

View File

@@ -125,12 +125,12 @@ namespace Const{
Q_DECLARE_FLAGS(PreviewHints, PreviewHint)
Q_FLAGS(PreviewHints)
class ReportError : public std::runtime_error{
class LIMEREPORT_EXPORT ReportError : public std::runtime_error{
public:
ReportError(const QString& message);
};
class ReportSettings{
class LIMEREPORT_EXPORT ReportSettings{
public:
ReportSettings():m_suppressAbsentFieldsAndVarsWarnings(false){}
void setDefaultValues(){m_suppressAbsentFieldsAndVarsWarnings = false;}
@@ -140,13 +140,13 @@ namespace Const{
bool m_suppressAbsentFieldsAndVarsWarnings;
};
class IExternalPainter{
class LIMEREPORT_EXPORT IExternalPainter{
public:
virtual void paintByExternalPainter(const QString& objectName, QPainter* painter, const QStyleOptionGraphicsItem* options) = 0;
virtual ~IExternalPainter();
};
class IPainterProxy{
class LIMEREPORT_EXPORT IPainterProxy{
public:
virtual void setExternalPainter(IExternalPainter* externalPainter) = 0;
virtual ~IPainterProxy();
@@ -168,7 +168,7 @@ namespace Const{
#endif
class Enums
class LIMEREPORT_EXPORT Enums
{
public:
enum VariableDataType {Undefined, String, Bool, Int, Real, Date, Time, DateTime};

View File

@@ -5,7 +5,7 @@
namespace LimeReport{
class Segment{
class LIMEREPORT_EXPORT Segment{
public:
Segment(qreal segmentStart,qreal segmentEnd):m_begin(segmentStart),m_end(segmentEnd){}
bool intersect(Segment value);
@@ -15,17 +15,17 @@ private:
qreal m_end;
};
class VSegment : public Segment{
class LIMEREPORT_EXPORT VSegment : public Segment{
public:
VSegment(QRectF rect):Segment(rect.top(),rect.bottom()){}
};
struct HSegment :public Segment{
struct LIMEREPORT_EXPORT HSegment :public Segment{
public:
HSegment(QRectF rect):Segment(rect.left(),rect.right()){}
};
struct ItemSortContainer {
struct LIMEREPORT_EXPORT ItemSortContainer {
QRectF m_rect;
BaseDesignIntf * m_item;
ItemSortContainer(BaseDesignIntf *item){
@@ -35,9 +35,9 @@ struct ItemSortContainer {
};
typedef QSharedPointer< ItemSortContainer > PItemSortContainer;
bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2);
bool LIMEREPORT_EXPORT itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2);
class ItemsContainerDesignInft : public BookmarkContainerDesignIntf{
class LIMEREPORT_EXPORT ItemsContainerDesignInft : public BookmarkContainerDesignIntf{
Q_OBJECT
public:
ItemsContainerDesignInft(const QString& xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0):

View File

@@ -39,7 +39,7 @@
namespace LimeReport{
class ReportRender;
class PageItemDesignIntf : public ItemsContainerDesignInft
class LIMEREPORT_EXPORT PageItemDesignIntf : public ItemsContainerDesignInft
{
Q_OBJECT
Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin)

View File

@@ -30,6 +30,7 @@
#ifndef LRSTORAGEINTF_H
#define LRSTORAGEINTF_H
#include "lrglobal.h"
#include <QSharedPointer>
class QString;
@@ -37,14 +38,14 @@ class QObject;
namespace LimeReport{
class ObjectLoadingStateIntf{
class LIMEREPORT_EXPORT ObjectLoadingStateIntf{
public:
virtual bool isLoading() = 0;
virtual void objectLoadStarted() = 0;
virtual void objectLoadFinished() = 0;
};
class ItemsWriterIntf
class LIMEREPORT_EXPORT ItemsWriterIntf
{
public:
virtual void putItem(QObject* item) = 0;
@@ -55,7 +56,7 @@ public:
virtual ~ItemsWriterIntf(){}
};
class ItemsReaderIntf
class LIMEREPORT_EXPORT ItemsReaderIntf
{
public:
typedef QSharedPointer<ItemsReaderIntf> Ptr;