Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
An instance of a tablet. In toolbar mode (see Developer > UI options), the tablet's menu buttons are displayed in a toolbar and other tablet content is displayed in a dialog.Retrieve an existing tablet or create a new tablet using Tablet.getTablet.
Properties
| Name | Type | Summary | 
|---|---|---|
| name | string | A unique name that identifies the tablet. Read-only. | 
| toolbarMode | boolean | 
 | 
| landscape | boolean | 
 Note: This property isn't used in toolbar mode. | 
| tabletShown | boolean | 
 Note: This property isn't used in toolbar mode. | 
| buttons | TabletProxy.TabletButtonListModel | Information on the buttons in the tablet main menu (or toolbar in toolbar mode) for use in QML. Read-only. | 
Methods
| Name | Return Value | Summary | 
|---|---|---|
| addButton | TabletButtonProxy | Adds a new button to the tablet menu. | 
| closeDialog | None | Closes any open modal, non-modal, or message dialog, opened by Window.prompt, Window.promptAsync, Window.openMessageBox, or similar. | 
| desktopWindowClosed | None | Deprecated: This function is deprecated and will be removed. | 
| emitScriptEvent | None | Sends a message to the current web page. To receive the message, the web page's script must connect to the
 Warning: The  | 
| emitWebEvent | None | Deprecated: This function is deprecated and will be removed. | 
| getLandscape | boolean | Gets whether the tablet is displayed in landscape or portrait mode. Note: The setting isn't used in toolbar mode. | 
| gotoHomeScreen | None | Displays the tablet home screen, if the tablet is open. | 
| gotoMenuScreen | None | Displays the tablet menu. The tablet is opened if it isn't already open. | 
| gotoWebScreen | None | Opens a web app or page in addition to any current app. In tablet mode, the app or page is displayed over the top of the current app; in toolbar mode, the app is opened in a new window that replaces any current window open. If in tablet mode, the app or page can be closed using TabletProxy#returnToPreviousApp. | 
| initialScreen | None | Deprecated: This function is deprecated and will be removed. | 
| isMessageDialogOpen | boolean | Checks if the tablet has a modal, non-modal, or message dialog open. | 
| isPathLoaded | boolean | Checks if a path is the current app or dialog displayed. | 
| loadHTMLSourceOnTopImpl | None | Deprecated: This function is deprecated and will be removed. | 
| loadQMLOnTop | None | Opens a QML app or dialog in addition to any current app. In tablet mode, the app or dialog is displayed over the top of the current app; in toolbar mode, the app or dialog is opened in a new window. If in tablet mode, the app can be closed using TabletProxy#returnToPreviousApp. | 
| loadQMLOnTopImpl | None | Deprecated: This function is deprecated and will be removed. | 
| loadQMLSource | None | Opens a QML app or dialog on the tablet. | 
| loadQMLSourceImpl | None | Deprecated: This function is deprecated and will be removed. | 
| loadWebScreenOnTop | None | Opens a web app or page in addition to any current app. In tablet mode, the app or page is displayed over the top of the current app; in toolbar mode, the app is opened in a new window that replaces any current window open. If in tablet mode, the app or page can be closed using TabletProxy#returnToPreviousApp. | 
| onHomeScreen | boolean | Checks if the tablet is on the home screen. | 
| onTabletShown | None | Deprecated: This function is deprecated and will be removed. | 
| popFromStack | None | Closes a QML dialog that was displayed using pushOntoStack with a dialog implementing a QML 
 If using a QML  | 
| pushOntoStack | boolean | Displays a QML dialog over the top of the current dialog, without closing the current dialog. Use popFromStack to close the dialog. If the current dialog or its ancestors contain a QML  | 
| removeButton | None | Removes a button from the tablet menu. | 
| returnToPreviousApp | None | Closes the current app and returns to the previous app, if in tablet mode and the current app was loaded using loadQMLOnTop or loadWebScreenOnTop. | 
| returnToPreviousAppImpl | None | Deprecated: This function is deprecated and will be removed. | 
| sendToQml | None | Sends a message to the current QML page. To receive the message, the QML page must implement a function:  | 
| setLandscape | None | Sets whether the tablet is displayed in landscape or portrait mode. Note: The setting isn't used in toolbar mode. | 
Signals
| Name | Summary | 
|---|---|
| fromQml | Triggered when a message from the current QML page displayed on the tablet is received. The QML page can send a message (string or object) by calling:  | 
| screenChanged | Triggered when the tablet's screen changes. | 
| tabletShownChanged | Triggered when the tablet is opened or closed. Note: Doesn't apply in toolbar mode. | 
| toolbarModeChanged | Triggered when the tablet's toolbar mode changes. | 
| webEventReceived | Triggered when a message from the current HTML web page displayed on the tablet is received. The HTML web page can send a message by calling:  | 
Type Definitions
| TabletButtonListModel Type: object | 
|---|
| Information on the buttons in the tablet main menu (toolbar in toolbar mode) for use in QML. Has properties and functions per http://doc.qt.io/qt-5/qabstractlistmodel.html. | 
Method Details
| addButton( properties ) → {TabletButtonProxy} Returns: The button added. | ||||||
|---|---|---|---|---|---|---|
| Adds a new button to the tablet menu. Parameters
 ExampleAdd a menu button.  | 
| closeDialog( ) | 
|---|
| Closes any open modal, non-modal, or message dialog, opened by Window.prompt, Window.promptAsync, Window.openMessageBox, or similar. | 
| desktopWindowClosed( ) | 
|---|
| Deprecated: This function is deprecated and will be removed. | 
| emitScriptEvent( message ) | ||||||
|---|---|---|---|---|---|---|
| Sends a message to the current web page. To receive the message, the web page's script must connect to the
 Warning: The  Parameters
 | 
| emitWebEvent( message ) | ||||||
|---|---|---|---|---|---|---|
| Deprecated: This function is deprecated and will be removed. Parameters
 | 
| getLandscape(  ) → {boolean} Returns: trueif the tablet is displayed in landscape mode,falseif it is displayed 
    in portrait mode. | 
|---|
| Gets whether the tablet is displayed in landscape or portrait mode. Note: The setting isn't used in toolbar mode. | 
| gotoHomeScreen( ) | 
|---|
| Displays the tablet home screen, if the tablet is open. | 
| gotoMenuScreen( submenuopt ) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Displays the tablet menu. The tablet is opened if it isn't already open. Parameters
 ExampleGo to the "View" menu.  | 
| gotoWebScreen( url, injectedJavaScriptUrlopt, loadOtherBaseopt ) | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Opens a web app or page in addition to any current app. In tablet mode, the app or page is displayed over the top of the current app; in toolbar mode, the app is opened in a new window that replaces any current window open. If in tablet mode, the app or page can be closed using TabletProxy#returnToPreviousApp. Parameters
 | 
| initialScreen( url ) | ||||||
|---|---|---|---|---|---|---|
| Deprecated: This function is deprecated and will be removed. Parameters
 | 
| isMessageDialogOpen(  ) → {boolean} Returns: trueif a modal, non-modal, or message dialog is open,falseif there isn't. | 
|---|
| Checks if the tablet has a modal, non-modal, or message dialog open. | 
| isPathLoaded( path ) → {boolean} Returns: trueifpathis the current app or dialog,falseif it isn't. | ||||||
|---|---|---|---|---|---|---|
| Checks if a path is the current app or dialog displayed. Parameters
 | 
| loadHTMLSourceOnTopImpl( ) | 
|---|
| Deprecated: This function is deprecated and will be removed. | 
| loadQMLOnTop( path ) | ||||||
|---|---|---|---|---|---|---|
| Opens a QML app or dialog in addition to any current app. In tablet mode, the app or dialog is displayed over the top of the current app; in toolbar mode, the app or dialog is opened in a new window. If in tablet mode, the app can be closed using TabletProxy#returnToPreviousApp. Parameters
 | 
| loadQMLOnTopImpl( ) | 
|---|
| Deprecated: This function is deprecated and will be removed. | 
| loadQMLSource( path, resizableopt ) | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Opens a QML app or dialog on the tablet. Parameters
 | 
| loadQMLSourceImpl( ) | 
|---|
| Deprecated: This function is deprecated and will be removed. | 
| loadWebScreenOnTop( path, injectedJavaScriptURLopt ) | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Opens a web app or page in addition to any current app. In tablet mode, the app or page is displayed over the top of the current app; in toolbar mode, the app is opened in a new window that replaces any current window open. If in tablet mode, the app or page can be closed using TabletProxy#returnToPreviousApp. Parameters
 | 
| onHomeScreen(  ) → {boolean} Returns: trueif the tablet is on the home screen,falseif it isn't. | 
|---|
| Checks if the tablet is on the home screen. | 
| onTabletShown( ) | 
|---|
| Deprecated: This function is deprecated and will be removed. | 
| popFromStack( ) | 
|---|
| Closes a QML dialog that was displayed using pushOntoStack with a dialog implementing a QML 
 If using a QML  | 
| pushOntoStack( path ) → {boolean} Returns: trueif the dialog was successfully opened,falseif it wasn't. | ||||||
|---|---|---|---|---|---|---|
| Displays a QML dialog over the top of the current dialog, without closing the current dialog. Use popFromStack to close the dialog. If the current dialog or its ancestors contain a QML  Parameters
 | 
| removeButton( button ) | ||||||
|---|---|---|---|---|---|---|
| Removes a button from the tablet menu. Parameters
 | 
| returnToPreviousApp( ) | 
|---|
| Closes the current app and returns to the previous app, if in tablet mode and the current app was loaded using loadQMLOnTop or loadWebScreenOnTop. | 
| returnToPreviousAppImpl( ) | 
|---|
| Deprecated: This function is deprecated and will be removed. | 
| sendToQml( message ) | ||||||
|---|---|---|---|---|---|---|
| Sends a message to the current QML page. To receive the message, the QML page must implement a function: Parameters
 | 
| setLandscape( landscape ) | ||||||
|---|---|---|---|---|---|---|
| Sets whether the tablet is displayed in landscape or portrait mode. Note: The setting isn't used in toolbar mode. Parameters
 | 
Signal Details
| fromQml(
                        
                            
        
            message
        
                        
                    ) Returns: Signal | ||||||
|---|---|---|---|---|---|---|
| Triggered when a message from the current QML page displayed on the tablet is received. The QML page can send a message (string or object) by calling: Parameters
 | 
| screenChanged(
                        
                            
        
            type, 
        
        
            url
        
                        
                    ) Returns: Signal | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Triggered when the tablet's screen changes. Parameters
 | 
| tabletShownChanged(
                        
                    ) Returns: Signal | 
|---|
| Triggered when the tablet is opened or closed. Note: Doesn't apply in toolbar mode. | 
| toolbarModeChanged(
                        
                    ) Returns: Signal | 
|---|
| Triggered when the tablet's toolbar mode changes. ExampleReport when the system tablet's toolbar mode changes.  | 
| webEventReceived(
                        
                            
        
            message
        
                        
                    ) Returns: Signal | ||||||
|---|---|---|---|---|---|---|
| Triggered when a message from the current HTML web page displayed on the tablet is received. The HTML web page can send a message by calling: Parameters
 | 
