mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-24 22:09:58 +01:00
save/load QetGraphicsTableItem to/from .qet file
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "qetgraphicsheaderitem.h"
|
||||
#include "qabstractitemmodel.h"
|
||||
#include "qetxml.h"
|
||||
|
||||
#include <QFontMetrics>
|
||||
#include <QPainter>
|
||||
@@ -209,6 +210,34 @@ void QetGraphicsHeaderItem::setMargins(const QMargins &margins)
|
||||
headerDataChanged(Qt::Horizontal, 0,1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QetGraphicsHeaderItem::toXml
|
||||
* save the header to xml
|
||||
* @param document
|
||||
* @return
|
||||
*/
|
||||
QDomElement QetGraphicsHeaderItem::toXml(QDomDocument &document) const
|
||||
{
|
||||
auto dom_element = document.createElement(xmlTagName());
|
||||
dom_element.appendChild(QETXML::marginsToXml(document, m_margin));
|
||||
|
||||
return dom_element;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QetGraphicsHeaderItem::fromXml
|
||||
* Restore the header from xml
|
||||
* @param element
|
||||
*/
|
||||
void QetGraphicsHeaderItem::fromXml(const QDomElement &element)
|
||||
{
|
||||
if (element.tagName() != xmlTagName()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_margin = QETXML::marginsFromXml(element.firstChildElement("margins"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QetGraphicsHeaderItem::setUpMinimumSectionsSize
|
||||
* Setup the minimum section size and height of the item.
|
||||
|
||||
Reference in New Issue
Block a user