maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Qt4.6 - Something similar to "hildon_gtk_window_take_screenshot" (https://talk.maemo.org/showthread.php?t=70709)

helex 2011-03-05 14:21

Qt4.6 - Something similar to "hildon_gtk_window_take_screenshot"
 
Hi Forum,

I wonder if there is a possibility to fake a fast application startup at Qt4.6 like the possibility we have for GTK+ applications.

At GTK we could use this function to create a screenshot that is shown automatically at the next startup before the Application is loaded:

Code:

void                hildon_gtk_window_take_screenshot  (GtkWindow *window,
                                                        gboolean take);

But, as the function name said, it works only for GTK Applications. :(
Is there something similar for Qt4.6 and the Maemo target?

Google was so far not my friend... :(

sakya 2011-03-05 14:30

Re: Qt4.6 - Something similar to "hildon_gtk_window_take_screenshot"
 
Have a look at QPixmap::grabWindow
http://doc.qt.nokia.com/latest/qpixmap.html#grabWindow

jstokes 2011-03-05 14:40

Re: Qt4.6 - Something similar to "hildon_gtk_window_take_screenshot"
 
I don't know if there's any Qt-specific method for this, but look at the function itself: http://maemo.gitorious.org/hildon/hi...-gtk.c#line478

Notice that the bits which actually request for the screenshot to be taken are calls to the X library - they're not GTK+ specific!

You could replace GDK_WINDOW_XID with QWidget::winId() and look through QWidget::x11Info's display member to replace gtk_widget_get_display (as a start)

But maybe there is a Qt method for this and I'm going OTT

helex 2011-03-05 21:17

Re: Qt4.6 - Something similar to "hildon_gtk_window_take_screenshot"
 
Ooookay. :D
I played a little bit with it. I'm able to store the screen into a image file, but the rest... mmh, I gave up for the moment... I'm new to C++ and Qt, doing some testing for my first real application. My last project I used python without the knowledge what I'm really doing there. :D But thanks for the hint. I would say I will look into it later again. It's good to know. :)

timoph 2011-03-05 21:24

Re: Qt4.6 - Something similar to "hildon_gtk_window_take_screenshot"
 
http://doc.trolltech.com/latest/desktop-screenshot.html

helex 2011-03-05 21:53

Re: Qt4.6 - Something similar to "hildon_gtk_window_take_screenshot"
 
Thanks timoph and sakya, but creating a screenshot and storing it to a file is not my problem.

My problem is that Hildon doesn't automatically use this image as loading screen for the next application startup.

It was discussed nearly 2 years ago here: maemo-developers-Mailinglist

But it's all GTK related and I'm unable to find someting similar for Qt. (except to write it myself like jstokes has suggested.)


All times are GMT. The time now is 21:07.

vBulletin® Version 3.8.8