Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to make qml window embedded in desktop?
Forum Updated to NodeBB v4.3 + New Features

How to make qml window embedded in desktop?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 531 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    senmx
    wrote on 21 May 2020, 07:58 last edited by senmx
    #1

    The effect I need is: Even showing or hiding (Win+D) the desktop does not affect it.

    import QtQuick 2.12
    import QtQuick.Window 2.12
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
        color: "transparent"
        flags: Qt.FramelessWindowHint
    
        Rectangle {
            anchors.fill: parent
            color:"transparent"
            Column {
                Text {
                    text:"hello world"
                    color: "white"
                    font.pointSize: 60
                }
            }
        }
    }
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      Markkyboy
      wrote on 21 May 2020, 10:17 last edited by
      #2

      I have 2 desktop apps created with QML, both of them hide when doing 'Win+D'. Both apps are using only 'Qt.FramelessWindowHint'. In fact, they hide from desktop whether run from SDK or desktop.

      Perhaps there is a .dll missing from your apps deployment folder?

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      S 1 Reply Last reply 21 May 2020, 13:39
      0
      • M Markkyboy
        21 May 2020, 10:17

        I have 2 desktop apps created with QML, both of them hide when doing 'Win+D'. Both apps are using only 'Qt.FramelessWindowHint'. In fact, they hide from desktop whether run from SDK or desktop.

        Perhaps there is a .dll missing from your apps deployment folder?

        S Offline
        S Offline
        senmx
        wrote on 21 May 2020, 13:39 last edited by
        #3

        @Markkyboy Thanks. It seems that I did not express the problem clearly, and revised the problem again. I need to embed the window in the desktop.

        M 1 Reply Last reply 21 May 2020, 14:50
        0
        • S senmx
          21 May 2020, 13:39

          @Markkyboy Thanks. It seems that I did not express the problem clearly, and revised the problem again. I need to embed the window in the desktop.

          M Offline
          M Offline
          Markkyboy
          wrote on 21 May 2020, 14:50 last edited by
          #4

          So,........you want to embed a Window (made with QML) in to your Windows desktop?, if so, you are then saying that you don't want your embedded window to be affected (remain showing) when Win+D is used?

          Don't just sit there standing around, pick up a shovel and sweep up!

          I live by the sea, not in it.

          S 1 Reply Last reply 22 May 2020, 00:51
          0
          • M Markkyboy
            21 May 2020, 14:50

            So,........you want to embed a Window (made with QML) in to your Windows desktop?, if so, you are then saying that you don't want your embedded window to be affected (remain showing) when Win+D is used?

            S Offline
            S Offline
            senmx
            wrote on 22 May 2020, 00:51 last edited by senmx
            #5

            @Markkyboy bingo, I found the following solution:

            BOOL Widget::enumUserWindowsCB(HWND hwnd,LPARAM lParam)
            {
                long wflags = GetWindowLong(hwnd, GWL_STYLE);
                if(!(wflags & WS_VISIBLE)) return TRUE;
            
                HWND sndWnd;
                if( !(sndWnd=FindWindowEx(hwnd, NULL, L"SHELLDLL_DefView", NULL)) ) return TRUE;
                HWND targetWnd;
                if( !(targetWnd=FindWindowEx(sndWnd, NULL, L"SysListView32", L"FolderView")) ) return TRUE;
            
                HWND* resultHwnd = (HWND*)lParam;
                *resultHwnd = targetWnd;
                return FALSE;
            }
            
            
            HWND Widget::findDesktopIconWnd()
            {
                HWND resultHwnd = NULL;
                EnumWindows((WNDENUMPROC)enumUserWindowsCB, (LPARAM)&resultHwnd);
                return resultHwnd;
            }
            

            but the compiler not found BOOL, LPARAM

            1 Reply Last reply
            0

            1/5

            21 May 2020, 07:58

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved