Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
Posts: 7
Registered: ‎06-29-2013
My Device: z10
My Carrier: FloatingLand

Qt code to capture screen

I use the folowing code to capture a screenshot,it works on pc,but it won't work on z10

QPixmap pixmap=QPixmap::grabWindow(QApplication::desktop()->winId(),0,0,-1,-1);//this can not work
    if(pixmap.save("/sdcard/screenshots/1.jpg"))//path is right
        qDebug()<<"save";
    else qDebug()<<"not save";

 

 How can i capture a screenshot using qt code?

Developer
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Qt code to capture screen

New Contributor
Posts: 7
Registered: ‎06-29-2013
My Device: z10
My Carrier: FloatingLand

Re: Qt code to capture screen

I can read the contents of mine own app's windows with someother codes now,but i want to do more than that,I want to capture full screenshots just like when i press volumn+and-.

Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Qt code to capture screen

You can't take screenshots of other apps, if that's what you are asking. This is by design as part of our security model.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker