include QPen include cstdio include dlfcn typedef void QPen_setColor Q

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <QPen>
#include <cstdio>
#include <dlfcn.h>
typedef void QPen_setColor(QPen *, const QColor &);
QPen_setColor *_QPen_setColor;
__attribute__((constructor)) void init() {
_QPen_setColor = (QPen_setColor *) dlsym(RTLD_NEXT, "_ZN4QPen8setColorERK6QColor");
}
void QPen::setColor(const QColor &c) {
if (c.value() == 0x000000FF) {
_QPen_setColor(this, QColor("#0063cc"));
} else if (c.value() == 0x00007f) {
_QPen_setColor(this, QColor("#108dde"));
} else
_QPen_setColor(this, c);
// printf("_QPen_setColor = %s\n", c.name().toUtf8().constData());
}