Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML boxes with a transparent background under macOS
Forum Updated to NodeBB v4.3 + New Features

QML boxes with a transparent background under macOS

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 158 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
    #1

    Hello,

    I use qml boxes that I manage from C++.
    Everything works well but I can't display boxes with a transparent background under macOS. The boxes are displayed correctly under Linux, Windows and Android...
    Is there anything different to do with macOS?

    Thank you!

    Example of display of one of these boxes :

    engine_configuration->rootContext()->setContextProperty("anchor", anchor_configurationQML);
    
    component_configurationQML = new QQmlComponent(engine_configuration);
    component_configurationQML->loadUrl(QUrl("qrc:///qml/configuration.qml"));
    
    anchor_configurationQML->setProperty("param1", param1);
    		
    if (component_configurationQML->isReady())
    {
    	configurationQML = qobject_cast<QQuickWindow*>(component_configurationQML->create());
    
    	configurationQML->setPosition(QPoint(0, QMLdeltaY));
    
    	configurationQML->setFlags(Qt::FramelessWindowHint);
    
    	configurationQML->showNormal();
    }
    

    my qml can looks like this:

    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: main2
    
        property double trans: 0.0
        property bool mobile: anchor.Android
        property int h: anchor.Height
        property int posy: 0
        property int timeoutInterval: 50
        signal timeout
    
        modality: Qt.NonModal
    
        visible: false
        visibility: Window.Windowed
        color: "#00000000"
        opacity: trans
        x: 0
        y: 0
        width: 300
        height: h
    
        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 > 1500 ? h : 1500
    
            width: parent.width
            height: parent.height
    
            Keys.onUpPressed: scrollBar.decrease()
            Keys.onDownPressed: scrollBar.increase()
    
    ....
    
    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