Crash while testing brush settings

Francisco Fernandes francisco.fernandes.j at gmail.com
Wed Sep 12 12:59:37 UTC 2012


Hello again!

Just to inform that I fixed the problem. Now it's possible to see the
preview of the "Pouring" operation of
the brush. I just verify if there is a KisImage and if not just don't add
the annotation. This way it's not possible
to see the "Spread" preview, though. There's no way (at least for now) to
get particles information without
the annotations.

About the absence of debug information, I saw that my distro (Archlinux)
doesn't provide debug packages for KDE
so I'll have to compile everything from scratch with the debug flag.

Anyway, thanks for the help everyone.

Cheers


2012/9/10 Francisco Fernandes <francisco.fernandes.j at gmail.com>

> Hi Lukast!
>
> The problem it's like Boud said: I'm using a weak shared pointer to hold a
> KisImage.
> I tried  your solution, but the crash persisted. Problem is the way
> I hold the particles. I add a "Particle" KisAnnotation to the KisImage.
> Previously, I added these annotations at each call of paintAt(), but it
> was making the brush slow.
> So I added in the end of the process, in the destructor :
>
>
> KisSandPaintOp::~KisSandPaintOp()
> {
>     //Serialize the particles added by the pouring and hold them in an
> annotation
>     QList<Particle *> parts;
>
>     //Retrieve the currently added particles
>     getGrains(parts);
>
>     if(parts.size() > 0){
>
>         QByteArray * b_array = new QByteArray();
>         QDataStream stream(b_array, QIODevice::ReadWrite);
>         for(int i = 0; i < parts.size(); i++){
>             stream << *parts.at(i);
>         }
>
>         /*
>         * Add particles to the "Particle" annotation
>         */
>
>          //m_image is a KisImageWSP
>         if(m_image){
>             m_image->addAnnotation(KisAnnotationSP(new KisAnnotation(
> "Particle",
>                                                                     "Set
> of grains created by the paintop",
>
> *b_array)
>                                                 )
>                                     );
>         }
>     }
>
>     delete m_sandBrush;
> }
>
> I tried to hold directly with a KisAnnotation instead of a KisImageWSP,
> but I can't figure how to
> add the annotation to the image without such reference. There's another
> way to do that without
> a KisImage pointer in the class?
>
>
> 2012/9/3 Lukast dev <lukast.dev at gmail.com>
>
>> > Actually it counts as a KisImage. Since this is the case, what can I do
>> to
>> > make the brush work in the settings widget?
>>
>> I solved this problem in one of my brush engines like this:
>>
>> I needed to know the dimension of the image (widht/height) from KisImage.
>> So I decided that if there is KisImage present, I will use KisImage
>> dimension,
>> otherwise I use some dummy dimension like 1000x1000 or something like
>> that :)
>>
>> Cheers
>> LukasT
>> _______________________________________________
>> kimageshop mailing list
>> kimageshop at kde.org
>> https://mail.kde.org/mailman/listinfo/kimageshop
>>
>
>
>
> --
>
> ____________________________________________________________________________
> Francisco Fernandes (AKA: Chicao)
>
> ..........................................................................................
> Blog: http://pedepinico.blogspot.com
> Identi.ca: http://identi.ca/chicao
> Twitter: http://twitter.com/__chicao
>
> ..........................................................................................
> "Quem de boa vontade carrega o difícil, também carrega o menos difícil..."
> Lao Tsé - Tao Te Ching
>



-- 
____________________________________________________________________________
Francisco Fernandes (AKA: Chicao)
..........................................................................................
Blog: http://pedepinico.blogspot.com
Identi.ca: http://identi.ca/chicao
Twitter: http://twitter.com/__chicao
..........................................................................................
"Quem de boa vontade carrega o difícil, também carrega o menos difícil..."
Lao Tsé - Tao Te Ching
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20120912/fce0d947/attachment.html>


More information about the kimageshop mailing list