Book Image

QT5 Blueprints

By : Symeon Huang
Book Image

QT5 Blueprints

By: Symeon Huang

Overview of this book

Table of Contents (17 chapters)
Qt 5 Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Making a frameless window


Similar to what we did in the previous chapter, here we don't want the borders of the system window to decorate our Qt Quick application. This is partly because it looks like a web application, which makes it seems odd with native window decorations. This job is even easier in QML than in C++. We can add the following line to Window in main.qml:

flags: Qt.Window | Qt.FramelessWindowHint

Although our RSS reader runs in a frameless style, there is no way to move it and it's difficult to close it, just like the situation in the previous chapter. Since our mouse has many duties for the categories and news ListView along with ScrollView, we can't simply use a new MouseArea element to fill the Window root. Therefore, what we're going to do is to draw our own title bar and, of course, the exit button.

To add the exit button image to the qrc file, right-click on qml.qrc, select Open in Editor, navigate to Add | Add Files, and then select close.png.

Tip

It'd be better to use...