From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- doc/html/chart-element-h.html | 126 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 doc/html/chart-element-h.html (limited to 'doc/html/chart-element-h.html') diff --git a/doc/html/chart-element-h.html b/doc/html/chart-element-h.html new file mode 100644 index 00000000..cdc93fd9 --- /dev/null +++ b/doc/html/chart-element-h.html @@ -0,0 +1,126 @@ + + + + + +chart/element.h Example File + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

chart/element.h Example File

+ + +
#ifndef ELEMENT_H
+#define ELEMENT_H
+
+#include <qcolor.h>
+#include <qnamespace.h>
+#include <qstring.h>
+#include <qvaluevector.h>
+
+class Element;
+
+typedef TQValueVector<Element> ElementVector;
+
+/*
+    Elements are valid if they have a value which is > EPSILON.
+*/
+const double EPSILON = 0.0000001; // Must be > INVALID.
+
+
+class Element
+{
+public:
+    enum { INVALID = -1 };
+    enum { NO_PROPORTION = -1 };
+    enum { MAX_PROPOINTS = 3 }; // One proportional point per chart type
+
+    Element( double value = INVALID, TQColor valueColor = TQt::gray,
+             int valuePattern = TQt::SolidPattern,
+             const TQString& label = TQString::null,
+             TQColor labelColor = TQt::black ) {
+        init( value, valueColor, valuePattern, label, labelColor );
+        for ( int i = 0; i < MAX_PROPOINTS * 2; ++i )
+            m_propoints[i] = NO_PROPORTION;
+    }
+    ~Element() {}
+
+    bool isValid() const { return m_value > EPSILON; }
+
+    double value() const { return m_value; }
+    TQColor valueColor() const { return m_valueColor; }
+    int valuePattern() const { return m_valuePattern; }
+    TQString label() const { return m_label; }
+    TQColor labelColor() const { return m_labelColor; }
+    double proX( int index ) const;
+    double proY( int index ) const;
+
+    void set( double value = INVALID, TQColor valueColor = TQt::gray,
+              int valuePattern = TQt::SolidPattern,
+              const TQString& label = TQString::null,
+              TQColor labelColor = TQt::black ) {
+        init( value, valueColor, valuePattern, label, labelColor );
+    }
+    void setValue( double value ) { m_value = value; }
+    void setValueColor( TQColor valueColor ) { m_valueColor = valueColor; }
+    void setValuePattern( int valuePattern );
+    void setLabel( const TQString& label ) { m_label = label; }
+    void setLabelColor( TQColor labelColor ) { m_labelColor = labelColor; }
+    void setProX( int index, double value );
+    void setProY( int index, double value );
+
+#ifdef Q_FULL_TEMPLATE_INSTANTIATION
+    // xlC 3.x workaround
+    Q_DUMMY_COMPARISON_OPERATOR(Element)
+    bool operator!=( const Element& e) const {
+        return ( !(e == *this) );
+    }
+#endif
+
+private:
+    void init( double value, TQColor valueColor, int valuePattern,
+               const TQString& label, TQColor labelColor );
+
+    double m_value;
+    TQColor m_valueColor;
+    int m_valuePattern;
+    TQString m_label;
+    TQColor m_labelColor;
+    double m_propoints[2 * MAX_PROPOINTS];
+};
+
+
+TQTextStream &operator<<( TQTextStream&, const Element& );
+TQTextStream &operator>>( TQTextStream&, Element& );
+
+#endif
+
+


+ +
Copyright © 2007 +TrolltechTrademarks +
TQt 3.3.8
+
+ -- cgit v1.2.3