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 virtual void setSmallDialogs (bool smallDialogs);
00040
00041 private slots:
00042 void slotFillCorners (int state);
00043 void slotLineColor (const QString &);
00044 void slotLineWidth (int);
00045 void slotMinLength (const QString &);
00046 void slotPointSeparation (const QString &);
00047
00048 protected:
00049 virtual void handleOk ();
00050
00051 private:
00052
00053 void clearPoints();
00054 void createControls (QGridLayout *layout, int &row);
00055 void createPreview (QGridLayout *layout, int &row);
00056 QImage createPreviewImage () const;
00057 void updateControls();
00058 void updatePreview();
00059
00060 QSpinBox *m_spinMinLength;
00061 QSpinBox *m_spinPointSeparation;
00062 QCheckBox *m_chkFillCorners;
00063 QSpinBox *m_spinLineWidth;
00064 QComboBox *m_cmbLineColor;
00065
00066 QGraphicsScene *m_scenePreview;
00067 ViewPreview *m_viewPreview;
00068
00069 DocumentModelSegments *m_modelSegmentsBefore;
00070 DocumentModelSegments *m_modelSegmentsAfter;
00071
00072 QList<Segment*> m_segments;
00073 GraphicsPoints m_points;
00074
00075 bool m_loading;
00076 };
00077
00078 #endif // DLG_SETTINGS_SEGMENTS_H