Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef LEGENDTABLE_H
00030 #define LEGENDTABLE_H
00031
00032 #include <QGpGuiTools.h>
00033
00034 #include "Symbol.h"
00035 #include "Legend.h"
00036 #include "SciFigsDLLExport.h"
00037
00038 namespace SciFigs {
00039
00040 class SCIFIGS_EXPORT LegendTable : public QTableView
00041 {
00042 Q_OBJECT
00043 public:
00044 enum Column {ColumnNull,
00045 ColumnPenColor, ColumnPenWidth, ColumnPenStyle,
00046 ColumnSymbolType, ColumnSymbolSize,
00047 ColumnSymbolPenColor, ColumnSymbolPenWidth, ColumnSymbolPenStyle,
00048 ColumnSymbolBrushColor, ColumnSymbolBrushStyle,
00049 ColumnTextColor, ColumnText};
00050 enum PropertySection {All=0x3F, Text=0x01, Pen=0x02, SymbolAll=0x1C,
00051 SymbolType=0x04, SymbolPen=0x08, SymbolBrush=0x10, TextColor=0x20, TextAll=0x21};
00052 Q_DECLARE_FLAGS(PropertySections, PropertySection)
00053
00054 LegendTable(QWidget *parent=0);
00055
00056 void setLegend(Legend * legend);
00057 void setPropertySections(PropertySections s=All);
00058
00059 void setOneColor(bool oc);
00060 bool oneColor() const;
00061
00062 void setReadOnlyText(bool ro);
00063 bool readOnlyText() const;
00064
00065 void setConstant(bool c);
00066
00067 static void initPenStyles(QComboBox * w);
00068 static Qt::PenStyle penStyle(int index);
00069 static int penItem(Qt::PenStyle p);
00070
00071 static void initSymbolTypes(QComboBox * w);
00072 static Symbol::Type symbolType(int index);
00073 static int symbolItem(Symbol::Type t);
00074
00075 static void initBrushStyles(QComboBox * w);
00076 static Qt::BrushStyle brushStyle(int index);
00077 static int brushItem(Qt::BrushStyle b);
00078 private slots:
00079 void applyAllSelected();
00080 signals:
00081 void changed();
00082 private:
00083 static QPixmap penStylePixmap(Qt::PenStyle s);
00084 static QPixmap brushStylePixmap(Qt::BrushStyle s);
00085 static QPixmap symbolTypePixmap(Symbol::Type t);
00086
00087 QHash<int,Column> _columnIndexes;
00088 };
00089
00090 }
00091
00092 Q_DECLARE_OPERATORS_FOR_FLAGS(SciFigs::LegendTable::PropertySections)
00093
00094 #endif // LEGENDTABLE_H