Warning, /graphics/krita/libs/libqml/plugins/components/Page.qml is written in an unsupported language. File is not indexed.

0001 /****************************************************************************
0002 **
0003 ** SPDX-FileCopyrightText: 2011 Nokia Corporation and /or its subsidiary(-ies).
0004 ** All rights reserved.
0005 ** Contact: Nokia Corporation (qt-info@nokia.com)
0006 **
0007 ** This file is part of the Qt Components project.
0008 **
0009 ** $QT_BEGIN_LICENSE:BSD$
0010 ** SPDX-License-Identifier: BSD-3-Clause
0011 **
0012 ****************************************************************************/
0013 
0014 /**Documented API
0015 Inherits:
0016         Item
0017 
0018 Imports:
0019         QtQuick 1.1
0020         everything in the same dir which are version 0.1
0021 
0022 Description:
0023         Defines the content of a piece of the user interface, it's meant to be loaded by a PageStack or TabGroup element.
0024         The typical use can be in small plasmoids or  mobile devices where the whole screen is a series of interchangeable and flickable pages, of which the user navigates across.
0025 
0026 
0027 Properties:
0028         * int status:
0029         The current status of the page. It can be one of the following values:
0030         PageStatus.Inactive (default) - the page is not visible.
0031         PageStatus.Activating - the page is becoming to the active page.
0032         PageStatus.Active - the page is the currently active page.
0033         PageStatus.Deactivating - the page is becoming to inactive page.
0034 
0035         * PageStack pageStack:
0036         The page stack that this page is owned by.
0037 
0038         * int orientationLock:
0039         Sets the orientation for the Page
0040 
0041         * Item tools:
0042         Defines the toolbar contents for the page. If the page stack is set up using a toolbar instance, it automatically shows the currently active page's toolbar contents in the toolbar. The default value is null resulting in the page's toolbar to be invisible when the page is active.
0043 **/
0044 
0045 import QtQuick 2.3
0046 
0047 import "."
0048 
0049 Item {
0050     id: root
0051 
0052     // The status of the page. One of the following:
0053     //      PageStatus.Inactive - the page is not visible
0054     //      PageStatus.Activating - the page is transitioning into becoming the active page
0055     //      PageStatus.Active - the page is the current active page
0056     //      PageStatus.Deactivating - the page is transitioning into becoming inactive
0057     property int status: 0;
0058 
0059     property Item pageStack
0060 
0061     property Item tools: null
0062 
0063     visible: false
0064 
0065     width: visible && parent ? parent.width : internal.previousWidth
0066     height: visible && parent ? parent.height : internal.previousHeight
0067 
0068     onWidthChanged: internal.previousWidth = (visible ? width : internal.previousWidth)
0069     onHeightChanged: internal.previousHeight = (visible ? height : internal.previousHeight)
0070 
0071     // This is needed to make a parentless Page component visible in the Designer of QtCreator.
0072     // It's done here instead of binding the visible property because binding it to a script
0073     // block returning false would cause an element on the Page not to end up focused despite
0074     // specifying focus=true inside the active focus scope. The focus would be gained and lost
0075     // in createObject.
0076     Component.onCompleted: if (!parent) visible = true
0077 
0078     QtObject {
0079         id: internal
0080         property int previousWidth: 0
0081         property int previousHeight: 0
0082     }
0083 }