Skip to content
Permalink
Browse files

optional line width and marker size

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5059 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 18, 2006
1 parent 9d9cd71 commit dc20cde95a0af9c1c024c50c05fa545cdef449a1
Showing with 309 additions and 74 deletions.
  1. +43 −6 src/plugins/grass/qgsgrassedit.cpp
  2. +12 −0 src/plugins/grass/qgsgrassedit.h
  3. +254 −68 src/plugins/grass/qgsgrasseditbase.ui
@@ -373,22 +373,33 @@ void QgsGrassEdit::init()
mSymbName[SYMB_NODE_2] = "Node (2 lines)";

// Restore symbology
QString spath = "/GRASS/edit/symb/";
QSettings settings("QuantumGIS", "qgis");

mLineWidth = settings.readNumEntry (
spath + "lineWidth", 1 );
mSize = settings.readNumEntry (
spath + "markerSize", 9 );
mLineWidthSpinBox->setValue(mLineWidth);
mMarkerSizeSpinBox->setValue(mSize);

for ( int i = 0; i < SYMB_COUNT; i++ ) {
bool ok;
QString sn;
sn.sprintf( "/GRASS/edit/symb/display/%d", i );
bool displ = settings.readBoolEntry (sn, true, &ok );
bool displ = settings.readBoolEntry (
spath + "display/" + QString::number(i),
true, &ok );
if ( ok ) {
mSymbDisplay[i] = displ;
}

sn.sprintf( "/GRASS/edit/symb/color/%d", i );
QString colorName = settings.readEntry (sn, "", &ok );
QString colorName = settings.readEntry (
spath + "color/" + QString::number(i),
"", &ok );
if ( ok ) {
QColor color( colorName );
mSymb[i].setColor( color );
}
mSymb[i].setWidth( mLineWidth );
}

// Set Symbology in dialog
@@ -458,7 +469,6 @@ void QgsGrassEdit::init()
connect( mAttributeTable, SIGNAL(valueChanged(int,int)), this, SLOT(columnTypeChanged(int,int)) );

// Set variables
mSize = 9;
mSelectedLine = 0;
mAttributes = 0;

@@ -729,6 +739,33 @@ void QgsGrassEdit::changeSymbology(Q3ListViewItem * item, const QPoint & pnt, in
}
}

void QgsGrassEdit::lineWidthChanged()
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit::lineWidthChanged()" << std::endl;
#endif
QSettings settings("QuantumGIS", "qgis");
mLineWidth = mLineWidthSpinBox->value();

for ( int i = 0; i < SYMB_COUNT; i++ ) {
mSymb[i].setWidth( mLineWidth );
}

QString spath = "/GRASS/edit/symb/";
settings.writeEntry ( spath + "lineWidth", mLineWidth );
}

void QgsGrassEdit::markerSizeChanged()
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit::markerSizeChanged()" << std::endl;
#endif
QSettings settings("QuantumGIS", "qgis");
mSize = mMarkerSizeSpinBox->value();
QString spath = "/GRASS/edit/symb/";
settings.writeEntry ( spath + "markerSize", mSize );
}

void QgsGrassEdit::restorePosition()
{
QSettings settings("QuantumGIS", "qgis");
@@ -190,6 +190,12 @@ public slots:

void changeSymbology( Q3ListViewItem * item, const QPoint & pnt, int col );

//! width/size changed
void lineWidthChanged();
void markerSizeChanged();
void on_mLineWidthSpinBox_valueChanged() { lineWidthChanged(); }
void on_mMarkerSizeSpinBox_valueChanged() { markerSizeChanged(); }

// The type of column was changed
void columnTypeChanged ( int row, int col );

@@ -323,6 +329,12 @@ public slots:
//! Symbology name
std::vector<QString> mSymbName;

//! Line width
int mLineWidth;

//! Marker size
int mMarkerSize;

/**
* Read line symbology from map
* @return symbology code

0 comments on commit dc20cde

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