Child Window in taskbar



  • Hi, I would like, if it is possible, to show child windows in the windows task bar.

    Now when I am opening new windows, they don't appear on the taskbar, they don't have any thumbnail... I would like to choose between all my open windows on mouseover over the application taskbar icon.

    Thanks!



  • Hi,
    Just a quick input.
    I recon these are modal windows.
    Try passing 0 (zero) as parent when you create them.
    If this doesn't work, show your code where you create a window ;-)

    Cheers.



  • @Radek Thanks for answering.
    I just probe it and it works. The problem now is that when I close the parent, they aren't closed automatically :/.
    I am creating the windows dynamically:

    ...
       var component = Qt.createComponent("MyStyledWindow.qml");
       if (component.status === Component.Ready) {
       var dialog = component.createObject(0, { title: "My Window", properties: theProperty ...});
       dialog.show();
    }
    

    In the closing event of my window, I am killing the object itself because I am executing a webview inside the new window and I want it to finish.



  • Hmm I haven't played with QtQuick yet so I don't if/how you can do that. Sry I'm limited here :/
    Could you store the "dialog" variable somewhere where you could also kill it when closing your main window?



  • That is the problem. Right now, I am not taking care of that, I am just setting the parent, and it does automatically everything.
    I cannot believe there is no other way to get the thumbnail for a window...

    Yes, I can implement it and when parent gets close, close the window... But... (you know...)

    (Although I could write the component and set the parent to zero (don't know if that'd work), but I do need to create dynamically the object because the webpage connects to a webserver and I don't want the webPage to be connected every time)



  • For now I am storing as you said but see what happened to me...
    I was creating the windows inside an item. Item does not have closing event. I was writing the destruction inside the onDestruction of the item. As there still was a window open in the application, when you closed the main window, the application did not close... So I had to refer to the main window and connect its closing signal to one function inside my item into the Component.onComplete to destroy the windows... Too much work for today only for showing a thumbnail :(


  • Qt Champions 2016

    Hi
    I dont know QML but in c++ its possible to use
    http://doc.qt.io/qt-4.8/qapplication.html#topLevelWidgets
    to close such parent less windows in an easy manner.
    (compared to storing the pointer)



  • @mrjj I need to do it in qml because it is from there where I am launching the windows.
    What surprised me was qml Window does not have a property to show the taskicon... In the end, it is a window! Nor a pop-up neither dialog...


  • Qt Champions 2016

    @ars1614

    Well i think the rule is that only top level windows are shown.
    If a window has a parent,its not top level.
    Some of it maybe due to the platform etc.
    But is a flag if possible would be very nice :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.