[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Drawing vector graphics in js widgets
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2010-02-25 1:27:34
Message-ID: 201002241727.34914.aseigo () kde ! org
[Download RAW message or body]

On February 24, 2010, Mohamed Ikbel Boulabiar wrote:
> Thanks for the answer and for the api errata you send yesterday.
> 
> I tried with the code below, but it only draws things without changing
> the properties of the pen.
> 
> 
> //////////////////
> var painter = new QPainter
> var pen = new QPen
> 
> pen.color = new QColor("red")
> pen.width = 15
> //painter.setbrush = pen.brush
> //painter.pen = pen
> painter.setpen = pen

there is no painter object until paintInterface is called, and it's local to 
paintInterface.

> plasmoid.paintInterface = function(painter)
> {
>   painter.drawEllipse(30, 40, 120, 113)
>   painter.drawRect(22, 21, 20, 13)
> }

so instead do:

plasmoid.paintInterface = function(painter)
{
  painter.pen = pen
  painter.drawEllipse(30, 40, 120, 113)
  painter.drawRect(22, 21, 20, 13)
}


-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic