Bug 345002 - QML FileDialog is not displayed if using KDE as desktop environment
Summary: QML FileDialog is not displayed if using KDE as desktop environment
Status: RESOLVED DUPLICATE of bug 334963
Alias: None
Product: frameworks-frameworkintegration
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-10 09:07 UTC by Alexander Görtz
Modified: 2015-03-26 16:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Görtz 2015-03-10 09:07:08 UTC
This very simple qml file does not show a file dialog on my system when using kde with plasma 5. If I launch a xfce session it works fine. To test it I just ran qmlscene FileDialogTest.qml. I'm not sure if this is the right Component to file this report but I didn't know better.

import QtQuick 2.4
import QtQuick.Dialogs 1.2
import QtQuick.Controls 1.3
import QtQuick.Window 2.2

ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480
    visible: true
    FileDialog {
        id: fileDialog
        title: "Please choose a file"
        onAccepted: {
            console.log("You chose: " + fileDialog.fileUrls)
            Qt.quit()
        }
        onRejected: {
            console.log("Canceled")
            Qt.quit()
        }
        Component.onCompleted: visible = true
    }
}

Doesn't show 

Reproducible: Always

Steps to Reproduce:
1. Save qml file given above
2. Run the file  with qmlscene

Actual Results:  
Just a Hello World window no FileDialog

Expected Results:  
The Hello World window with a modal FileDialog
Comment 1 Marco Martin 2015-03-12 09:29:23 UTC
probably an issue in the frameworksintegration framework
Comment 2 Alexander Görtz 2015-03-12 09:39:28 UTC
I edited the Product, hopefully it's now in the right place as this is a quiet serious issue if it really affects all plasma-frameworks installations.
Comment 3 Marco Martin 2015-03-12 11:14:13 UTC
with the same qml file, it seems to be reproduceable.
interesting thing is that it seems to do something, since i see a lot of debug output about kio, but no dialog visible
Comment 4 Marco Martin 2015-03-12 11:39:20 UTC
running it in a debugger, it seems the file dialog gets created, and the qwindow is visible, at least it thinks so.

there is just no actual window to be seen on the desktop :/
Comment 5 Alexander Görtz 2015-03-12 12:20:35 UTC
This is the exact same behaivor I have on my system and it is consistent with the behaivor of the Qt system dialogs example supplied with qt 5.4. From the Qt docs I got that it first tries to create a native fileDialog then a Qt C++ file dialog and as a last fallback a Qt QML file dialog. But I couldn't find out if it is possible to force one of these to see which one is actually failing or if none of them works.
Comment 6 Marco Martin 2015-03-12 14:21:15 UTC
https://git.reviewboard.kde.org/r/122918/
Comment 7 Alexander Görtz 2015-03-12 17:49:26 UTC
Perfect, thanks for the  patch, I just applied it and rebuild my frameworkintegration package and the dialog is now displayed. But it is not closed on accept or cancle qml thinks it is still visible.

You can check that easily by adding a

Component.onDestruction: console.log("Destroying file dialog.")

to the FileDialog part. For me this will never be called. so even if I close the main window the programm would not exit because it thinks it still has and open window.
Comment 8 Marco Martin 2015-03-26 15:51:05 UTC
Git commit 22796e978d731b81454ab273ed1fa09b94727f6e by Marco Martin.
Committed on 26/03/2015 at 15:48.
Pushed by mart into branch 'master'.

function to adjust a rect to availableScreenRect

Given a geometry, it adjusts it moving it completely inside of the boundaries
of availableScreenRegion, returning the topLeft point of the adjusted
rectangle

reviewed-by: David Edmundson <david@davidedmundson.co.uk>

Change-Id: Ib58cbf521d5def1cd5bb34fe90366d4b628f8a89
Related: bug 345401

M  +101  -0    src/scriptengines/qml/plasmoid/containmentinterface.cpp
M  +7    -0    src/scriptengines/qml/plasmoid/containmentinterface.h

http://commits.kde.org/plasma-framework/22796e978d731b81454ab273ed1fa09b94727f6e
Comment 9 Marco Martin 2015-03-26 15:54:16 UTC
Git commit 3cc4e647946bf28ce6864a1287d5e57937cc679d by Marco Martin.
Committed on 26/03/2015 at 15:51.
Pushed by mart into branch 'master'.

position considering availableScreenRegion

position toolbox and applets considering availableScreenRegion
make possible to use the empty space in panels that don't have
a 100% width/height
Related: bug 345401

M  +8    -2    containments/desktop/package/contents/code/LayoutManager.js
M  +2    -9    containments/desktop/package/contents/ui/main.qml
M  +2    -2    toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
M  +27   -25   toolboxes/desktoptoolbox/contents/ui/ToolBoxRoot.qml

http://commits.kde.org/plasma-desktop/3cc4e647946bf28ce6864a1287d5e57937cc679d
Comment 10 Marco Martin 2015-03-26 16:00:10 UTC
BUG: on the wrong number
reopening
Comment 11 Lukáš Tinkl 2015-03-26 16:02:01 UTC
... and closing as a dupe, the bug is fixed nonetheless :)

*** This bug has been marked as a duplicate of bug 334963 ***