show styles on buttons in case of unique renderer

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2311 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2004-11-22 15:25:32 +00:00
parent a01d833d31
commit c56278814a

View File

@ -49,6 +49,36 @@ QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer * layer):QgsSiSyDialogBase(), mVecto
qWarning("constructor QgsSiSyDialog called WITH a layer"); qWarning("constructor QgsSiSyDialog called WITH a layer");
#endif #endif
//
//set outline / line style
//
pbnLineSolid->setPixmap(QgsSymbologyUtils::char2LinePixmap("SolidLine"));
pbnLineDash->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashLine"));
pbnLineDot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DotLine"));
pbnLineDashDot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotLine"));
pbnLineDashDotDot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotDotLine"));
pbnLineNoPen->setPixmap(QgsSymbologyUtils::char2LinePixmap("NoPen"));
//
//set pattern button group icons and state
//
solid->setPixmap(QgsSymbologyUtils::char2PatternPixmap("SolidPattern"));
horizontal->setPixmap(QgsSymbologyUtils::char2PatternPixmap("HorPattern"));
vertical->setPixmap(QgsSymbologyUtils::char2PatternPixmap("VerPattern"));
cross->setPixmap(QgsSymbologyUtils::char2PatternPixmap("CrossPattern"));
bdiag->setPixmap(QgsSymbologyUtils::char2PatternPixmap("BDiagPattern"));
fdiag->setPixmap(QgsSymbologyUtils::char2PatternPixmap("FDiagPattern"));
diagcross->setPixmap(QgsSymbologyUtils::char2PatternPixmap("DiagCrossPattern"));
dense1->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense1Pattern"));
dense2->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense2Pattern"));
dense3->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense3Pattern"));
dense4->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense4Pattern"));
dense5->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense5Pattern"));
dense6->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense6Pattern"));
dense7->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense7Pattern"));
nopen->setPixmap(QgsSymbologyUtils::char2PatternPixmap("NoBrush"));
if (layer) if (layer)
{ {
QgsSingleSymRenderer *renderer; QgsSingleSymRenderer *renderer;
@ -78,19 +108,10 @@ QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer * layer):QgsSiSyDialogBase(), mVecto
lblOutlineColor->setPaletteBackgroundColor(renderer->item()->getSymbol()->pen().color()); lblOutlineColor->setPaletteBackgroundColor(renderer->item()->getSymbol()->pen().color());
//
//set outline / line style
//
//stylebutton->setName(QgsSymbologyUtils::penStyle2Char(renderer->item()->getSymbol()->pen().style())); //stylebutton->setName(QgsSymbologyUtils::penStyle2Char(renderer->item()->getSymbol()->pen().style()));
//stylebutton->setPixmap(QgsSymbologyUtils::char2LinePixmap(stylebutton->name())); //stylebutton->setPixmap(QgsSymbologyUtils::char2LinePixmap(stylebutton->name()));
//load the icons stored in QgsSymbologyUtils.cpp (to avoid redundancy) //load the icons stored in QgsSymbologyUtils.cpp (to avoid redundancy)
pbnLineSolid->setPixmap(QgsSymbologyUtils::char2LinePixmap("SolidLine"));
pbnLineDash->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashLine"));
pbnLineDot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DotLine"));
pbnLineDashDot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotLine"));
pbnLineDashDotDot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotDotLine"));
pbnLineNoPen->setPixmap(QgsSymbologyUtils::char2LinePixmap("NoPen"));
QPen myPen = renderer->item()->getSymbol()->pen(); QPen myPen = renderer->item()->getSymbol()->pen();
if (myPen==Qt::NoPen) if (myPen==Qt::NoPen)
(pbnLineNoPen->setOn(true)); (pbnLineNoPen->setOn(true));
@ -105,24 +126,7 @@ QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer * layer):QgsSiSyDialogBase(), mVecto
else else
(pbnLineSolid->setOn(true)); //default to solid (pbnLineSolid->setOn(true)); //default to solid
//
//set pattern button group icons and state
//
solid->setPixmap(QgsSymbologyUtils::char2PatternPixmap("SolidPattern"));
horizontal->setPixmap(QgsSymbologyUtils::char2PatternPixmap("HorPattern"));
vertical->setPixmap(QgsSymbologyUtils::char2PatternPixmap("VerPattern"));
cross->setPixmap(QgsSymbologyUtils::char2PatternPixmap("CrossPattern"));
bdiag->setPixmap(QgsSymbologyUtils::char2PatternPixmap("BDiagPattern"));
fdiag->setPixmap(QgsSymbologyUtils::char2PatternPixmap("FDiagPattern"));
diagcross->setPixmap(QgsSymbologyUtils::char2PatternPixmap("DiagCrossPattern"));
dense1->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense1Pattern"));
dense2->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense2Pattern"));
dense3->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense3Pattern"));
dense4->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense4Pattern"));
dense5->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense5Pattern"));
dense6->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense6Pattern"));
dense7->setPixmap(QgsSymbologyUtils::char2PatternPixmap("Dense7Pattern"));
nopen->setPixmap(QgsSymbologyUtils::char2PatternPixmap("NoBrush"));
QBrush myBrush = renderer->item()->getSymbol()->brush(); QBrush myBrush = renderer->item()->getSymbol()->brush();
if (myBrush==Qt::SolidPattern) if (myBrush==Qt::SolidPattern)
(solid->setOn(true)); (solid->setOn(true));