Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sayter99 opened this issue May 16, 2024 · 0 comments

Comments

@Sayter99
Copy link

Sayter99 commented May 16, 2024

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);
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant