Skip to content

Commit

Permalink
Checkbox to set composer grid widget visible / invisible
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11818 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 16, 2009
1 parent 7353a4a commit 7a1f386
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 33 deletions.
15 changes: 14 additions & 1 deletion src/app/composer/qgscomposermapwidget.cpp
Expand Up @@ -25,10 +25,11 @@
QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidget(), mComposerMap( composerMap )
{
setupUi( this );
mGridDockWidget->setVisible( false );

//add widget for general composer item properties
QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap );
gridLayout_3->addWidget( itemPropertiesWidget, 8, 0, 1, 1 );
gridLayout_3->addWidget( itemPropertiesWidget, 7, 0, 1, 1 );
QDoubleValidator v( 0 );

mWidthLineEdit->setValidator( &v );
Expand Down Expand Up @@ -671,3 +672,15 @@ void QgsComposerMapWidget::on_mAnnotationTypeComboBox_currentIndexChanged( const
}
mComposerMap->update();
}

void QgsComposerMapWidget::on_mShowGridDialogCheckBox_stateChanged( int state )
{
if ( state == Qt::Checked )
{
mGridDockWidget->setVisible( true );
}
else
{
mGridDockWidget->setVisible( false );
}
}
1 change: 1 addition & 0 deletions src/app/composer/qgscomposermapwidget.h
Expand Up @@ -62,6 +62,7 @@ class QgsComposerMapWidget: public QWidget, private Ui::QgsComposerMapWidgetBase
void on_mDrawAnnotationCheckBox_stateChanged( int state );
void on_mAnnotationDirectionComboBox_currentIndexChanged( const QString& text );
void on_mAnnotationTypeComboBox_currentIndexChanged( const QString& text );
void on_mShowGridDialogCheckBox_stateChanged( int state );

/**Updates width and height without notify the composer map (to avoid infinite recursion)*/
void updateSettingsNoSignals();
Expand Down
45 changes: 13 additions & 32 deletions src/ui/qgscomposermapwidgetbase.ui
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>472</width>
<height>675</height>
<height>708</height>
</rect>
</property>
<property name="sizePolicy">
Expand All @@ -21,32 +21,6 @@
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Width</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>mWidthLineEdit</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Line" name="line1">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="mMapGroupBox">
<property name="title">
<string>Map</string>
Expand Down Expand Up @@ -115,7 +89,7 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<item row="1" column="0">
<widget class="QGroupBox" name="mMapExtentGroupBox">
<property name="title">
<string>Map extent</string>
Expand Down Expand Up @@ -213,7 +187,7 @@
</layout>
</widget>
</item>
<item row="4" column="0">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="mPreviewModeLabel">
Expand Down Expand Up @@ -247,14 +221,21 @@
</item>
</layout>
</item>
<item row="5" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="mKeepLayerListCheckBox">
<property name="text">
<string>Keep layer list</string>
</property>
</widget>
</item>
<item row="6" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="mShowGridDialogCheckBox">
<property name="text">
<string>Show composer grid widget</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QDockWidget" name="mGridDockWidget">
<property name="floating">
<bool>true</bool>
Expand Down Expand Up @@ -431,7 +412,7 @@
</widget>
</widget>
</item>
<item row="7" column="0">
<item row="6" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
Expand Down

0 comments on commit 7a1f386

Please sign in to comment.