/
qgscomposerlegendwidget.h
108 lines (89 loc) · 4.17 KB
/
qgscomposerlegendwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/***************************************************************************
qgscomposerlegendwidget.h
-------------------------
begin : July 2008
copyright : (C) 2008 by Marco Hugentobler
email : marco dot hugentobler at karto dot baug dot ethz dot ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSCOMPOSERLEGENDWIDGET_H
#define QGSCOMPOSERLEGENDWIDGET_H
#include "ui_qgscomposerlegendwidgetbase.h"
#include <QWidget>
#include <QItemDelegate>
class QgsComposerLegend;
class QgsComposerLegendWidgetStyleDelegate : public QItemDelegate
{
Q_OBJECT
public:
QgsComposerLegendWidgetStyleDelegate( QObject *parent = 0 );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
void setEditorData( QWidget *editor, const QModelIndex &index ) const;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const;
void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
};
/** \ingroup MapComposer
* A widget for setting properties relating to a composer legend.
*/
class QgsComposerLegendWidget: public QWidget, private Ui::QgsComposerLegendWidgetBase
{
Q_OBJECT
public:
QgsComposerLegendWidget( QgsComposerLegend* legend );
~QgsComposerLegendWidget();
/**Updates the legend layers and groups*/
void updateLegend();
public slots:
void on_mWrapCharLineEdit_textChanged( const QString& text );
void on_mTitleLineEdit_textChanged( const QString& text );
void on_mColumnCountSpinBox_valueChanged( int c );
void on_mSplitLayerCheckBox_toggled( bool checked );
void on_mEqualColumnWidthCheckBox_toggled( bool checked );
void on_mSymbolWidthSpinBox_valueChanged( double d );
void on_mSymbolHeightSpinBox_valueChanged( double d );
void on_mWmsLegendWidthSpinBox_valueChanged( double d );
void on_mWmsLegendHeightSpinBox_valueChanged( double d );
void on_mTitleSpaceBottomSpinBox_valueChanged( double d );
void on_mGroupSpaceSpinBox_valueChanged( double d );
void on_mLayerSpaceSpinBox_valueChanged( double d );
void on_mSymbolSpaceSpinBox_valueChanged( double d );
void on_mIconLabelSpaceSpinBox_valueChanged( double d );
void on_mTitleFontButton_clicked();
void on_mGroupFontButton_clicked();
void on_mLayerFontButton_clicked();
void on_mItemFontButton_clicked();
void on_mFontColorPushButton_clicked();
void on_mBoxSpaceSpinBox_valueChanged( double d );
void on_mColumnSpaceSpinBox_valueChanged( double d );
void on_mCheckBoxAutoUpdate_stateChanged( int state );
void on_mMapComboBox_currentIndexChanged( int index );
//item manipulation
void on_mMoveDownToolButton_clicked();
void on_mMoveUpToolButton_clicked();
void on_mRemoveToolButton_clicked();
void on_mAddToolButton_clicked();
void on_mEditPushButton_clicked();
void on_mCountToolButton_clicked( bool checked );
void on_mUpdatePushButton_clicked();
void on_mUpdateAllPushButton_clicked();
void on_mAddGroupToolButton_clicked();
void selectedChanged( const QModelIndex & current, const QModelIndex & previous );
protected:
void showEvent( QShowEvent * event );
private slots:
/**Sets GUI according to state of mLegend*/
void setGuiElements();
private:
QgsComposerLegendWidget();
void blockAllSignals( bool b );
void refreshMapComboBox();
QgsComposerLegend* mLegend;
};
#endif