KReport
KReportDesigner.cpp
230// (must be init() instead of ctor because we are indirectly depending on initialized KReportDesigner::d here)
302 originalInterpreter = it.toElement().attribute(QLatin1String("report:script-interpreter"), QLatin1String("javascript"));
309 if (originalInterpreter != QLatin1String("javascript") && originalInterpreter != QLatin1String("qtscript")) {
319 showGrid->setValue(it.toElement().attribute(QLatin1String("report:grid-visible"), QString::number(1)).toInt() != 0);
320 gridSnap->setValue(it.toElement().attribute(QLatin1String("report:grid-snap"), QString::number(1)).toInt() != 0);
321 gridDivisions->setValue(it.toElement().attribute(QLatin1String("report:grid-divisions"), QString::number(4)).toInt());
322 unit->setValue(it.toElement().attribute(QLatin1String("report:page-unit"), DEFAULT_UNIT_STRING));
331 pageSize->setValue(it.toElement().attribute(QLatin1String("report:page-size"), QLatin1String("A4")));
334 customPageSize->setValue(QSizeF(KReportUnit::parseValue(it.toElement().attribute(QLatin1String("report:custom-page-width"), QLatin1String(""))),
335 KReportUnit::parseValue(it.toElement().attribute(QLatin1String("report:custom-page-height"), QLatin1String("")))));
428 content.setAttribute(QLatin1String("xmlns:fo"), QLatin1String("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"));
429 content.setAttribute(QLatin1String("xmlns:svg"), QLatin1String("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"));
443 if (d->script->value().toString() != d->originalScript || d->originalInterpreter == QLatin1String("qtscript") || d->originalInterpreter.isEmpty() ) {
476 pagestyle.setAttribute(QLatin1String("report:page-label-type"), d->labelType->value().toString());
831 listData = new KPropertyListData(KReportUnit::symbols(types), KReportUnit::descriptions(types));
840 d->leftMargin = new KProperty("margin-left", pageUnit().convertFromPoint(KReportUnit::parseValue(DEFAULT_PAGE_MARGIN_STRING)),
842 d->rightMargin = new KProperty("margin-right", pageUnit().convertFromPoint(KReportUnit::parseValue(DEFAULT_PAGE_MARGIN_STRING)),
844 d->topMargin = new KProperty("margin-top", pageUnit().convertFromPoint(KReportUnit::parseValue(DEFAULT_PAGE_MARGIN_STRING)),
846 d->bottomMargin = new KProperty("margin-bottom", pageUnit().convertFromPoint(KReportUnit::parseValue(DEFAULT_PAGE_MARGIN_STRING)),
915 } else if (propertyName.startsWith("margin-") || propertyName == "page-size" || propertyName == "custom-page-size") {
979 QSizeF customSize = d->currentUnit.convertToPoint(d->set.property("custom-page-size").value().toSizeF());
980 QPageLayout layout(QPageSize(customSize, QPageSize::Point, QString(), QPageSize::ExactMatch), d->set.property("print-orientation").value().toString()
981 == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape, QMarginsF(0,0,0,0));
988 == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape, QMarginsF(0,0,0,0));
994 pageWidth = pageWidth - KReportUnit::convertFromUnitToUnit(d->set.property("margin-left").value().toDouble(), pageUnit(), KReportUnit(KReportUnit::Type::Inch)) * KReportPrivate::dpiX();
995 pageWidth = pageWidth - KReportUnit::convertFromUnitToUnit(d->set.property("margin-right").value().toDouble(), pageUnit(), KReportUnit(KReportUnit::Type::Inch)) * KReportPrivate::dpiX();
1007 QSizeF customSize = d->currentUnit.convertToPoint(d->set.property("custom-page-size").value().toSizeF());
1008 QPageLayout layout(QPageSize(customSize, QPageSize::Point, QString(), QPageSize::ExactMatch), d->set.property("print-orientation").value().toString()
1009 == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape, QMarginsF(0,0,0,0));
1016 == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape, QMarginsF(0,0,0,0));
1058void KReportDesigner::sectionContextMenuEvent(KReportDesignerSectionScene * s, QGraphicsSceneContextMenuEvent * e)
1308 new_obj->setPosition(KReportItemBase::positionFromScene(QPointF(activeItem->x() + 10, activeItem->y() + 10)));
1476 QAction *act = new QAction(QIcon::fromTheme(QLatin1String("kreport-line-element")), tr("Line"), group);
1525 d->editCopyAction = new QAction(QIcon::fromTheme(QLatin1String("edit-copy")), tr("&Copy"), this);
1531 d->editPasteAction = new QAction(QIcon::fromTheme(QLatin1String("edit-paste")), tr("&Paste"), this);
1547 d->itemRaiseAction = new QAction(QIcon::fromTheme(QLatin1String("arrow-up")), tr("Raise"), this);
1549 d->itemLowerAction = new QAction(QIcon::fromTheme(QLatin1String("arrow-down")), tr("Lower"), this);
1690 d->leftMargin->setOption("max", d->currentUnit.convertFromPoint(pageSize.width() - d->currentUnit.convertToPoint(d->rightMargin->value().toReal()) - SMALLEST_PAGE_SIZE_PT));
1691 d->rightMargin->setOption("max", d->currentUnit.convertFromPoint(pageSize.width() - d->currentUnit.convertToPoint(d->leftMargin->value().toReal())- SMALLEST_PAGE_SIZE_PT));
1692 d->topMargin->setOption("max", d->currentUnit.convertFromPoint(pageSize.height() - d->currentUnit.convertToPoint(d->bottomMargin->value().toReal())- SMALLEST_PAGE_SIZE_PT));
1693 d->bottomMargin->setOption("max", d->currentUnit.convertFromPoint(pageSize.height() - d->currentUnit.convertToPoint(d->topMargin->value().toReal())- SMALLEST_PAGE_SIZE_PT));
QString iconName() const
QString name() const
void addProperty(KProperty *property, const QByteArray &group="common")
void clearModifiedFlags()
void propertyChanged(KPropertySet &set, KProperty &property)
void setVisible(bool visible)
QVariant value() const
QByteArray name() const
Base class for report items used within the designer GUI.
Definition KReportDesignerItemBase.h:40
The central detail section which contains the bulk of the report.
Definition KReportDesignerSectionDetail.h:38
void initFromXML(QDomNode *node)
Definition KReportDesignerSectionDetail.cpp:102
This class is the base to all Report Section's visual representation.
Definition KReportDesignerSection.h:46
QGraphicsItemList items() const
Return the items in the section Only return top-level items ... ie, items with no parent item because...
Definition KReportDesignerSection.cpp:352
The ReportDesigner is the main widget for designing a report.
Definition KReportDesigner.h:53
void sectionMouseReleaseEvent(KReportDesignerSectionView *v, QMouseEvent *e)
Handle the mouse release event for a report section.
Definition KReportDesigner.cpp:1103
KReportDataSource * reportDataSource() const
Return a pointer to the reports data.
Definition KReportDesigner.cpp:756
KReportDesignerSectionDetail * detailSection() const
Return a pointer to the detail section.
Definition KReportDesigner.cpp:761
KReportUnit pageUnit() const
Return the current unit assigned to the report.
Definition KReportDesigner.cpp:1044
QList< QAction * > designerActions()
Populates the toolbar with actions that can be applied to the report Actions are created as children ...
Definition KReportDesigner.cpp:1506
QString suggestEntityName(const QString &name) const
Return a unique name that can be used by the entity.
Definition KReportDesigner.cpp:1351
bool isEntityNameUnique(const QString &name, KReportItemBase *ignore=nullptr) const
Checks if the supplied name is unique among all entities.
Definition KReportDesigner.cpp:1394
bool isModified() const
Return true if the design has been modified.
Definition KReportDesigner.cpp:771
int pageWidthPx() const
Calculate the width of the page in pixels given the paper size, orientation, dpi and margin.
Definition KReportDesigner.cpp:971
void setDataSource(KReportDataSource *source)
Sets the report data The report data interface contains functions to retrieve data and information ab...
Definition KReportDesigner.cpp:533
void setReportTitle(const QString &title)
Sets the title of the reportData.
Definition KReportDesigner.cpp:738
void sectionContextMenuEvent(KReportDesignerSectionScene *scene, QGraphicsSceneContextMenuEvent *event)
Handle the context menu event for a report section.
Definition KReportDesigner.cpp:1058
QSize sizeHint() const override
Give a hint on the size of the widget.
Definition KReportDesigner.cpp:930
void insertSection(KReportSectionData::Type type)
Create a new section and insert it into the report.
Definition KReportDesigner.cpp:657
static QList< QAction * > itemActions(QActionGroup *group=nullptr)
Returns a list of actions that represent the entities that can be inserted into the report.
Definition KReportDesigner.cpp:1470
void setGridOptions(bool visible, int divisions)
Sets the parameters for the display of the background gridpoints.
Definition KReportDesigner.cpp:1049
void setModified(bool modified)
Sets the modified status, defaulting to true for modified.
Definition KReportDesigner.cpp:776
qreal getSelectionPressY() const
Definition KReportDesigner.cpp:1642
qreal getSelectionPressX() const
Definition KReportDesigner.cpp:1637
KReportDesignerSection * section(KReportSectionData::Type type) const
Return a pointer to the section specified.
Definition KReportDesigner.cpp:554
KReportDesigner(QWidget *parent=nullptr)
Constructor that create a blank designer.
Definition KReportDesigner.cpp:403
void changeSet(KPropertySet *set)
Sets the property set for the currently selected item.
Definition KReportDesigner.cpp:1178
qreal countSelectionHeight() const
Definition KReportDesigner.cpp:1621
KPropertySet * selectedItemPropertySet() const
Return the property set for the curently selected item.
Definition KReportDesigner.cpp:751
void removeSection(KReportSectionData::Type type)
Deletes the section specified.
Definition KReportDesigner.cpp:605
QDomElement document() const
Return an XML description of the report.
Definition KReportDesigner.cpp:421
static void addMetaProperties(KPropertySet *set, const QString &classString, const QString &iconName)
Adds meta-properties to the property set set for consumption by property editor.
Definition KReportDesigner.cpp:1676
qreal countSelectionWidth() const
Definition KReportDesigner.cpp:1629
void setPosition(const QPointF &ptPos)
Sets position for the element.
Definition KReportItemBase.cpp:259
static QPointF positionFromScene(const QPointF &pos)
Helper function mapping from screen units to points, pos is in pixels.
Definition KReportItemBase.cpp:269
An interface for plugins delivering KReport elements.
Definition KReportPluginInterface.h:46
const KReportPluginMetaData * metaData() const
Definition KReportPluginInterface.cpp:55
Manager class for finding and loading available plugins.
Definition KReportPluginManager.h:41
static KReportSectionData::Type sectionTypeFromString(const QString &s)
Definition KReportSectionData.cpp:246
static QString sectionTypeString(KReportSectionData::Type type)
Definition KReportSectionData.cpp:189
static KReportUnit::Type symbolToType(const QString &symbol)
Returns a unit symbol string to type.
Definition KReportUnit.cpp:356
static qreal convertFromUnitToUnit(qreal value, const KReportUnit &fromUnit, const KReportUnit &toUnit, qreal factor=1.0)
convert the given value directly from one unit to another with high accuracy
Definition KReportUnit.cpp:383
static QList< Type > allTypes()
Returns list of all supported types (without Invalid)
Definition KReportUnit.cpp:126
static QStringList symbols(const QList< Type > &types)
Returns the list of unit symbols for the given types.
Definition KReportUnit.cpp:374
static qreal parseValue(const QString &value, qreal defaultVal=0.0)
Parses common KReport and ODF values, like "10cm", "5mm" to pt.
Definition KReportUnit.cpp:303
static QStringList descriptions(const QList< Type > &types)
Returns the list of (translated) description strings for given list of types.
Definition KReportUnit.cpp:163
Insert
KREPORT_EXPORT QString pageSizeKey(QPageSize::PageSizeId id)
Definition KReportPageSize.cpp:104
KREPORT_EXPORT QPageSize::PageSizeId pageSize(const QString &key)
Definition KReportPageSize.cpp:114
KREPORT_EXPORT QStringList pageFormatKeys()
Definition KReportPageSize.cpp:85
KREPORT_EXPORT QPageSize::PageSizeId defaultSize()
Definition KReportPageSize.cpp:94
KREPORT_EXPORT QStringList pageFormatNames()
Definition KReportPageSize.cpp:76
KGuiItem del()
const QList< QKeySequence > & cut()
const QList< QKeySequence > & paste()
const QList< QKeySequence > & copy()
QCA_EXPORT void init()
void released()
void setCheckable(bool)
QVariant data() const const
void setData(const QVariant &data)
void setSeparator(bool b)
QAction * addAction(QAction *action)
void insertWidget(int index, QWidget *widget, int stretch, Qt::Alignment alignment)
virtual void setSpacing(int spacing) override
bool startsWith(QByteArrayView bv) const const
QByteArray toLower() const const
QDomElement createElement(const QString &tagName)
QDomText createTextNode(const QString &value)
QString toString(int indent) const const
QString attribute(const QString &name, const QString &defValue) const const
void setAttribute(const QString &name, const QString &value)
QString tagName() const const
QDomNode appendChild(const QDomNode &newChild)
QDomNodeList childNodes() const const
void clear()
QDomNode firstChild() const const
bool isElement() const const
QString nodeName() const const
QString nodeValue() const const
QDomElement toElement() const const
int count() const const
QDomNode item(int index) const const
void accept()
QGraphicsScene * scene() const const
void setSelected(bool selected)
void setVisible(bool visible)
void show()
qreal x() const const
qreal y() const const
void addItem(QGraphicsItem *item)
void clearSelection()
qreal height() const const
void removeItem(QGraphicsItem *item)
QList< QGraphicsItem * > selectedItems() const const
void update(const QRectF &rect)
qreal width() const const
QGraphicsScene * scene() const const
void addLayout(QLayout *layout, int row, int column, Qt::Alignment alignment)
void addWidget(QWidget *widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment)
void setColumnStretch(int column, int stretch)
void setRowStretch(int row, int stretch)
virtual void setSpacing(int spacing) override
QIcon fromTheme(const QString &name)
SetFixedSize
void setSizeConstraint(SizeConstraint)
iterator begin()
const_iterator constBegin() const const
const_iterator constEnd() const const
qsizetype count() const const
iterator end()
T & first()
iterator insert(const_iterator before, parameter_type value)
bool isEmpty() const const
void prepend(parameter_type value)
StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons, StandardButton defaultButton)
QPoint pos() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
objectName
QObject * parent() const const
QObject * sender() const const
void setObjectName(QAnyStringView name)
QString tr(const char *sourceText, const char *disambiguation, int n)
None
Portrait
ExactMatch
Point
int x() const const
int y() const const
Qt::MouseButton button() const const
int width() const const
QString arg(Args &&... args) const const
bool isEmpty() const const
QString number(double n, char format, int precision)
QString toLower() const const
Checked
CrossCursor
LeftButton
Horizontal
int toInt(bool *ok) const const
QString toString() const const
QList< QAction * > actions() const const
void adjustSize()
virtual bool event(QEvent *event) override
QLayout * layout() const const
void setMaximumSize(const QSize &)
void setMinimumSize(const QSize &)
pos
void show()
void update()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.