KDEUI
Go to the documentation of this file.
31 mimeData->setColorData(color);
32 mimeData->setText(color.name());
38 if (mimeData->hasColor())
40 if (mimeData->hasText())
42 const QString colorName=mimeData->text();
43 if ((colorName.length() >= 4) && (colorName[0] ==
'#'))
52 if (mimeData->hasColor())
53 return mimeData->colorData().value<
QColor>();
55 return QColor(mimeData->text());
63 QDrag *drag=
new QDrag(dragsource);
64 QMimeData *mime=
new QMimeData;
66 drag->setMimeData(mime);
67 QPixmap colorpix( 25, 20 );
68 colorpix.fill( color );
69 QPainter p( &colorpix );
70 p.setPen( Qt::black );
71 p.drawRect(0,0,24,19);
73 drag->setPixmap(colorpix);
74 drag->setHotSpot(
QPoint(-5,-7));
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat May 18 2013 11:39:07 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.