Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Background transparency QQuickWindow with QML boxes on iOS
Forum Updated to NodeBB v4.3 + New Features

Background transparency QQuickWindow with QML boxes on iOS

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 214 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Francky033
    wrote on last edited by Francky033
    #1

    Hello,

    On Windows, Linux, Android and macOS with Qt 5.15.5, I can display transparency in qml boxes using the command

    QQuickWindow::setDefaultAlphaBuffer(true);

    However, it doesn't work on ios... I always get a black background...

    Did I forget something?

    Thanks to all of you !

        ```
        engine_configuration->rootContext()->setContextProperty("anchormenuandroid", anchor_menu_iosQML);
    
    component_menu_iosQML = new QQmlComponent(engine_configuration);
    
    component_menu_iosQML->loadUrl(QUrl("qrc:///qml/menu_android.qml"));
    
    if (component_menu_iosQML->isReady())
    {
           menuiosQML = qobject_cast<QQuickWindow*>(component_menu_iosQML->create());
    	
           menuiosQML->setWidth(300);
           menuiosQML->setHeight(200);
           menuiosQML->setPosition(500, 600);
    
           menuiosQML->setFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool);
    	
           menuiosQML->showNormal();
      }
    

    // qml

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.15
    import QtQuick.Controls.Material 2.15
    import MyLib 1.0
    
    Window {
        id: main
    
        property double coef: anchor.Coef
        property int timeoutInterval: 50
        signal timeout
    
        modality: Qt.NonModal
    
        color: "#00000000"
        opacity: 1.0
        x: 0
        y: 0
        width: 200
    
        height: 200
    
        visible: true
    
        Flickable {
            id: flickableMain
            anchors.rightMargin: 0
            anchors.leftMargin: 0
            anchors.topMargin: 0
            anchors.bottomMargin: 0
            anchors.fill: parent
            boundsBehavior: Flickable.StopAtBounds
    
            contentWidth: parent.width
            contentHeight: h > 1000 ? h : 1000
    
            focus: true
    
            Keys.onUpPressed: scrollBar.decrease()
            Keys.onDownPressed: scrollBar.increase()
            Keys.onPressed: {
                if (event.key === Qt.Key_Back) {
                    anchor.sendMouse(-700)
                }
            }
    
            MouseArea {
                anchors.fill: parent
    
                onMouseXChanged: {
                    anchor.sendMouse(mouseX)
                }
    
                onReleased: {
                    anchor.sendMouse(-500)
                }
    
                onPressAndHold: {
                    anchor.sendMouse(mouseX)
                }
            }
    
            Column {
                id: column1
                anchors.left: parent.left
                anchors.right: parent.right
                anchors.top: parent.top
                anchors.rightMargin: 20
                anchors.leftMargin: 10
                anchors.topMargin: 40
                anchors.bottomMargin: 20
    
                antialiasing: true
                spacing: 30
    
                x: 0
    
                width: parent.width
                height: 950
    
                Rectangle {
    
    ....
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved