00001
00002
00003
00004
00005
00006
00007 #ifndef DLG_SETTINGS_SEGMENTS_H
00008 #define DLG_SETTINGS_SEGMENTS_H
00009
00010 #include "DlgSettingsAbstractBase.h"
00011 #include "GraphicsPoint.h"
00012 #include <QImage>
00013 #include <QList>
00014
00015 class DocumentModelSegments;
00016 class QCheckBox;
00017 class QComboBox;
00018 class QGridLayout;
00019 class QGraphicsScene;
00020 class QSpinBox;
00021 class Segment;
00022 class ViewPreview;
00023
00024 typedef QList<GraphicsPoint*> GraphicsPoints;
00025
00027 class DlgSettingsSegments : public DlgSettingsAbstractBase
00028 {
00029 Q_OBJECT;
00030
00031 public:
00033 DlgSettingsSegments(MainWindow &mainWindow);
00034 virtual ~DlgSettingsSegments();
00035
00036 virtual void createOptionalSaveDefault (QHBoxLayout *layout);
00037 virtual QWidget *createSubPanel ();
00038 virtual void load (CmdMediator &cmdMediator);
00039
00040 private slots:
00041 void slotFillCorners (int state);
00042 void slotLineColor (const QString &);
00043 void slotLineWidth (int);
00044 void slotMinLength (const QString &);
00045 void slotPointSeparation (const QString &);
00046
00047 protected:
00048 virtual void handleOk ();
00049
00050 private:
00051
00052 void clearPoints();
00053 void createControls (QGridLayout *layout, int &row);
00054 void createPreview (QGridLayout *layout, int &row);
00055 QImage createPreviewImage () const;
00056 void updateControls();
00057 void updatePreview();
00058
00059 QSpinBox *m_spinMinLength;
00060 QSpinBox *m_spinPointSeparation;
00061 QCheckBox *m_chkFillCorners;
00062 QSpinBox *m_spinLineWidth;
00063 QComboBox *m_cmbLineColor;
00064
00065 QGraphicsScene *m_scenePreview;
00066 ViewPreview *m_viewPreview;
00067
00068 DocumentModelSegments *m_modelSegmentsBefore;
00069 DocumentModelSegments *m_modelSegmentsAfter;
00070
00071 QList<Segment*> m_segments;
00072 GraphicsPoints m_points;
00073
00074 bool m_loading;
00075 };
00076
00077 #endif // DLG_SETTINGS_SEGMENTS_H