12 #include <QTextStream> 13 #include <QXmlStreamReader> 14 #include <QXmlStreamWriter> 42 m_paletteColor (paletteColor),
43 m_curveConnectAs (curveConnectAs)
48 m_width (other.width ()),
49 m_paletteColor (other.paletteColor()),
50 m_curveConnectAs (other.curveConnectAs())
56 m_width = other.
width ();
65 return m_curveConnectAs;
87 int indexOneBased = index + 1;
91 settings.beginGroup (groupName);
108 QXmlStreamAttributes attributes = reader.attributes();
119 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
124 reader.raiseError (QObject::tr (
"Cannot read line style data"));
130 return m_paletteColor;
134 QTextStream &str)
const 136 str << indentation <<
"LineStyle\n";
140 str << indentation <<
"width=" << m_width <<
"\n";
155 writer.writeEndElement();
170 m_width = unsigned (
width);
Manage storage and retrieval of the settings for the curves.
CurveConnectAs curveConnectAs() const
Get method for connect type.
const QString DOCUMENT_SERIALIZE_LINE_STYLE_WIDTH
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
const QString SETTINGS_GROUP_CURVE_AXES
static LineStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
const ColorPalette DEFAULT_LINE_COLOR_GRAPH
unsigned int width() const
Width of line.
QString colorPaletteToString(ColorPalette colorPalette)
const QString DOCUMENT_SERIALIZE_LINE_STYLE_COLOR
const QString INDENTATION_DELTA
const QString SETTINGS_CURVE_LINE_WIDTH
const QString SETTINGS_CURVE_LINE_CONNECT_AS
LineStyle & operator=(const LineStyle &other)
Assignment operator.
const CurveConnectAs DEFAULT_LINE_CONNECT_AS_AXES
const QString SETTINGS_DIGITIZER
#define LOG4CPP_INFO_S(logger)
static LineStyle defaultAxesCurve()
Initial default for axes curve.
const QString SETTINGS_CURVE_LINE_COLOR
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
const QString DOCUMENT_SERIALIZE_LINE_STYLE_COLOR_STRING
const QString DOCUMENT_SERIALIZE_LINE_STYLE_CONNECT_AS
ColorPalette paletteColor() const
Line color.
const QString DOCUMENT_SERIALIZE_LINE_STYLE_CONNECT_AS_STRING
const ColorPalette DEFAULT_LINE_COLOR_AXES
const QString SETTINGS_ENGAUGE
const int DEFAULT_LINE_WIDTH_GRAPH
Details for a specific Line.
log4cpp::Category * mainCat
const QString DOCUMENT_SERIALIZE_LINE_STYLE
QString groupNameForNthCurve(int indexOneBased) const
Return the group name, that appears in the settings file/registry, for the specified curve index.
QString curveConnectAsToString(CurveConnectAs curveConnectAs)
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setCurveConnectAs(CurveConnectAs curveConnectAs)
Set connect as.
const int DEFAULT_LINE_WIDTH_AXES
void setPaletteColor(ColorPalette paletteColor)
Set method for line color.
void setWidth(int width)
Set width of line.
LineStyle()
Default constructor only for use when this class is being stored by a container that requires the def...
const CurveConnectAs DEFAULT_LINE_CONNECT_AS_GRAPH