QBrush opacity problem

67 views
Skip to first unread message

Martin DeMello

unread,
Dec 19, 2012, 3:23:40 AM12/19/12
to eql-...@googlegroups.com
Simple test script attached - I'm trying to define a brush via

(defun brush (r g b a)
(let ((brush (qnew "QBrush"))
(color (qfun "QColor" "fromRgb" r g b a)))
;(format t "~d" (qfun color "alpha"))
(x:do-with (qfun brush)
("setStyle" |Qt.SolidPattern|)
("setColor(QColor)" color))
brush))

but the alpha value doesn't seem to be making any difference. Also the
commented out line where I'm trying to see if the color has an alpha
value fails with

[EQL:err] QINVOKE-METHOD "#ffc0c0" NIL "alpha" NIL
test.lisp

Polos Ruetz

unread,
Dec 20, 2012, 3:59:41 AM12/20/12
to eql-...@googlegroups.com
2012/12/19, Martin DeMello <martin...@gmail.com>:
> I'm trying to define a brush via [...]
> but the alpha value doesn't seem to be making any difference. Also the
> commented out line where I'm trying to see if the color has an alpha
> value fails

You just discovered a shortcoming of QColor, which is a "primitive" in
EQL (see eql -qgui).

But this can be resolved: I will make a (backwards compatible) change
to QColor, allowing both a string (as it is now) and a QColor
QT-OBJECT where a QColor is expected.

So QColor will then be both a primitive and a real object, depending
on your choice.

Stay tuned...

Paul

Polos Ruetz

unread,
Dec 20, 2012, 5:56:02 AM12/20/12
to eql-...@googlegroups.com
2012/12/20, Polos Ruetz <polos...@gmail.com>:
> So QColor will then be both a primitive and a real object, depending
> on your choice.

This was easy to fix, see new version 12.12.2 (and please see
README-REBUILD.txt).

Your example works fine now, and thanks for reporting.

Paul

Martin DeMello

unread,
Dec 20, 2012, 4:25:50 PM12/20/12
to eql-...@googlegroups.com
Great, thanks :)

martin
Reply all
Reply to author
Forward
0 new messages