Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*!
- * (c) Copyright 2017, Kongsberg Geospatial Ltd.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS", "WHERE IS" AND "AS AVAILABLE", WITHOUT
- * ANY EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS OR GUARANTEES. THE USER
- * ASSUMES ALL RISK IN THE USE OF THIS SOFTWARE, INCLUDING COPYRIGHT
- * INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. KONGSBERG GEOSPATIAL
- * LTD. EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES
- * OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF
- * MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR PURPOSE,
- * OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK (OR ANY
- * PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES.
- *
- * User agrees to defend, indemnify and hold harmless Kongsberg Geospatial Ltd.
- * from and against any claims, suits, losses, damages, liabilities, costs,
- * and expenses (including reasonable legal or attorneys' fees) resulting from
- * or relating to any use of this software. EXCEPT TO THE EXTENT REQUIRED BY
- * APPLICABLE LAW, IN NO EVENT WILL KONGSBERG GEOSPATIAL LTD. BE LIABLE TO THE
- * USER UNDER ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL,
- * PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE OR
- * OTHERWISE, EVEN IF KONGSBERG GEOSPATIAL LTD. HAS BEEN ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- *
- * This is commercial software not to be released to the open source community.
- *
- */
- import QtQuick 2.5
- import QtQuick.Controls 1.3
- import QtQuick.Layouts 1.0
- import QtQuick.Window 2.2
- Rectangle
- {
- id: mainWindow
- anchors.fill: parent
- Window {
- width: magnifier.width;
- height: magnifier.height;
- id: wnd
- Rectangle {
- id: newWindow
- anchors.fill: parent
- }
- onClosing: {
- viewportItem.state = "docked"
- }
- }
- Viewport2DItem
- {
- id: viewportItem
- anchors.fill: parent
- clip: true
- isActive: isActive
- viewportId: viewportIdentifier
- associatedViewportId: magnifier.viewportId
- z:100
- states: [
- State {
- name: "undocked"
- ParentChange { target: viewportItem; parent: newWindow; x: 10; y: 10 }
- },
- State {
- name: "docked"
- ParentChange { target: viewportItem; parent: mainWindow; x: 10; y: 10 }
- }
- ]
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.MiddleButton
- onClicked: {
- if( viewportItem.state == "docked" )
- {
- viewportItem.state = "undocked"
- wnd.visible = true
- viewportItem.parentState = 3;
- }
- else
- {
- viewportItem.state = "docked"
- wnd.visible = false
- viewportItem.parentState = 2;
- }
- }
- }
- ViewSidePanel
- {
- id: viewSidePanel
- viewportId: viewportItem.viewportId
- property bool controlsVisible: ( isActive && !editModeActive )
- visible: controlsVisible
- onControlsVisibleChanged:
- {
- if( contentPanel.showing && !controlsVisible )
- {
- contentPanel.showing = false
- }
- }
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- z: 0
- }
- SidePanel
- {
- id: sidePanel
- anchors.fill: parent
- z: 20000
- viewportId: viewportItem.viewportId
- }
- // This is the magnifier frame
- Magnifier
- {
- id : magnifier
- viewportId: viewportItem.viewportId + "Mag"
- associatedViewportId: viewportItem.viewportId
- visible: viewportItem.magnifierEnabled
- isActive: viewportItem.isActive
- // define the size of the magnifier viewport
- width : 400
- height : 400
- // define the position of the magnifier viewport
- // We place the magnifier window halfway down the right side
- y: (parent.height / 2) - (height / 2)
- anchors.right: parent.right
- }
- }//Viewport2DItem
- }//Main Window
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement