PictureViewer

A modal, full-screen picture viewer component More...

Import Statement: import VPlayApps 1.0
Inherits:

Item

Properties

Signals

Methods

  • bool close()
  • Item show(Window window, url image, bool scaleImage)

Detailed Description

PictureViewer is a global object with convenience methods for showing a full-screen AppImage item.

The picture viewer will show a full-screen black background and the image on top, using preserve-aspect scaling. Clicking anywhere on the screen will close the picture viewer again. The picture viewer also closes with the back button on platforms which have one (Android).

Use show() to show an image specifying a source url.

Use close() to close a currently visible picture viewer.

Use currentViewer to obtain the currently visible picture viewer Item.

Property Documentation

currentViewer : Item

The currently visible picture viewer item, if any.


[read-only] isOpen : bool

Whether the PictureViewer is currently opened.

This QML property was introduced in V-Play 2.7.0.


Signal Documentation

closed()

Is fired when the pictureViewer is closed. As PictureViewer is a singleton object, a Connections item is needed to access the signal:

 Connections {
   target: PictureViewer
   onClosed: { console.log("viewer closed") }
 }

This QML signal was introduced in V-Play 2.7.0.


opened(var image)

Is fired when the pictureViewer is opened. The image parameter holds the url of the shown image. As PictureViewer is a singleton object, a Connections item is needed to access the signal:

 Connections {
   target: PictureViewer
   onOpened: { console.log("viewer opened") }
 }

This QML signal was introduced in V-Play 2.7.0.


Method Documentation

bool close()

Closes the currently visible picture viewer. Returns true if a dialog was currently visible.


Item show(Window window, url image, bool scaleImage)

Shows a picture viewer with the specified image source url.

The window parameter should be a reference to the root QML Window, or in many cases the App object. If it is not specified, the picture viewer will not work.

scaleImage is an optional parameter and defaults to true. When set to false, the image is not scaled up to fit the screen if it is smaller. Images that are too big are always scaled down to fit the screen.

Returns the created picture viewer item if it has been opened, and no InputDialog was already opened before the call, otherwise returns the previously visible picture viewer Item.

Note: Only one PictureViewer can be shown at a time. If a dialog is currently visible, nothing happens and this dialog is returned.


Videos

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support