Giter Club home page Giter Club logo

qrhiimgui2's Issues

QML FileDialog cannot be rendered normally while imgui node is running (linux only)

As title, while opening a filedialog, if there is a imgui quickitem set to "visible", the filedialog couldn't work normally. If set all imgui node to be invisible, filedialog can work again.

It only happens for native filedialog under linux. Windows works fine, so as non-native qml based filedialog.

Environment

  • Pop!_OS 22.04; I didn't try ubuntu 22.04 but I guess it should behave the same
  • gcc13, C++20
  • Qt 6.5.3

Repro

Adding filedialog and a button to open it in simple/main.qml

import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
import ImguiExample

Item {
    Rectangle {
        color: "transparent"
        anchors.fill: parent
        Rectangle {
            id: imguiContainer
            property bool fullWin: true
            property bool useTex: false
            layer.enabled: useTex
            color: "transparent"
            width: fullWin ? parent.width : parent.width - 200
            height: fullWin ? parent.height : parent.height - 400
            x: fullWin ? 0 : 100
            y: fullWin ? 0 : 100
            z: ztimer.running ? 1 : 0
            Imgui {
                id: gui
                objectName: "gui"
                anchors.fill: parent
                SequentialAnimation on opacity {
                    id: opacityAnim
                    running: false
                    NumberAnimation { from: 1; to: 0; duration: 3000 }
                    NumberAnimation { from: 0; to: 1; duration: 3000 }
                }
            }
            Timer {
                id: ztimer
                repeat: false
                interval: 10000
            }
        }
        Rectangle {
            border.width: 2
            border.color: "black"
            y: 50
            width: 400
            height: 50
            clip: true
            TextEdit {
                id: textEdit
                anchors.fill: parent
                text: "TextEdit to test focus"
                font.pointSize: 20
                color: "blue"
            }
        }
        RowLayout {
            y: 20
            Button {
                text: "Toggle visibility"
                onClicked: gui.visible = !gui.visible
            }
            Button {
                text: "Toggle size"
                onClicked: imguiContainer.fullWin = !imguiContainer.fullWin
            }
            Button {
                text: "Animate opacity"
                onClicked: opacityAnim.running = true
            }
            Button {
                text: "Move to top for 10 sec"
                onClicked: ztimer.running = true
            }
            Button {
                text: "Toggle layer (full size only)"
                onClicked: imguiContainer.useTex = !imguiContainer.useTex
            }
            Button {
                text: "File Dialog"
                onClicked: fd.open()
            }
        }
    }
    Column {
        anchors.right: parent.right
        Text {
            text: "ImGui item visible: " + gui.visible
                  + "\ncovers entire window: " + imguiContainer.fullWin
                  + "\npart of an Item layer: " + imguiContainer.useTex
                  + "\nstacks on top of buttons/textedit: " + ztimer.running
            color: "white"
        }
    }
    FileDialog {
        id: fd
        fileMode: FileDialog.SaveFile
        nameFilters: ["proto (*.pbtxt *.pbjson *.pb)"]
        onAccepted: () => {
            console.log(selectedFile);
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.