1

This is my QML file:

Rectangle {
  width:640;
  height:360;

  Text {
    text:qsTr("Agritrade");
    anchors.centerIn:parent;
  }//text

  MouseArea {
    anchors.fill:parent;
    onClicked: {
      Qt.quit();
    }
  }//mouse area
}

I wish to make the window borderless. How to set the properties for the Rectangle above?

jondinham
  • 8,271
  • 17
  • 80
  • 137

1 Answers1

1

It seems like impossible to set properties for Rectangle tag to make a borderless frame.

The only solution below is applicable (use 'setFlags' method):

//qml viewer
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/agritrade/main.qml"));
viewer.setFlags(Qt::Window|Qt::FramelessWindowHint);
viewer.showExpanded();
jondinham
  • 8,271
  • 17
  • 80
  • 137