Skip to content
Permalink
Browse files

save attr column width

git-svn-id: http://svn.osgeo.org/qgis/trunk@5161 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Apr 4, 2006
1 parent 5f23d0d commit 88db7f4bf9b6ecb9f5fdc08d9566b57bd73a382f
@@ -176,6 +176,18 @@ int QgsGrassAttributes::addTab ( const QString & label )

resetButtons();

QSettings settings("QuantumGIS", "qgis");
QString path = "/GRASS/windows/attributes/columnWidth/";
for ( int i = 0; i < 2; i++ )
{
bool ok;
int cw = settings.readNumEntry( path+QString::number(i), 30, &ok);
if ( ok ) tb->setColumnWidth (i, cw );
}

connect ( tb->horizontalHeader(), SIGNAL(sizeChange(int,int,int)),
this, SLOT(columnSizeChanged(int,int,int)) );

return ( tabCats->count() - 1 );
}

@@ -366,3 +378,12 @@ void QgsGrassAttributes::resetButtons ( )
updateButton->setEnabled(true);
}
}

void QgsGrassAttributes::columnSizeChanged ( int section, int oldSize, int newSize )
{
QSettings settings("QuantumGIS", "qgis");
QString path = "/GRASS/windows/attributes/columnWidth/"
+ QString::number(section);
std::cerr << "path = " << path.ascii() << " newSize = " << newSize << std::endl;
settings.writeEntry( path, newSize);
}
@@ -99,6 +99,9 @@ public slots:
//! Called if tab is changed
void tabChanged ( QWidget *widget );

//! Column size changed
void columnSizeChanged ( int section, int oldSize, int newSize );

private:
//! Pointer to vector provider
QgsGrassProvider *mProvider;
@@ -38,12 +38,12 @@ class QCloseEvent;
class QgsRubberBand;
class QgsVertexMarker;
class QgsGrassEditLayer;
class QgsGrassAttributes;

class QgsGrassProvider;
#include "ui_qgsgrasseditbase.h"
#include <QMainWindow>
#include "qgsgrassselect.h"
#include "qgsgrassattributes.h"

typedef struct {
int field;

0 comments on commit 88db7f4

Please sign in to comment.
You can’t perform that action at this time.