[QT] QtQuick Frameless FullScreen 만드는 법

2021. 9. 1. 16:21카테고리 없음

반응형

라즈베리파이와 연결된 TFT LCD에 Frame 없는 윈도우를 만들고, 이를 FullScreen으로 출력하는 방법을 설명한다.

 

QtQuick Project의 main.qml에 아래 내용을 추가 한다.

  • flags:Qt.Window | Qt.FramelessWindowHint
  • visibility: Window.FullScreen
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Window 2.12

ApplicationWindow {
    visible: true
    width: 600
    height: 350
    title: qsTr("PNC EMULATOR")
    flags:Qt.Window | Qt.FramelessWindowHint
    visibility: Window.FullScreen

    property variant charging_mode;

    SwipeView {
        id: swipeView
        anchors.fill: parent
        currentIndex: tabBar.currentIndex

        Page1Form {
            button_start.onClicked:
            {
                if( radioButton_din.checked == true )
                {
                    charging_mode = 0;
                }
                else if( radioButton_eim.checked == true )
                {
                    charging_mode = 1;
                }
                else if( radioButton_pnc.checked == true )
                {
                    charging_mode = 2;
                }
                else if( radioButton_pncCertInstall.checked == true )
                {
                    charging_mode = 3;
                }
                else if( radioButton_pncCertificateUpdate.checked == true )
                {
                    charging_mode = 4;
                }

                evccStatusView.startCharging(charging_mode)
            }

            button_stop.onClicked:
            {
                evccStatusView.stopCharging()
            }
        }
        Page2Form {
            button_saveConfig.onClicked:
            {
                evccSettingView.saveConfiguration("SERVER_IP", textField_apiServerIp.text);
                evccSettingView.saveConfiguration("SERVER_PORT", textField_apiServerPort.text);
            }
        }

        Page3Form {

        }
    }

    footer: TabBar {
        id: tabBar
        currentIndex: swipeView.currentIndex

        TabButton {
            text: qsTr("STATUS")
        }
        TabButton {
            text: qsTr("SETTING")
        }
        TabButton {
            text: qsTr("LOG")
        }
    }
}
반응형