static const int default_pm_hotx = -2;
static const int default_pm_hoty = -16;
-/* XPM */
-static const char* const default_pm[] = {
-"13 9 3 1",
-". c None",
-" c #000000",
-"X c #FFFFFF",
-"X X X X X X X",
-" X X X X X X ",
-"X ......... X",
-" X.........X ",
-"X ......... X",
-" X.........X ",
-"X ......... X",
-" X X X X X X ",
-"X X X X X X X"
+#ifndef QT_NO_IMAGEFORMAT_KAT
+// generated via `xxd -i <path_to_kat_image>`
+static const unsigned char default_pm_kat[] = {
+ 0x4b, 0x41, 0x54, 0x49, 0x45, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0xd4, 0x00, 0x00, 0x00, 0x34, 0x78, 0x01,
+ 0xbd, 0x8a, 0xc1, 0x09, 0x00, 0x40, 0x0c, 0xc2, 0xdc, 0x7f, 0x69, 0xaf,
+ 0x15, 0xf1, 0xeb, 0xbd, 0x1a, 0x68, 0x03, 0x12, 0x92, 0x04, 0x30, 0xff,
+ 0xc6, 0x73, 0x3f, 0xa4, 0xb7, 0x2b, 0xee, 0x56, 0xb2, 0xc6, 0x4e, 0x7a,
+ 0xbb, 0xe2, 0x6e, 0x25, 0x6b, 0xec, 0xa4, 0xbf, 0xf0, 0x03, 0x12, 0xc4,
+ 0xb3, 0x4d
};
+static const unsigned int default_pm_kat_len = 86;
+#endif // QT_NO_IMAGEFORMAT_KAT
class QShapedPixmapWidget : public QWidget
{
}
}
- // special cas for images
+ // special case for images
if (format == QLatin1String("image/ppm")) {
if (a == XA_PIXMAP && data.size() == sizeof(Pixmap)) {
Pixmap xpm = *((Pixmap*)data.data());
pm_hot = dragPrivate()->hotspot;
}
if (pm.isNull()) {
- if (!defaultPm)
- defaultPm = new QPixmap(default_pm);
+ if (!defaultPm) {
+ defaultPm = new QPixmap();
+#ifndef QT_NO_IMAGEFORMAT_KAT
+ defaultPm->loadFromData(default_pm_kat, default_pm_kat_len, "KAT");
+#endif
+ }
pm = *defaultPm;
}
xdnd_data.deco->pm_hot = pm_hot;
#if !defined(QT_NO_IMAGEFORMAT_KAT)
// generated via `xxd -i <path_to_kat_image>`
-static const unsigned char button_image_bits[] = {
+static const unsigned char button_image_bits_kat[] = {
0x4b, 0x41, 0x54, 0x49, 0x45, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x83, 0x78, 0x01,
0xb0, 0xb7, 0x0d, 0x77, 0x51, 0xc1, 0x1a, 0xf6, 0xf6, 0x2d, 0xee, 0xe3,
0x1b, 0xdc, 0xc5, 0x2d, 0x3f, 0x1d, 0xde, 0x8d, 0x0b
};
-static const unsigned int button_image_len = 165;
-#elif !defined(QT_NO_IMAGEFORMAT_XPM)
-/* XPM */
-static const char * const button_image[] = {
-"16 16 3 1",
-" c None",
-"o c #000000",
-"a c #000080",
-"o aaaaa ",
-"oo aaa aaa ",
-"ooo aaa aaa",
-"oooo aa aa",
-"ooooo aa aa",
-"oooooo a aaa",
-"ooooooo aaa ",
-"oooooooo aaa ",
-"ooooooooo aaa ",
-"ooooo aaa ",
-"oo ooo ",
-"o ooo aaa ",
-" ooo aaa ",
-" ooo ",
-" ooo ",
-" ooo "};
+static const unsigned int button_image_kat_len = 165;
#endif // QT_NO_IMAGEFORMAT_KAT
class QWhatsThisPrivate : public QObject
{
#if !defined(QT_NO_IMAGEFORMAT_KAT)
QPixmap p;
- p.loadFromData(button_image_bits, button_image_len, "KAT");
- setIcon(p);
-#elif !defined(QT_NO_IMAGEFORMAT_XPM)
- QPixmap p((const char**)button_image);
+ p.loadFromData(button_image_bits_kat, button_image_kat_len, "KAT");
setIcon(p);
#endif
setCheckable(true);