2

I create a Qt6 QML application with multiple windows. I have the main screen (an ApplicationWindow) and from there I open (modal) another Window. The two windows are in different Qml files and the first one is set as a parent for the second one. Everything nice and fine.

Now, the problem that I do have is that I have two entries in the Windows OS's taskbar. And I do not want that. I want only one entry for the application.

The second window is an ApplicationWindow, with modality set to Qt.ApplicationModal and no flags set.

I tried the flags: Qt.SubWindow (not working), Qt.Tool (does the taskbar thing but I do not have the standard window buttons: close, minimize, maximize), and those single or in combination with the other flags like WindowMinMaxButtonsHint & WindowCloseButtonHint.

Does anyone know how to achieve this behavior?

The MainScreen.qml looks like this:

import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts

ApplicationWindow {
    id: mainScreen
    visible: true
    visibility: Window.Maximized
    ... 
}

The SecondScrren.qml looks like this:

import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts

ApplicationWindow {
...
    modality: Qt.ApplicationModal
    visibility: Window.Maximized
...
}

Thanks!

mtb
  • 1,350
  • 16
  • 32

0 Answers0