Skip to content

Commit

Permalink
Improve layout
Browse files Browse the repository at this point in the history
Set col sizes on resize event


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4642 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 11, 2006
1 parent a2739f8 commit 61d84ac
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 68 deletions.
9 changes: 9 additions & 0 deletions src/widgets/projectionselector/qgsprojectionselector.cpp
Expand Up @@ -24,6 +24,8 @@
#include <QFileInfo>
#include <Q3ProgressDialog>
#include <QTextStream>
#include <QHeaderView>
#include <QResizeEvent>

#define QGISDEBUG

Expand All @@ -37,13 +39,20 @@ QgsProjectionSelector::QgsProjectionSelector( QWidget* parent , const char* name

// Get the full path name to the sqlite3 spatial reference database.
mSrsDatabaseFileName = QgsApplication::srsDbFilePath();
lstCoordinateSystems->header()->setResizeMode(1,QHeaderView::Stretch);
// Populate the projection list view
getProjList();
getUserProjList();
}

QgsProjectionSelector::~QgsProjectionSelector()
{}
void QgsProjectionSelector::resizeEvent ( QResizeEvent * theEvent )
{

lstCoordinateSystems->header()->resizeSection(0,(theEvent->size().width()-120));
lstCoordinateSystems->header()->resizeSection(1,120);
}
void QgsProjectionSelector::setSelectedSRSName(QString theSRSNAme)
{
//get the srid given the wkt so we can pick the correct list item
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/projectionselector/qgsprojectionselector.h
Expand Up @@ -12,6 +12,7 @@

#include "ui_qgsprojectionselectorbase.h"

class QResizeEvent;

/**
@author Tim Sutton
Expand Down Expand Up @@ -48,7 +49,8 @@ class QgsProjectionSelector: public QWidget, private Ui::QgsProjectionSelectorBa
void on_pbnFind_clicked();

private:

/** Used to manage column sizes */
void resizeEvent ( QResizeEvent * theEvent );
// List view nodes for the tree view of projections
//! User defined projections node
QTreeWidgetItem *mUserProjList;
Expand Down
135 changes: 68 additions & 67 deletions src/widgets/projectionselector/qgsprojectionselectorbase.ui
Expand Up @@ -8,7 +8,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<width>512</width>
<height>498</height>
</rect>
</property>
Expand Down Expand Up @@ -38,46 +38,14 @@
<property name="title" >
<string>Projection</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QTreeWidget" name="lstCoordinateSystems" >
<column>
<property name="text" >
<string>Coordinate System</string>
</property>
</column>
<column>
<property name="text" >
<string>Spatial Reference Id</string>
</property>
</column>
</widget>
</item>
<item>
<widget class="QTextEdit" name="teProjection" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFormatting" >
<set>QTextEdit::AutoBulletList</set>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<item row="2" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Search</string>
Expand All @@ -89,21 +57,21 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="5" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
<item row="0" column="2" >
<widget class="QRadioButton" name="radSRSID" >
<property name="text" >
<string>QGIS SRSID</string>
</property>
<property name="sizeHint" >
</widget>
</item>
<item row="1" column="3" >
<widget class="QPushButton" name="pbnFind" >
<property name="maximumSize" >
<size>
<width>40</width>
<height>20</height>
<width>100</width>
<height>16777215</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3" colspan="2" >
<widget class="QPushButton" name="pbnFind" >
<property name="text" >
<string>Find</string>
</property>
Expand Down Expand Up @@ -132,36 +100,69 @@
</property>
</widget>
</item>
<item row="0" column="2" colspan="2" >
<widget class="QRadioButton" name="radSRSID" >
<property name="text" >
<string>QGIS SRSID</string>
</property>
</widget>
</item>
<item row="0" column="4" >
<item row="0" column="3" >
<widget class="QRadioButton" name="radName" >
<property name="text" >
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="5" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" >
<widget class="QTreeWidget" name="lstCoordinateSystems" >
<property name="alternatingRowColors" >
<bool>true</bool>
</property>
<property name="uniformRowHeights" >
<bool>true</bool>
</property>
<property name="columnCount" >
<number>2</number>
</property>
<column>
<property name="text" >
<string>Spatial Reference System</string>
</property>
</column>
<column>
<property name="text" >
<string>Id</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0" >
<widget class="QTextEdit" name="teProjection" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>80</height>
</size>
</property>
<property name="autoFormatting" >
<set>QTextEdit::AutoBulletList</set>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 61d84ac

Please sign in to comment.