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));
1058 void KReportDesigner::sectionContextMenuEvent(KReportDesignerSectionScene * s, QGraphicsSceneContextMenuEvent * e)
1103 void KReportDesigner::sectionMouseReleaseEvent(KReportDesignerSectionView * v, QMouseEvent * 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);
1512 al << d->editCutAction << d->editCopyAction << d->editPasteAction << d->editDeleteAction << sep << d->sectionEdit << sep << d->itemLowerAction << d->itemRaiseAction;
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));
QByteArray name() const
QIcon icon() const
void adjustSize()
T & first()
QPoint pos() const const
void propertyChanged(KPropertySet &set, KProperty &property)
bool isModified() const
Return true if the design has been modified.
Definition: KReportDesigner.cpp:771
QString whatsThis() const
This class is the base to all Report Section's visual representation.
Definition: KReportDesignerSection.h:45
void setGridOptions(bool visible, int divisions)
Sets the parameters for the display of the background gridpoints.
Definition: KReportDesigner.cpp:1049
QString toString(int indent) const const
int count() const const
static KReportSectionData::Type sectionTypeFromString(const QString &s)
Definition: KReportSectionData.cpp:246
The central detail section which contains the bulk of the report.
Definition: KReportDesignerSectionDetail.h:37
KReportDesignerSectionDetail * detailSection() const
Return a pointer to the detail section.
Definition: KReportDesigner.cpp:761
QGraphicsItemList items() const
Return the items in the section Only return top-level items ...
Definition: KReportDesignerSection.cpp:352
QDomNode firstChild() const const
QDomElement toElement() const const
QByteArray toLower() const const
SetFixedSize
QList< QAction * > actions() const const
QString number(int n, int base)
pos
@ IgnoreOld
void addItem(QGraphicsItem *item)
qreal getSelectionPressX() const
Definition: KReportDesigner.cpp:1637
KReportDesigner(QWidget *parent=nullptr)
Constructor that create a blank designer.
Definition: KReportDesigner.cpp:403
Qt::MouseButton button() const const
QString tagName() const const
void setModified(bool modified)
Sets the modified status, defaulting to true for modified.
Definition: KReportDesigner.cpp:776
void insertSection(KReportSectionData::Type type)
Create a new section and insert it into the report.
Definition: KReportDesigner.cpp:657
Insert
QCA_EXPORT void init()
int count(const T &value) const const
QLayout * layout() const const
QString text() const
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
void update()
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
virtual bool event(QEvent *event) override
QDomText createTextNode(const QString &value)
void initFromXML(QDomNode *node)
Definition: KReportDesignerSectionDetail.cpp:102
QIcon fromTheme(const QString &name)
KREPORT_EXPORT QString pageSizeKey(QPageSize::PageSizeId id)
Definition: KReportPageSize.cpp:104
QSize sizeHint() const override
Give a hint on the size of the widget.
Definition: KReportDesigner.cpp:930
QObject * sender() const const
ExactMatch
QList::const_iterator constBegin() const const
int x() const const
int y() const const
int width() const const
QMessageBox::StandardButton warning(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
QDomElement createElement(const QString &tagName)
LeftButton
void removeSection(KReportSectionData::Type type)
Deletes the section specified.
Definition: KReportDesigner.cpp:605
QList< QAction * > designerActions()
Populates the toolbar with actions that can be applied to the report Actions are created as children ...
Definition: KReportDesigner.cpp:1506
Manager class for finding and loading available plugins.
Definition: KReportPluginManager.h:40
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString nodeValue() const const
QString iconName() const
void sectionContextMenuEvent(KReportDesignerSectionScene *scene, QGraphicsSceneContextMenuEvent *event)
Handle the context menu event for a report section.
Definition: KReportDesigner.cpp:1058
QStringList types(Mode mode=Writing)
KReportUnit pageUnit() const
Return the current unit assigned to the report.
Definition: KReportDesigner.cpp:1044
void setAttribute(const QString &name, const QString &value)
QList< QGraphicsItem * > selectedItems() const const
void clear()
void prepend(const T &value)
QDomNode item(int index) const const
bool isEntityNameUnique(const QString &name, KReportItemBase *ignore=nullptr) const
Checks if the supplied name is unique among all entities.
Definition: KReportDesigner.cpp:1394
KREPORT_EXPORT QStringList pageFormatNames()
Definition: KReportPageSize.cpp:76
qreal getSelectionPressY() const
Definition: KReportDesigner.cpp:1642
static QStringList descriptions(const QList< Type > &types)
Returns the list of (translated) description strings for given list of types.
Definition: KReportUnit.cpp:163
const KReportPluginMetaData * metaData() const
Definition: KReportPluginInterface.cpp:55
KReportDataSource * reportDataSource() const
Return a pointer to the reports data.
Definition: KReportDesigner.cpp:756
const QList< QKeySequence > & cut()
KREPORT_EXPORT QStringList pageFormatKeys()
Definition: KReportPageSize.cpp:85
QGraphicsScene * scene() const const
bool removeOne(const T &value)
QString name() const
void setPosition(const QPointF &ptPos)
Sets position for the element.
Definition: KReportItemBase.cpp:259
Horizontal
bool isEmpty() const const
CrossCursor
KREPORT_EXPORT QPageSize::PageSizeId defaultSize()
Definition: KReportPageSize.cpp:94
void setSelected(bool selected)
Portrait
KReportDesignerSection * section(KReportSectionData::Type type) const
Return a pointer to the section specified.
Definition: KReportDesigner.cpp:554
int toInt(bool *ok) const const
bool startsWith(const QByteArray &ba) const const
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
void sectionMouseReleaseEvent(KReportDesignerSectionView *v, QMouseEvent *e)
Handle the mouse release event for a report section.
Definition: KReportDesigner.cpp:1103
void show()
bool isEmpty() const const
void setVisible(bool visible)
void setActiveScene(QGraphicsScene *scene)
Sets the active Scene.
Definition: KReportDesigner.cpp:1341
QDomNodeList childNodes() const const
void changeSet(KPropertySet *set)
Sets the property set for the currently selected item.
Definition: KReportDesigner.cpp:1178
QString suggestEntityName(const QString &name) const
Return a unique name that can be used by the entity.
Definition: KReportDesigner.cpp:1351
QDomElement document() const
Return an XML description of the report.
Definition: KReportDesigner.cpp:421
KPropertySet * selectedItemPropertySet() const
Return the property set for the curently selected item.
Definition: KReportDesigner.cpp:751
void setCheckable(bool)
QGraphicsScene * activeScene() const
Definition: KReportDesigner.cpp:1336
qreal countSelectionHeight() const
Definition: KReportDesigner.cpp:1621
QString nodeName() const const
void insert(int i, const T &value)
void show()
QVariant data() const const
void setData(const QVariant &userData)
static QPointF positionFromScene(const QPointF &pos)
Helper function mapping from screen units to points, pos is in pixels.
Definition: KReportItemBase.cpp:269
KGuiItem del()
QString toLower() const const
void update(qreal x, qreal y, qreal w, qreal h)
QString toolTip() const
QList::const_iterator constEnd() const const
void setVisible(bool visible)
void addProperty(KProperty *property, const QByteArray &group="common")
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QDomNode appendChild(const QDomNode &newChild)
static QStringList symbols(const QList< Type > &types)
Returns the list of unit symbols for the given types.
Definition: KReportUnit.cpp:374
void setObjectName(const QString &name)
void setDataSource(KReportDataSource *source)
Sets the report data The report data interface contains functions to retrieve data and information ab...
Definition: KReportDesigner.cpp:533
const QList< QKeySequence > & paste()
QVariant value() const
void setReportTitle(const QString &title)
Sets the title of the reportData.
Definition: KReportDesigner.cpp:738
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
QList::iterator begin()
Point
void clearModifiedFlags()
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
The ReportDesigner is the main widget for designing a report.
Definition: KReportDesigner.h:52
Checked
QString attribute(const QString &name, const QString &defValue) const const
QAction * addAction(QAction *action)
bool isElement() const const
QList::iterator end()
void setSeparator(bool b)
QString tr(const char *sourceText, const char *disambiguation, int n)
qreal x() const const
qreal y() const const
static QList< Type > allTypes()
Returns list of all supported types (without Invalid)
Definition: KReportUnit.cpp:126
const QList< QKeySequence > & copy()
void removeItem(QGraphicsItem *item)
void clearSelection()
int pageWidthPx() const
Calculate the width of the page in pixels given the paper size, orientation, dpi and margin.
Definition: KReportDesigner.cpp:971
void accept()
QString toString() const const
An interface for plugins delivering KReport elements.
Definition: KReportPluginInterface.h:45
MouseAction
KREPORT_EXPORT QPageSize::PageSizeId pageSize(const QString &key)
Definition: KReportPageSize.cpp:114
Base class for report items used within the designer GUI.
Definition: KReportDesignerItemBase.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 04:10:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 04:10:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.