25 #include <QStylePainter> 26 #include <QStyleOptionFrame> 27 #include <QMouseEvent> 48 p->
back.setTexture(QPixmap(QLatin1String(
":/color_widgets/alphaback.png")));
98 c1 = c2 =
p->
col.rgb();
113 QStyleOptionFrame panel;
114 panel.initFrom(
this);
116 panel.midLineWidth = 0;
117 panel.state |= QStyle::State_Sunken;
118 style()->drawPrimitive(QStyle::PE_Frame, &panel, &painter,
this);
119 QRect r = style()->subElementRect(QStyle::SE_FrameContents, &panel,
this);
120 painter.setClipRect(r);
122 if ( c1.alpha() < 255 || c2.alpha() < 255 )
123 painter.fillRect(0, 0, rect.width(), rect.height(),
p->
back);
125 int w = rect.width() / 2;
126 int h = rect.height();
127 painter.fillRect(0, 0, w, h, c1);
128 painter.fillRect(w, 0, w, h, c2);
146 QStylePainter painter(
this);
148 paint(painter, geometry());
158 if ( QRect(QPoint(0,0),
size()).contains(ev->pos()) )
165 if ( ev->buttons() &Qt::LeftButton && !QRect(QPoint(0,0),
size()).contains(ev->pos()) )
167 QMimeData *
data =
new QMimeData;
169 data->setColorData(
p->
col);
171 QDrag* drag =
new QDrag(
this);
172 drag->setMimeData(data);
174 QPixmap preview(24,24);
175 preview.fill(
p->
col);
176 drag->setPixmap(preview);
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
TFSIMD_FORCE_INLINE const tfScalar & w() const
empty_struct data[sizeof(T)/sizeof(empty_struct)]