added nopen linestyle

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@991 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2004-03-06 12:11:04 +00:00
parent 5f99301b55
commit f7ee09f725
3 changed files with 73 additions and 7 deletions

View File

@ -30,6 +30,7 @@ QgsLineStyleDialog::QgsLineStyleDialog(QWidget * parent, const char *name, bool
dot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DotLine"));
dashdot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotLine"));
dashdotdot->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashDotDotLine"));
nopen->setPixmap(QgsSymbologyUtils::char2LinePixmap("NoPen"));
QObject::connect(okbutton, SIGNAL(clicked()), this, SLOT(queryStyle()));
QObject::connect(cancelbutton, SIGNAL(clicked()), this, SLOT(reject()));
@ -46,18 +47,26 @@ void QgsLineStyleDialog::queryStyle()
if (solid->isOn())
{
m_style = Qt::SolidLine;
} else if (dash->isOn())
}
else if (dash->isOn())
{
m_style = Qt::DashLine;
} else if (dot->isOn())
}
else if (dot->isOn())
{
m_style = Qt::DotLine;
} else if (dashdot->isOn())
}
else if (dashdot->isOn())
{
m_style = Qt::DashDotLine;
} else if (dashdotdot->isOn())
}
else if (dashdotdot->isOn())
{
m_style = Qt::DashDotDotLine;
}
else if (nopen->isOn())
{
m_style = Qt::NoPen;
}
accept();
}

View File

@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>246</width>
<height>237</height>
<width>240</width>
<height>261</height>
</rect>
</property>
<property name="caption">
@ -88,6 +88,17 @@
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" row="2" column="1">
<property name="name">
<cstring>nopen</cstring>
</property>
<property name="text">
<string></string>
</property>
<property name="toggleButton">
<bool>true</bool>
</property>
</widget>
</grid>
</widget>
<spacer row="1" column="3">

View File

@ -188,6 +188,38 @@ static const char *dashDotDotLineData[] = {
"a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.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.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
"a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
"a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
"a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
"a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.",
".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",
"a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a."};
static const char *solidData[] = {
"58 29 1 1",
". c #3155c5",
@ -923,6 +955,10 @@ QPixmap QgsSymbologyUtils::qString2LinePixmap(QString string)
{
return QPixmap(dashDotDotLineData);
}
if(string =="NoPen")
{
return QPixmap(noPenLineData);
}
}
QPixmap QgsSymbologyUtils::qString2PatternPixmap(QString string)
@ -1089,7 +1125,14 @@ QPixmap QgsSymbologyUtils::char2LinePixmap(const char *c)
else if (strcmp(c, "DashDotDotLine") == 0)
{
return QPixmap(dashDotDotLineData);
} else
}
else if (strcmp(c, "NoPen") == 0)
{
return QPixmap(noPenLineData);
}
else
{
qWarning("Warning, no matching style found in QgsSymbologyUtils::char2LinePixmap");
return QPixmap();
@ -1254,6 +1297,9 @@ QPixmap QgsSymbologyUtils::penStyle2Pixmap(Qt::PenStyle penstyle)
case (Qt::DashDotDotLine):
return QPixmap(dashDotDotLineData);
break;
case (Qt::NoPen):
return QPixmap(noPenLineData);
break;
default:
qWarning("Warning, no matching pen style found in QgsSymbologyUtils::penStyle2Pixmap");
return QPixmap();