lib/widgets/propeditor/plinestyle.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#include <qpixmap.h>
00020
00021
#include "plinestyle.h"
00022
#include "propertyeditor.h"
00023
00024 PLineStyle::PLineStyle(
const PropertyEditor *editor,
const QString pname,
const QVariant value,
QWidget *parent,
const char *name):
00025
QComboBox(parent, name)
00026 {
00027
const char *nopen[]={
00028
"48 16 1 1",
00029
". c None",
00030
"................................................",
00031
"................................................",
00032
"................................................",
00033
"................................................",
00034
"................................................",
00035
"................................................",
00036
"................................................",
00037
"................................................",
00038
"................................................",
00039
"................................................",
00040
"................................................",
00041
"................................................",
00042
"................................................",
00043
"................................................",
00044
"................................................",
00045
"................................................"};
00046 insertItem(
QPixmap(nopen));
00047
00048
const char *solid[]={
00049
"48 16 2 1",
00050
". c None",
00051
"# c #000000",
00052
"................................................",
00053
"................................................",
00054
"................................................",
00055
"................................................",
00056
"................................................",
00057
"................................................",
00058
"................................................",
00059
".###########################################....",
00060
".###########################################....",
00061
"................................................",
00062
"................................................",
00063
"................................................",
00064
"................................................",
00065
"................................................",
00066
"................................................",
00067
"................................................"};
00068 insertItem(
QPixmap(solid));
00069
00070
const char *dash[]={
00071
"48 16 2 1",
00072
". c None",
00073
"# c #000000",
00074
"................................................",
00075
"................................................",
00076
"................................................",
00077
"................................................",
00078
"................................................",
00079
"................................................",
00080
"................................................",
00081
".#########..#########..#########..##########....",
00082
".#########..#########..#########..##########....",
00083
"................................................",
00084
"................................................",
00085
"................................................",
00086
"................................................",
00087
"................................................",
00088
"................................................",
00089
"................................................"};
00090 insertItem(
QPixmap(dash));
00091
00092
const char *dashdot[]={
00093
"48 16 2 1",
00094
". c None",
00095
"# c #000000",
00096
"................................................",
00097
"................................................",
00098
"................................................",
00099
"................................................",
00100
"................................................",
00101
"................................................",
00102
"................................................",
00103
".#########..##..#########..##..#########..##....",
00104
".#########..##..#########..##..#########..##....",
00105
"................................................",
00106
"................................................",
00107
"................................................",
00108
"................................................",
00109
"................................................",
00110
"................................................",
00111
"................................................"};
00112 insertItem(
QPixmap(dashdot));
00113
00114
const char *dashdotdot[]={
00115
"48 16 2 1",
00116
". c None",
00117
"# c #000000",
00118
"................................................",
00119
"................................................",
00120
"................................................",
00121
"................................................",
00122
"................................................",
00123
"................................................",
00124
"................................................",
00125
".#########..##..##..#########..##..##..#####....",
00126
".#########..##..##..#########..##..##..#####....",
00127
"................................................",
00128
"................................................",
00129
"................................................",
00130
"................................................",
00131
"................................................",
00132
"................................................",
00133
"................................................"};
00134 insertItem(
QPixmap(dashdotdot));
00135
00136
setValue(value,
false);
00137 setPName(pname);
00138 connect(
this, SIGNAL(activated(
int)),
this, SLOT(
updateProperty(
int)));
00139 connect(
this, SIGNAL(
propertyChanged(
QString,
QVariant)), editor, SLOT(emitPropertyChange(
QString,
QVariant)));
00140 }
00141
00142 QVariant PLineStyle::value()
const
00143
{
00144
return QVariant(currentItem());
00145 }
00146
00147 void PLineStyle::setValue(
const QVariant value,
bool emitChange)
00148 {
00149
if ( (value.toInt() >= 0) && (value.toInt() <= 5) )
00150 {
00151 setCurrentItem(value.toInt());
00152
if (emitChange)
00153 emit
propertyChanged(
pname(), value);
00154 };
00155 }
00156
00157 void PLineStyle::updateProperty(
int )
00158 {
00159 emit
propertyChanged(
pname(),
value());
00160 }
00161
00162
#ifndef PURE_QT
00163
#include "plinestyle.moc"
00164
#endif
This file is part of the documentation for KDevelop Version 3.0.4.