Theme

A global object for defining app-wide styling attributes More...

Import Statement: import VPlayApps 1.0
Inherits:

Item

Properties

Methods

Detailed Description

All apps created with V-Play Apps ship with a default style which follows platform-specific attributes.

For most flexibility it's however also possible to overwrite these styles by your own. The most basic example is changing the background color of a navigation bar within a NavigationStack item.

To change a theme-able property implement the App::initTheme signal handler and overwrite the values like in this example:

 import VPlayApps 1.0

 App {
   onInitTheme: {
     // Set the navigation bar background to a shiny blue
     Theme.navigationBar.backgroundColor = "blue"

     // Set the global text color to a dark blue
     Theme.colors.textColor = "#000080"
   }
 }

Note: You can change theme-able properties at any given time from within your app's code, not only in the App::initTheme handler. The recommended approach is however to use the given handler for setting a default style at app start.

Property Documentation

appButton : ThemeAppButton

You can override sub-properties of the appButton property to set the global appearance of AppButton items.

Following properties can be overridden:


appCheckBox : ThemeAppCheckBox

You can override sub-properties of the appCheckBox property to set the global appearance of AppCheckBox items. See the documentation of the ThemeAppCheckBox type for an overview of available properties.

This QML property was introduced in V-Play 2.7.1.


[read-only] backgroundColor : color

Read-only alias for colors.backgroundColor.


boldFont : QtObject

Override this property to change the app-wide default bold font. It can either be set to a FontLoader object, or a simple QtObject with a name property, defining the used font name.

If not changed, the default font of an empty Text item is used.


colors : ThemeColors

You can override sub-properties of the colors property to change global colors for the various AppSDK controls.

Following properties can be overridden:


[read-only] controlBackgroundColor : color

Read-only alias for colors.controlBackgroundColor.

This QML property was introduced in V-Play 2.8.2.


[read-only] disabledColor : color

Read-only alias for colors.disabledColor.


[read-only] disclosureColor : color

Read-only alias for colors.disclosureColor.


[read-only] dividerColor : color

Read-only alias for colors.dividerColor.


[read-only] inputCursorColor : color

Read-only alias for colors.inputCursorColor.

This QML property was introduced in V-Play 2.7.0.


[read-only] inputSelectionColor : color

Read-only alias for colors.inputSelectionColor.

This QML property was introduced in V-Play 2.7.0.


[read-only] isAndroid : bool

Readonly property returning true if the app is currently running on an Android device.

You can use this property to change your app's style or logic depending on the underlying platform. The following example shows how to use a different navigation bar color for Android devices:

 import VPlayApps 1.0

 App {
   onInitTheme: {
     // Set the navigation bar background to a shiny blue on Android only
     Theme.navigationBar.backgroundColor = Theme.isAndroid ? "blue" : "red"
   }
 }

[read-only] isDesktop : bool

Readonly property returning true if the app is currently running on an desktop operating system, i.e. Windows, macOS (Mac OS X) or Linux.

You can use this property to change your app's style or logic depending on the underlying platform.


[read-only] isIos : bool

Readonly property returning true if the app is currently running on an iOS device.

You can use this property to change your app's style or logic depending on the underlying platform. The following example shows how to use a different navigation bar color for iOS devices:

 import VPlayApps 1.0

 App {
   onInitTheme: {
     // Set the navigation bar background to a shiny blue on iOS only
     Theme.navigationBar.backgroundColor = Theme.isIos ? "blue" : "red"
   }
 }

[read-only] isLinux : bool

Readonly property returning true if the app is currently running on a Linux operating system.

You can use this property to change your app's style or logic depending on the underlying platform. The following example shows how to use a different navigation bar color for Linux devices:

 import VPlayApps 1.0

 App {
   onInitTheme: {
     // Set the navigation bar background to a shiny blue on Linux only
     Theme.navigationBar.backgroundColor = Theme.isLinux ? "blue" : "red"
   }
 }

[read-only] isOSX : bool

Readonly property returning true if the app is currently running on a macOS (Mac OS X) operating system.

You can use this property to change your app's style or logic depending on the underlying platform. The following example shows how to use a different navigation bar color for macOS devices:

 import VPlayApps 1.0

 App {
   onInitTheme: {
     // Set the navigation bar background to a shiny blue on macOS only
     Theme.navigationBar.backgroundColor = Theme.isOSX ? "blue" : "red"
   }
 }

[read-only] isPortrait : bool

Readonly property returning whether the app is currently in portrait mode. You can use this property to change your app's style based on the interface orientation. It refers to the App::portrait property of your application.

This QML property was introduced in V-Play 2.6.2.


[read-only] isWinPhone : bool

Readonly property returning true if the app is currently running on a Windows Phone device.

You can use this property to change your app's style or logic depending on the underlying platform. The following example shows how to use a different navigation bar color for Windows Phone devices:

 import VPlayApps 1.0

 App {
   onInitTheme: {
     // Set the navigation bar background to a shiny blue on Windows Phone only
     Theme.navigationBar.backgroundColor = Theme.isWinPhone ? "blue" : "red"
   }
 }

[read-only] isWindows : bool

Readonly property returning true if the app is currently running on a Windows operating system.

You can use this property to change your app's style or logic depending on the underlying platform. The following example shows how to use a different navigation bar color for Windows devices:

 import VPlayApps 1.0

 App {
   onInitTheme: {
     // Set the navigation bar background to a shiny blue on Windows only
     Theme.navigationBar.backgroundColor = Theme.isWindows ? "blue" : "red"
   }
 }

listItem : ThemeSimpleRow

You can override sub-properties of the listItem property to set the default appearance of SimpleRow list items. These items are the default component for ListView::delegate when using a ListPage.

The following properties can be overridden:

This QML property was introduced in V-Play 2.6.2.


listSection : ThemeSimpleSection

You can override sub-properties of the listSection property to set the default appearance of ListView sections based on the SimpleSection type. This component is the default type for ListView::section.delegate when using a ListPage.

See the documentation of the ThemeSimpleSection type for an overview of available properties.

This QML property was introduced in V-Play 2.6.2.


listSectionCompact : ThemeSimpleSection

You can override sub-properties of the listSectionCompact property to set the default appearance of ListView sections based on the SimpleSection type, if SimpleSection::style.compactStyle is set to true.

See the documentation of the ThemeSimpleSection type for an overview of available properties.

This QML property was introduced in V-Play 2.6.2.


You can override sub-properties of the navigationAppDrawer property to set the global appearance of Navigation's AppDrawer items.

Following properties can be overridden:

  • navigationAppDrawer.backgroundColor: The background color of the app drawer.
  • navigationAppDrawer.textColor: The text color of the text in the row.
  • navigationAppDrawer.activeTextColor: The text color of the text in the row when the item is active.
  • navigationAppDrawer.rowSpacing: The spacing on top and bottom of the text labels within the row.
  • navigationAppDrawer.dividerHeight: The height of the row divider line.
  • navigationAppDrawer.dividerColor: The color of the row divider line.
  • navigationAppDrawer.itemBackgroundColor: The background color of the navigation items.
  • navigationAppDrawer.itemSelectedBackgroundColor: The background color of a selected item.

This QML property was introduced in V-Play 2.6.1.


You can override sub-properties of the navigationBar property to set the global appearance of NavigationBar items (e.g. within a NavigationStack).

Following properties can be overridden:

  • navigationBar.titleColor: The title color defines the font color of the displayed title label.
  • navigationBar.backgroundColor: The background color fills the NavigationBar's background.
  • navigationBar.dividerColor: The divider is displayed as a thin line at the very bottom of the navigation bar. Override the divider color to customize the look of the divider.
  • navigationBar.itemColor: The item color defines the NavigationBar's left and right item color. By default this property matches the title's color.
  • navigationBar.titleTextFont: Specifies the font for the NavigationBar's title text.
  • navigationBar.titleTextSize: Size of the title text, in pixels.
  • navigationBar.titleTextBold: Whether the title text is displayed bold.
  • navigationBar.titleAlignLeft: Whether the title should be left aligned.
  • navigationBar.titleAlignBottom: Whether the title should be bottom aligned.
  • navigationBar.titleLeftMargin: Adds an additional margin to the left of the navigationBar's title item if it is left-aligned.
  • navigationBar.titleBottomMargin: Specifies a margin from the bottom of the navigation bar to the title text, unless the text is vertically centered.
  • navigationBar.height: Height of the navigation bar, in pixels.
  • navigationBar.defaultBarItemPadding: Default left and right padding of NavigationBarItems.
  • navigationBar.defaultIconSize: Default size of icons in the navigation bar.

normalFont : QtObject

Override this property to change the app-wide default font. It can either be set to a FontLoader object, or a simple QtObject with a name property, defining the used font name.

If not changed, the default font of an empty Text item is used.


[read-only] placeholderTextColor : color

Read-only alias for colors.placeholderTextColor.


platform : string

This property contains a string representing the current platform the app runs on.

It can also be changed to simulate running on a different platform, for testing purposes.

It has one of the following values:

  • "android"
  • "ios"
  • "winphone"
  • "linux"
  • "osx"
  • "windows"

[read-only] secondaryBackgroundColor : color

Read-only alias for colors.secondaryBackgroundColor.

This QML property was introduced in V-Play 2.6.2.


[read-only] secondaryTextColor : color

Read-only alias for colors.secondaryTextColor.


[read-only] selectedBackgroundColor : color

Read-only alias for colors.selectedBackgroundColor.

This QML property was introduced in V-Play 2.6.2.


[read-only] statusBarHeight : int

Read-only property to retrieve the status bar height of the device, in pixels. If the status bar is hidden, 0 is returned.

This QML property was introduced in V-Play 2.6.1.


[read-only] statusBarStyle : int

Read-only alias for colors.statusBarStyle.


tabBar : ThemeTabControl

You can override sub-properties of the tabBar property to set the global appearance of tabs created with Navigation, TabControl or AppTabBar.

Following properties can be overridden:

  • tabBar.titleColor: The title color defines the font color of the currently selected title label and the icon. Only applies for main-tabs based on NavigationItem.
  • tabBar.titleOffColor: The off color defines the font color of the title label and the icon tabs that are not selected. Only applies for main-tabs based on NavigationItem.
  • tabBar.subTabTitleColor: The title color defines the font color of the currently selected title label and the icon. Only applies for sub-tabs based on AppTabButton.
  • tabBar.subTabTitleOffColor: The off color defines the font color of the title label and the icon of tabs that are not selected. Only applies for sub-tabs based on AppTabButton.
  • tabBar.backgroundColor: The background color fills the TabControl's background.
  • tabBar.dividerColor: The divider is displayed as a thin line at the very top of the tab bar. Override the divider color to customize the look of the divider.
  • tabBar.height: Height of the tab bar.
  • tabBar.iconSize: The size of the tab icons used for the tab bar.
  • tabBar.showIcon: Whether the specified icon should be shown within a tab.
  • tabBar.textSize: The size of the title displayed for each tab. Only applies for main-tabs based on NavigationItem.
  • tabBar.subTabTextSize: The size of the title displayed for each tab. Only applies for sub-tabs based on AppTabButton.
  • tabBar.fontCapitalization: The Text::font.capitalization setting of the title-
  • tabBar.fontBold: Whether the tab title is displayed bold.
  • tabBar.textMaximumLineCount: The Maximum line count for the title text of each tab.
  • tabBar.markerColor: The color of the bottom line that marks the active tab on Android.

[read-only] textColor : color

Read-only alias for colors.textColor.


[read-only] tintColor : color

Read-only alias for colors.tintColor.


Method Documentation

reset()

Reset the default Theme. This discards any changes made to the Theme.


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
Sign up for Free and start developing right away!
I want to make Games
I want to make Apps
Game Development
Cross-Platform, Any Resolution

Use one IDE to deploy to all supported platforms, including iOS and Android, from a single code base.

Support all screen resolutions, aspect ratios and sizes with auto-adapting UI elements, smart scene scaling and memory efficient asset selection.

Learn More

V-Play ranked #1 at research2guidance cross-platform tool benchmarking 2014 by 2188 developers comparing 40 leading tools.

Multiplayer

V-Play Multiplayer supports both real-time and turn-based gameplay, so you can use it to make many different types of cross-platform multiplayer games. It's perfect for making player-vs-player games like 'Words with Friends' or games for a large amount of players, such as 'Clash of Clans'.

Learn More Video

Highscores & Achievements

The V-Play Game Network is a cross-platform gaming service that allows players around the world to compare game highscores and achievements. Players can also challenge each other across multiple platforms and share their progress on Facebook.

Learn More

QML & JavaScript

Qt Meta Language is a highly intuitive reactive language, which is super easy to learn, yet it's extremely powerful and flexible. Mix it with JavaScript to create awesome stuff, with just a few lines of code.

import QtQuick 2.0
import VPlay 2.0

GameWindow {
  Scene {
    
    SimpleButton {
      anchors.centerIn: parent
      text: "Press Me"
      onClicked: {
        console.debug("Wow you pressed me!")
      }
    }
  }
}

Learn More

Monetize & Analyze

With V-Play, you can use many 3rd party services for ads, in-app purchases, analytics and more, with just a few lines of code. All of these plugins work cross-platform, which allows you to maintain a single code base.

Learn More

Level Editor

The LevelEditor can be used during development to create and modify levels for your game, which you can then bundle in your final publishing build. Additionally, you can also integrate the in-game level editor to your published game and let your gamers create new levels.

Learn More Video

Card Game like UNO, Hearthstone or Poker

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/OneCard/OneCard.pro

Match-3 like Candy Crush Saga

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/JuicySquash/JuicySquash.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/JuicySquashAdvanced/JuicySquashAdvanced.pro

Puzzle like 2048 or Threes!

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/2048/2048.pro

Casino like Big Win Slots

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/FlaskOfRum/FlaskOfRum.pro

Side Scroller like Jetpack Joyride or Flappy Bird

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/FlappyBird/FlappyBird.pro

Tower Defense like Castle Defense or Bloons TD

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/Squaby/Squaby.pro

Falldown & Jump like Doodle Jump or Mega Jump

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/ChickenOutbreak/ChickenOutbreak.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/ChickenOutbreak2/ChickenOutbreak2.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/DoodleJump/DoodleJump.pro

Platformer like Super Mario or Lep's World

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/Platformer/Platformer.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/PlatformerWithLevelEditor/PlatformerWithLevelEditor.pro

Action like Angry Birds, Fruit Ninja, Cut the Rope

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/StackTheBoxWithCommunityEditor/StackTheBoxWithCommunityEditor.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/BalloonPop/BalloonPop.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/CarChallenge/CarChallenge.pro

Arcade like Arkanoid or Space Invaders

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/demos/ZombieBreak/ZombieBreak.pro

Community like Super Mario Maker or Minecraft

We got a demo game for you!

The V-Play SDK includes an open-source demo for this game genre. You can use its source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/examples/Squaby/Squaby.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/StackTheBoxWithCommunityEditor/StackTheBoxWithCommunityEditor.pro

<Path to V-PlaySDK>/Examples/V-Play/demos/PlatformerWithLevelEditor/PlatformerWithLevelEditor.pro

Any other Idea? let us know how we can help you

You are looking for another demo?

The V-Play SDK includes many open-source demos for different game genres. You can use their source code and build your game in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

If you do not find your game genre in this list and wonder if V-Play is the right choice, just contact us, we are happy to help!

Contact Us

App Development
Better Apps, Less Effort

Develop feature-rich, cross-platform mobile apps from a single code base.

V-Play apps look, feel and perform exactly like native iOS, Android and Desktop apps. With less code & much faster development time.

Learn More Highlights Video

V-Play ranked #1 at research2guidance cross-platform tool benchmarking 2014 by 2188 developers comparing 40 leading tools.

Save Time, Code & Money

Save up to 90% source code with V-Play, compared to frameworks like Xamarin, Titanium, React Native and others.

Learn More

QML & JavaScript

Qt Meta Language is a highly intuitive reactive language, which is super easy to learn, yet it's extremely powerful and flexible. Mix it with JavaScript to create awesome stuff, with just a few lines of code. QML also allows you to easily create smooth and complex animations.

import QtQuick 2.0
import VPlayApps 2.0

App {
  Page {
    
    AppButton {
      anchors.centerIn: parent
      text: "Press Me"
      onClicked: {
        console.debug("Wow you pressed me!")
      }
    }
  }
}

Learn More

Monetize & Analyze

With V-Play, you can use many 3rd party services for ads, in-app purchases, analytics and more, with just a few lines of code. All of these plugins work cross-platform, which allows you to maintain a single code base.

Learn More

Native Sensors & More

V-Play Apps harness the power of Qt, the leading cross-platform development framework used by over 1,000,000 developers.

This gives your access to native device features like sensors, camera, file system as well as multimedia, networking, localization and much more.

Learn More

Responsive Design

V-Play has built in responsive design capabilities, you can target phones and tablets with the same source code.

Learn More

Highly Extensible

You have existing JavaScript, C++ or native code? You want to add any 3rd party SDK that we do not offer already?

No worries, you can add any JS, C++, Java or Objective-C code to your project.

Learn More

Component Showcase App shows the most important V-Play features and components

We got a demo app for you!

The V-Play SDK includes an open-source demo for this app type. You can use its source code and build your app in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/appdemos/showcase/Showcase.pro

Qt World Summit Conference App a full-featured conference management app made by V-Play

We got a demo app for you!

The V-Play SDK includes an open-source demo for this app type. You can use its source code and build your app in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/appdemos/qtws2016/QtWS2016.pro

Twitter App how to build layouts like in the official Twitter app for iOS and Android

We got a demo app for you!

The V-Play SDK includes an open-source demo for this app type. You can use its source code and build your app in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/appdemos/twitter/Twitter.pro

Maps App displays free bikes or boxes at bike stations for Vienna's bike sharing service Citybike Wien

We got a demo app for you!

The V-Play SDK includes an open-source demo for this app type. You can use its source code and build your app in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/appdemos/maps/Maps.pro

Messaging App demonstrates how to create the UI of a Facebook Messenger like app

We got a demo app for you!

The V-Play SDK includes an open-source demo for this app type. You can use its source code and build your app in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/appdemos/messaging/Messaging.pro

Weather App how to include powerful animations into your user interface

We got a demo app for you!

The V-Play SDK includes an open-source demo for this app type. You can use its source code and build your app in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play.

<Path to V-PlaySDK>/Examples/V-Play/appdemos/waether/Weather.pro

Any other Idea? let us know how we can help you

You are looking for another app demo?

The V-Play SDK includes many open-source demos for different app types. You can use their source code and build your app in record time. After installing V-Play, you can simply open the .pro file with Qt Creator, the development environment used for V-Play..

If you do not find your app type in this list and wonder if V-Play is the right choice, just contact us, we are happy to help!

Contact Us