![]() ![]() In the Margin field, select 20 for the top anchor and 10 for the left anchor. ![]() Click Layout, and then click the top and left anchor buttons to anchor the rectangle to the top left corner of the page.In the Radius field, select 6 to create rounded corners for the rectangle.Note: If the Border field does not appear after you set the border color, try setting the border color to solid by clicking the button. ![]() In the Rectangle group, Border field, set the border width to 1.In the Border field, set the border color to #808080.In the Colors group, Rectangle field, click the button to make the rectangle transparent.In the Size field, set W and H to 64, for the rectangle size to match the image size.In the Library view, Items tab, select Rectangle, drag and drop it to the canvas, and edit its properties.In the Position field, set X to 10 and Y to 20.In the Library view, Resources tab, select states.png and drag and drop it to the canvas.In the Colors group, Rectangle field, set the color to #343434.In the Id field, enter page, to be able to reference the rectangle from other places.Select Rectangle to edit its properties.In the Navigator pane, select Text and press Delete to delete it.Click Design to open the file in Qt Quick Designer.In the Projects view, double-click the main.qml file to open it in the code editor.You can also use any other image or a QML element, instead. For example: C:\QtSDK\Examples\4.7\declarative\animation\states. To use the states.png image in your application, you must copy it to the project directory (same subdirectory as the QML file) from the examples directory in the Qt installation directory. The main view of the application displays a Qt logo in the top left corner of the screen and two empty rectangles. Qt Creator generates a default QML file that you can modify to create the main view of the application. Follow the instructions of the wizard to create a project called Transitions.Select File > New File or Project > Qt Quick Project > Qt Quick Application > Choose. ![]() The example application displays a Qt logo that moves between three rectangles on the page when you click them.įor more information about using Qt Quick Designer, see Developing Qt Quick Applications. This tutorial describes how to use the Qt Creator to implement the states and transitions example application. This tutorial uses basic elements and illustrates basic concepts of Qt Quick. args)ĪddAction(const QIcon
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |