QT QML Call new page and exit new page back to original page

Source: Internet
Author: User

Recently learned QT programming, found that the data is very small. So here's a record hoping someone will be able to use it later.

QML is a very flashy thing to make a beautiful interface. Well understood, to invoke another page on one page directly using the

var object=qt.createcomponent ("Lockfrm.qml"). CreateObject (Mainrect)

This will produce a new page, object is this page, you can directly use OBJECT.Z = 4 and other modified page properties. Qt.createcomponent ("LOCKFRM.QML") this produces a component control

The following. CreateObject (Mainrect) is the production of this page is displayed, Mainrect is a control on the page, the call after the new page will overwrite the original Mainrect control, call object.z = 4 is to show my newly generated control to the top level.

You can use Lockrect.destroy () when you want to exit the newly created page, and LockRect is the outermost rectangle inside the lockfrm.qml. So we just quit.

When this new page is called, the buttons that are defined on the old page of the new page also work. Only overlapping areas will have buttons corresponding to the upper layer. You can create a new key area in the page to screen out the underlying button corresponding Mousearea{anchors.fill:parent}//For the screen interface mouse events

When using the Flickable control to display, you can pull the display, but the large picture will appear outside the control, you can use the clip:true so that it does not exceed the Flickable control definition of the box.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.