[Qt-interest] capture screen
Luis Lezcano Airaldi
luislezcair at gmail.com
Sat Jun 12 18:15:53 CEST 2010
El 12/06/10 07:31, Carsten Breuer escribió:
> Hi pengliang,
> hi all,
>
>
>> Please see the snippet bellow. (I want to minimizied the windows
>> and capture the screen, but application capture screen before the window
>> was fully minimized.) why? Can anybody tell me why? Or give me some ideas.
>>
> The code needs a lot of cleanup because if is unnecessary complicated.
> The function windowHideShow is almost useless.
>
> You have created some really funny things here:
>
> this-hide(); LOL
>
> You take the address of the widget and subtract the result of
> hide of it and throw the result away. Funny.
>
> I think you meant this->hide();
> You do the same here: while(this-isHidden())
>
> NEVER EVER use this inside a class without the need of
> doing so! The only reason to use this is to give another
> class a pointer to your instance.
> The use of this is a disease that occur since python programmers
> try to use C++ (in python you have to do it that way with self).
>
> Here some other points:
>
> 1. Why do you want to toggle isHideWnd. No need for that.
> You have two variables doing the same thing
> 2. You try to call functions twice! One time with this, the
> other time correct.
>
> Clean up the code first and REMOVE all the useless "this".
>
>
> Best Regards,
>
That's the problem when they use html in a mailing list. Your client
removed the ">" of this->hide() so you're not seeing it.
Back to the problem, what happens if you uncomment the line
qApp->proccessEvents()? I'm not sure, but that should minimize the
window and then you take the screenshot...
Regards.
More information about the Qt-interest-old
mailing list