KDevelop API Documentation

lib/widgets/propeditor/plinestyle.cpp

Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 2002 Alexander Dymo <cloudtemple@mksat.net> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 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 /*val*/) 00158 { 00159 emit propertyChanged(pname(), value()); 00160 } 00161 00162 #ifndef PURE_QT 00163 #include "plinestyle.moc" 00164 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:01:49 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003