View Single Post
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#31
Some more changes:
  • QDeclarativeSettingsPlugin making QSettings API accessible via QML.
  • platformWindow context now has a takeScreenShot() method, which uses the static QPixmap::grabWidget() method to take a screenshot and save it to the specified filename.

Example:

Code:
Page {
    id: root

    Settings {
        id: settings

        organizationName: "Me"
        applicationName: "MyApplication"
    }

    Button {
        id: button
       
        anchors.centerIn: parent
        text: "Screenshot"
        onClicked: platformWindow.takeScreenShot(settings.value("screenShotFolder", "/home/user/MyDocs/Images/") + "screenshot.png") // x, y, width, height, scaledWidth and scaledHeight can also be specified.
    }
}
First example application is a web browser with support for tabbed browsing and bookmarks:







https://github.com/marx1an/qt-compon...amples/browser

Pretty basic atm, but I'll add some more features later.
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub

Last edited by marxian; 2013-01-28 at 00:26. Reason: s/organisation/organization
 

The Following 3 Users Say Thank You to marxian For This Useful Post: