[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kreport] src: Move remaining memebers of KReportDesignerItemRectBase to dptr
From: Adam Pigg <null () kde ! org>
Date: 2017-09-04 20:20:12
Message-ID: E1doxqu-0007mz-Nq () code ! kde ! org
[Download RAW message or body]
Git commit 084f43295a9d64c5b7db6dd00dcf9c3f8a993120 by Adam Pigg.
Committed on 04/09/2017 at 20:20.
Pushed by piggz into branch 'master'.
Move remaining memebers of KReportDesignerItemRectBase to dptr
Summary: Add dptr to KReportAsyncItemBase
Test Plan: It builds
Reviewers: staniek
Reviewed By: staniek
Tags: #kreport
Maniphest Tasks: T6773
Differential Revision: https://phabricator.kde.org/D7638
M +16 -0 src/common/KReportAsyncItemBase.cpp
M +6 -0 src/common/KReportAsyncItemBase.h
M +59 -47 src/common/KReportDocument.cpp
M +2 -26 src/common/KReportDocument.h
M +1 -1 src/plugins/barcode/KReportDesignerItemBarcode.cpp
M +45 -45 src/renderer/KReportPreRenderer.cpp
M +12 -5 src/wrtembed/KReportDesignerItemRectBase.cpp
M +3 -2 src/wrtembed/KReportDesignerItemRectBase.h
https://commits.kde.org/kreport/084f43295a9d64c5b7db6dd00dcf9c3f8a993120
diff --git a/src/common/KReportAsyncItemBase.cpp \
b/src/common/KReportAsyncItemBase.cpp index c5e5cfb..fb16b47 100644
--- a/src/common/KReportAsyncItemBase.cpp
+++ b/src/common/KReportAsyncItemBase.cpp
@@ -19,6 +19,22 @@
#include "KReportAsyncItemBase.h"
+class Q_DECL_HIDDEN KReportAsyncItemBase::Private
+{
+public:
+ bool dummy = true;
+};
+
+KReportAsyncItemBase::KReportAsyncItemBase() : d(new Private)
+{
+}
+
+KReportAsyncItemBase::~KReportAsyncItemBase()
+{
+ delete d;
+}
+
+
QVariant KReportAsyncItemBase::realItemData(const QVariant& itemData) const
{
return itemData;
diff --git a/src/common/KReportAsyncItemBase.h b/src/common/KReportAsyncItemBase.h
index 10c775f..c0450b4 100644
--- a/src/common/KReportAsyncItemBase.h
+++ b/src/common/KReportAsyncItemBase.h
@@ -26,11 +26,17 @@ class KREPORT_EXPORT KReportAsyncItemBase : public \
KReportItemBase {
Q_OBJECT
public:
+ KReportAsyncItemBase();
+ ~KReportAsyncItemBase();
int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, \
const QVariant &data, KReportScriptHandler *script) override = 0; virtual QVariant \
realItemData(const QVariant& itemData) const;
Q_SIGNALS:
void finishedRendering();
+
+private:
+ class Private;
+ Private * const d;
};
#endif // KREPORTASYNCITEMBASE_H
diff --git a/src/common/KReportDocument.cpp b/src/common/KReportDocument.cpp
index aa22362..cc99d47 100644
--- a/src/common/KReportDocument.cpp
+++ b/src/common/KReportDocument.cpp
@@ -41,32 +41,38 @@ public:
KReportPrivate::PageLayout pageLayout;
QString pageSize;
QString labelType;
+
+ KReportSectionData * pageHeaderFirst = nullptr;
+ KReportSectionData * pageHeaderOdd = nullptr;
+ KReportSectionData * pageHeaderEven = nullptr;
+ KReportSectionData * pageHeaderLast = nullptr;
+ KReportSectionData * pageHeaderAny = nullptr;
+
+ KReportSectionData * reportHeader = nullptr;
+ KReportSectionData * reportFooter = nullptr;
+
+ KReportSectionData * pageFooterFirst = nullptr;
+ KReportSectionData * pageFooterOdd = nullptr;
+ KReportSectionData * pageFooterEven = nullptr;
+ KReportSectionData * pageFooterLast = nullptr;
+ KReportSectionData * pageFooterAny = nullptr;
+
+ KReportDetailSectionData* detailSection = nullptr;
};
-void KReportDocument::init()
-{
- m_pageHeaderFirst = m_pageHeaderOdd = m_pageHeaderEven = m_pageHeaderLast = \
m_pageHeaderAny = nullptr;
- m_pageFooterFirst = m_pageFooterOdd = m_pageFooterEven = m_pageFooterLast = \
m_pageFooterAny = nullptr;
- m_reportHeader = m_reportFooter = nullptr;
-}
-
KReportDocument::KReportDocument(QObject *parent)
: QObject(parent),
- m_detailSection(nullptr),
- d(new Private())
+ d(new Private)
{
- init();
d->valid = true;
}
KReportDocument::KReportDocument(const QDomElement & elemSource, QObject *parent)
: QObject(parent),
- m_detailSection(nullptr),
- d(new Private())
+ d(new Private)
{
d->valid = false;
- init();
- //kreportDebug();
+
if (elemSource.tagName() != QLatin1String("report:content")) {
kreportWarning() << "QDomElement is not <report:content> tag"
<< elemSource.text();
@@ -125,40 +131,40 @@ KReportDocument::KReportDocument(const QDomElement & \
elemSource, QObject *parent
//kreportDebug() << "Adding section of type " << \
sd->type(); switch (sd->type()) {
case KReportSectionData::Type::PageHeaderFirst:
- m_pageHeaderFirst = sd;
+ d->pageHeaderFirst = sd;
break;
case KReportSectionData::Type::PageHeaderOdd:
- m_pageHeaderOdd = sd;
+ d->pageHeaderOdd = sd;
break;
case KReportSectionData::Type::PageHeaderEven:
- m_pageHeaderEven = sd;
+ d->pageHeaderEven = sd;
break;
case KReportSectionData::Type::PageHeaderLast:
- m_pageHeaderLast = sd;
+ d->pageHeaderLast = sd;
break;
case KReportSectionData::Type::PageHeaderAny:
- m_pageHeaderAny = sd;
+ d->pageHeaderAny = sd;
break;
case KReportSectionData::Type::ReportHeader:
- m_reportHeader = sd;
+ d->reportHeader = sd;
break;
case KReportSectionData::Type::ReportFooter:
- m_reportFooter = sd;
+ d->reportFooter = sd;
break;
case KReportSectionData::Type::PageFooterFirst:
- m_pageFooterFirst = sd;
+ d->pageFooterFirst = sd;
break;
case KReportSectionData::Type::PageFooterOdd:
- m_pageFooterOdd = sd;
+ d->pageFooterOdd = sd;
break;
case KReportSectionData::Type::PageFooterEven:
- m_pageFooterEven = sd;
+ d->pageFooterEven = sd;
break;
case KReportSectionData::Type::PageFooterLast:
- m_pageFooterLast = sd;
+ d->pageFooterLast = sd;
break;
case KReportSectionData::Type::PageFooterAny:
- m_pageFooterAny = sd;
+ d->pageFooterAny = sd;
break;
default:
;
@@ -169,7 +175,7 @@ KReportDocument::KReportDocument(const QDomElement & elemSource, \
QObject *parent
KReportDetailSectionData * dsd = new \
KReportDetailSectionData(sec.toElement(), this);
if (dsd->isValid()) {
- m_detailSection = dsd;
+ d->detailSection = dsd;
} else {
kreportDebug() << "Invalid detail section";
delete dsd;
@@ -202,9 +208,9 @@ QList<KReportItemBase*> KReportDocument::objects() const
}
}
- if (m_detailSection) {
+ if (d->detailSection) {
//kreportDebug() << "Number of groups: " << \
m_detailSection->m_groupList.count();
- foreach(KReportDetailGroupSectionData* g, m_detailSection->groupList) {
+ foreach(KReportDetailGroupSectionData* g, d->detailSection->groupList) {
if (g->groupHeader) {
obs << g->groupHeader->objects();
}
@@ -212,8 +218,8 @@ QList<KReportItemBase*> KReportDocument::objects() const
obs << g->groupFooter->objects();
}
}
- if (m_detailSection->detailSection)
- obs << m_detailSection->detailSection->objects();
+ if (d->detailSection->detailSection)
+ obs << d->detailSection->detailSection->objects();
}
/*kreportDebug() << "Object List:";
@@ -247,9 +253,9 @@ QList<KReportSectionData*> KReportDocument::sections() const
}
}
- if (m_detailSection) {
+ if (d->detailSection) {
//kreportDebug() << "Number of groups: " << \
m_detailSection->m_groupList.count();
- foreach(KReportDetailGroupSectionData* g, m_detailSection->groupList) {
+ foreach(KReportDetailGroupSectionData* g, d->detailSection->groupList) {
if (g->groupHeader) {
secs << g->groupHeader;
}
@@ -257,8 +263,8 @@ QList<KReportSectionData*> KReportDocument::sections() const
secs << g->groupFooter;
}
}
- if (m_detailSection->detailSection)
- secs << m_detailSection->detailSection;
+ if (d->detailSection->detailSection)
+ secs << d->detailSection->detailSection;
}
return secs;
@@ -281,40 +287,40 @@ KReportSectionData* \
KReportDocument::section(KReportSectionData::Type type) cons KReportSectionData \
*sec; switch (type) {
case KReportSectionData::Type::PageHeaderAny:
- sec = m_pageHeaderAny;
+ sec = d->pageHeaderAny;
break;
case KReportSectionData::Type::PageHeaderEven:
- sec = m_pageHeaderEven;
+ sec = d->pageHeaderEven;
break;
case KReportSectionData::Type::PageHeaderOdd:
- sec = m_pageHeaderOdd;
+ sec = d->pageHeaderOdd;
break;
case KReportSectionData::Type::PageHeaderFirst:
- sec = m_pageHeaderFirst;
+ sec = d->pageHeaderFirst;
break;
case KReportSectionData::Type::PageHeaderLast:
- sec = m_pageHeaderLast;
+ sec = d->pageHeaderLast;
break;
case KReportSectionData::Type::PageFooterAny:
- sec = m_pageFooterAny;
+ sec = d->pageFooterAny;
break;
case KReportSectionData::Type::PageFooterEven:
- sec = m_pageFooterEven;
+ sec = d->pageFooterEven;
break;
case KReportSectionData::Type::PageFooterOdd:
- sec = m_pageFooterOdd;
+ sec = d->pageFooterOdd;
break;
case KReportSectionData::Type::PageFooterFirst:
- sec = m_pageFooterFirst;
+ sec = d->pageFooterFirst;
break;
case KReportSectionData::Type::PageFooterLast:
- sec = m_pageFooterLast;
+ sec = d->pageFooterLast;
break;
case KReportSectionData::Type::ReportHeader:
- sec = m_reportHeader;
+ sec = d->reportHeader;
break;
case KReportSectionData::Type::ReportFooter:
- sec = m_reportFooter;
+ sec = d->reportFooter;
break;
default:
sec = nullptr;
@@ -386,3 +392,9 @@ void KReportDocument::setLabelType(const QString& label)
{
d->labelType = label;
}
+
+KReportDetailSectionData * KReportDocument::detail() const
+{
+ return d->detailSection;
+}
+
diff --git a/src/common/KReportDocument.h b/src/common/KReportDocument.h
index a74cf72..73c0967 100644
--- a/src/common/KReportDocument.h
+++ b/src/common/KReportDocument.h
@@ -81,9 +81,7 @@ public:
bool externalData() const;
- KReportDetailSectionData* detail() const {
- return m_detailSection;
- }
+ KReportDetailSectionData* detail() const;
void setName(const QString&n);
QString name() const;
@@ -94,30 +92,8 @@ public:
QString pageSize();
void setPageSize(const QString &size);
-
-protected:
-
-
- KReportSectionData * m_pageHeaderFirst;
- KReportSectionData * m_pageHeaderOdd;
- KReportSectionData * m_pageHeaderEven;
- KReportSectionData * m_pageHeaderLast;
- KReportSectionData * m_pageHeaderAny;
-
- KReportSectionData * m_reportHeader;
- KReportSectionData * m_reportFooter;
- KReportSectionData * m_pageFooterFirst;
- KReportSectionData * m_pageFooterOdd;
- KReportSectionData * m_pageFooterEven;
- KReportSectionData * m_pageFooterLast;
- KReportSectionData * m_pageFooterAny;
-
- KReportDetailSectionData* m_detailSection;
-
-private:
- void init();
-
+private:
friend class KReportPreRendererPrivate;
friend class KReportPreRenderer;
#ifdef KREPORT_SCRIPTING
diff --git a/src/plugins/barcode/KReportDesignerItemBarcode.cpp \
b/src/plugins/barcode/KReportDesignerItemBarcode.cpp index 916c849..15cd3ba 100644
--- a/src/plugins/barcode/KReportDesignerItemBarcode.cpp
+++ b/src/plugins/barcode/KReportDesignerItemBarcode.cpp
@@ -51,7 +51,7 @@ KReportDesignerItemBarcode::KReportDesignerItemBarcode(KReportDesigner \
* rw, QGr {
Q_UNUSED(pos);
init(scene);
- setSceneRect(properRect(*rw, m_minWidthTotal*m_dpiX, m_minHeight*m_dpiY));
+ setSceneRect(properRect(*rw, m_minWidthTotal*dpiX(), m_minHeight*dpiY()));
nameProperty()->setValue(designer()->suggestEntityName(typeName()));
}
diff --git a/src/renderer/KReportPreRenderer.cpp \
b/src/renderer/KReportPreRenderer.cpp index 56bf073..c404b61 100644
--- a/src/renderer/KReportPreRenderer.cpp
+++ b/src/renderer/KReportPreRenderer.cpp
@@ -91,32 +91,32 @@ void KReportPreRendererPrivate::createNewPage()
m_yOffset = m_topMargin;
- if (m_pageCounter == 1 && m_reportDocument->m_pageHeaderFirst)
- renderSection(*(m_reportDocument->m_pageHeaderFirst));
- else if (lastPage == true && m_reportDocument->m_pageHeaderLast)
- renderSection(*(m_reportDocument->m_pageHeaderLast));
- else if ((m_pageCounter % 2) == 1 && m_reportDocument->m_pageHeaderOdd)
- renderSection(*(m_reportDocument->m_pageHeaderOdd));
- else if ((m_pageCounter % 2) == 0 && m_reportDocument->m_pageHeaderAny)
- renderSection(*(m_reportDocument->m_pageHeaderAny));
- else if (m_reportDocument->m_pageHeaderAny)
- renderSection(*(m_reportDocument->m_pageHeaderAny));
+ if (m_pageCounter == 1 && \
m_reportDocument->section(KReportSectionData::Type::PageHeaderFirst)) + \
renderSection(*(m_reportDocument->section(KReportSectionData::Type::PageHeaderFirst)));
+ else if (lastPage == true && \
m_reportDocument->section(KReportSectionData::Type::PageHeaderLast)) + \
renderSection(*(m_reportDocument->section(KReportSectionData::Type::PageHeaderLast)));
+ else if ((m_pageCounter % 2) == 1 && \
m_reportDocument->section(KReportSectionData::Type::PageHeaderOdd)) + \
renderSection(*(m_reportDocument->section(KReportSectionData::Type::PageHeaderOdd))); \
+ else if ((m_pageCounter % 2) == 0 && \
m_reportDocument->section(KReportSectionData::Type::PageHeaderEven)) + \
renderSection(*(m_reportDocument->section(KReportSectionData::Type::PageHeaderEven)));
+ else if (m_reportDocument->section(KReportSectionData::Type::PageHeaderAny))
+ renderSection(*(m_reportDocument->section(KReportSectionData::Type::PageHeaderAny)));
}
qreal KReportPreRendererPrivate::finishCurPageSize(bool lastPage)
{
qreal retval = 0.0;
- if (lastPage && m_reportDocument->m_pageFooterLast)
- retval = renderSectionSize(* (m_reportDocument->m_pageFooterLast));
- else if (m_pageCounter == 1 && m_reportDocument->m_pageFooterFirst)
- retval = renderSectionSize(* (m_reportDocument->m_pageFooterFirst));
- else if ((m_pageCounter % 2) == 1 && m_reportDocument->m_pageFooterOdd)
- retval = renderSectionSize(* (m_reportDocument->m_pageFooterOdd));
- else if ((m_pageCounter % 2) == 0 && m_reportDocument->m_pageFooterEven)
- retval = renderSectionSize(* (m_reportDocument->m_pageFooterEven));
- else if (m_reportDocument->m_pageFooterAny)
- retval = renderSectionSize(* (m_reportDocument->m_pageFooterAny));
+ if (lastPage && \
m_reportDocument->section(KReportSectionData::Type::PageFooterLast)) + retval \
= renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterLast))); + else if \
(m_pageCounter == 1 && \
m_reportDocument->section(KReportSectionData::Type::PageFooterFirst)) + retval \
= renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterFirst))); + else if \
((m_pageCounter % 2) == 1 && \
m_reportDocument->section(KReportSectionData::Type::PageFooterOdd)) + retval = \
renderSectionSize(* (m_reportDocument->section(KReportSectionData::Type::PageFooterOdd)));
+ else if ((m_pageCounter % 2) == 0 && \
m_reportDocument->section(KReportSectionData::Type::PageFooterEven)) + retval \
= renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterEven))); + else if \
(m_reportDocument->section(KReportSectionData::Type::PageFooterAny)) + retval \
= renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterAny)));
//kreportDebug() << retval;
return retval;
@@ -129,26 +129,26 @@ qreal KReportPreRendererPrivate::finishCurPage(bool lastPage)
qreal retval = 0.0;
//kreportDebug() << offset;
- if (lastPage && m_reportDocument->m_pageFooterLast) {
+ if (lastPage && \
m_reportDocument->section(KReportSectionData::Type::PageFooterLast)) { \
//kreportDebug() << "Last Footer";
- m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->m_pageFooterLast));
- retval = renderSection(* (m_reportDocument->m_pageFooterLast));
- } else if (m_pageCounter == 1 && m_reportDocument->m_pageFooterFirst) {
+ m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterLast))); + \
retval = renderSection(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterLast))); + } else \
if (m_pageCounter == 1 && \
m_reportDocument->section(KReportSectionData::Type::PageFooterFirst)) { \
//kreportDebug() << "First Footer";
- m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->m_pageFooterFirst));
- retval = renderSection(* (m_reportDocument->m_pageFooterFirst));
- } else if ((m_pageCounter % 2) == 1 && m_reportDocument->m_pageFooterOdd) {
+ m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterLast))); + \
retval = renderSection(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterFirst))); + } else \
if ((m_pageCounter % 2) == 1 && \
m_reportDocument->section(KReportSectionData::Type::PageFooterOdd)) { \
//kreportDebug() << "Odd Footer";
- m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->m_pageFooterOdd));
- retval = renderSection(* (m_reportDocument->m_pageFooterOdd));
- } else if ((m_pageCounter % 2) == 0 && m_reportDocument->m_pageFooterEven) {
+ m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterOdd))); + \
retval = renderSection(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterOdd))); + } else if \
((m_pageCounter % 2) == 0 && \
m_reportDocument->section(KReportSectionData::Type::PageFooterEven)) { \
//kreportDebug() << "Even Footer";
- m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->m_pageFooterEven));
- retval = renderSection(* (m_reportDocument->m_pageFooterEven));
- } else if (m_reportDocument->m_pageFooterAny) {
+ m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterEven))); + \
retval = renderSection(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterEven))); + } else \
if (m_reportDocument->section(KReportSectionData::Type::PageFooterAny)) { \
//kreportDebug() << "Any Footer";
- m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->m_pageFooterAny));
- retval = renderSection(* (m_reportDocument->m_pageFooterAny));
+ m_yOffset = offset - renderSectionSize(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterAny))); + \
retval = renderSection(* \
(m_reportDocument->section(KReportSectionData::Type::PageFooterAny))); }
return retval;
@@ -472,7 +472,7 @@ bool KReportPreRendererPrivate::generateDocument()
//kreportDebug() << "Page Size:" << m_maxWidth << m_maxHeight;
m_document->setPageLayout(m_reportDocument->pageLayout());
- m_dataSource->setSorting(m_reportDocument->m_detailSection->sortedFields);
+ m_dataSource->setSorting(m_reportDocument->detail()->sortedFields);
if (!m_dataSource->open()) {
return false;
}
@@ -515,7 +515,7 @@ bool KReportPreRendererPrivate::generateDocument()
qreal tmp;
// flip the value around if we are printing landscape
- if (!m_reportDocument->pageLayout().orientation() == QPageLayout::Portrait) \
{ + if (!(m_reportDocument->pageLayout().orientation() == \
QPageLayout::Portrait)) { w = (label.height() / 100.0);
wg = (label.yGap() / 100.0);
h = (label.width() / 100.0);
@@ -524,7 +524,7 @@ bool KReportPreRendererPrivate::generateDocument()
numRows = label.columns();
}
- KReportDetailSectionData * detailData = m_reportDocument->m_detailSection;
+ KReportDetailSectionData * detailData = m_reportDocument->detail();
if (detailData->detailSection) {
KReportDataSource *mydata = m_dataSource;
@@ -558,19 +558,19 @@ bool KReportPreRendererPrivate::generateDocument()
} else {
// Normal Print Run
- if (m_reportDocument->m_reportHeader) {
- renderSection(*(m_reportDocument->m_reportHeader));
+ if (m_reportDocument->section(KReportSectionData::Type::ReportHeader)) {
+ renderSection(*(m_reportDocument->section(KReportSectionData::Type::ReportHeader)));
}
- if (m_reportDocument->m_detailSection) {
- renderDetailSection(m_reportDocument->m_detailSection);
+ if (m_reportDocument->detail()) {
+ renderDetailSection(m_reportDocument->detail());
}
- if (m_reportDocument->m_reportFooter) {
- if (renderSectionSize(*(m_reportDocument->m_reportFooter)) + \
finishCurPageSize(true) + m_bottomMargin + m_yOffset >= m_maxHeight) { + if \
(m_reportDocument->section(KReportSectionData::Type::ReportFooter)) { + if \
(renderSectionSize(*(m_reportDocument->section(KReportSectionData::Type::ReportFooter))) \
+ finishCurPageSize(true) + m_bottomMargin + m_yOffset >= m_maxHeight) { \
createNewPage(); }
- renderSection(*(m_reportDocument->m_reportFooter));
+ renderSection(*(m_reportDocument->section(KReportSectionData::Type::ReportFooter)));
}
}
finishCurPage(true);
diff --git a/src/wrtembed/KReportDesignerItemRectBase.cpp \
b/src/wrtembed/KReportDesignerItemRectBase.cpp index 52d44f1..1f9b163 100644
--- a/src/wrtembed/KReportDesignerItemRectBase.cpp
+++ b/src/wrtembed/KReportDesignerItemRectBase.cpp
@@ -33,6 +33,8 @@ public:
~Private();
int grabAction = 0;
+ int dpiX = KReportPrivate::dpiX();
+ int dpiY = KReportPrivate::dpiY();
};
KReportDesignerItemRectBase::Private::Private()
@@ -46,12 +48,7 @@ KReportDesignerItemRectBase::Private::~Private()
KReportDesignerItemRectBase::KReportDesignerItemRectBase(KReportDesigner *r, \
KReportItemBase *b)
: QGraphicsRectItem(), KReportDesignerItemBase(r, b), d(new \
KReportDesignerItemRectBase::Private) {
- m_dpiX = KReportPrivate::dpiX();
- m_dpiY = KReportPrivate::dpiY();
-
- d->grabAction = 0;
setAcceptHoverEvents(true);
-
setFlags(ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges);
}
@@ -395,3 +392,13 @@ void KReportDesignerItemBase::updateRenderText(const QString \
&itemDataSource, co }
}
}
+
+int KReportDesignerItemRectBase::dpiX() const
+{
+ return d->dpiX;
+}
+
+int KReportDesignerItemRectBase::dpiY() const
+{
+ return d->dpiY;
+}
diff --git a/src/wrtembed/KReportDesignerItemRectBase.h \
b/src/wrtembed/KReportDesignerItemRectBase.h index de1605c..18edfed 100644
--- a/src/wrtembed/KReportDesignerItemRectBase.h
+++ b/src/wrtembed/KReportDesignerItemRectBase.h
@@ -47,8 +47,6 @@ public:
virtual void exitInlineEditingMode();
protected:
- int m_dpiX;
- int m_dpiY;
enum class SceneRectFlag {
UpdateProperty,
@@ -72,7 +70,10 @@ protected:
void move(const QPointF&) override;
QRectF properRect(const KReportDesigner &d, qreal minWidth, qreal minHeight) \
const; + int dpiX() const;
+ int dpiY() const;
private:
+ Q_DISABLE_COPY(KReportDesignerItemRectBase)
int grabHandle(const QPointF &pos);
QPointF properPressPoint(const KReportDesigner &d) const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic