Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Wrong draw origin (qml)
Qt 6.11 is out! See what's new in the release blog

Wrong draw origin (qml)

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 2.2k Views 2 Watching
  • 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.
  • HojjatJafaryH Offline
    HojjatJafaryH Offline
    HojjatJafary
    wrote on last edited by
    #1

    I created a boarderless transparent window that works on almost systems but on some platforms with Windows 10 the drawing origin is not correct.
    The content loaded using a loader and after the content is loaded I set the position of root item to (0, 0) but no luck!
    The window buttons mouse area seems work well but the sensitive are of them are in the transparent area!
    Is this a bug in the scene graph? is there any workaround ?
    0_1506343773248_photo.png

    raven-worxR 1 Reply Last reply
    0
    • HojjatJafaryH HojjatJafary

      I created a boarderless transparent window that works on almost systems but on some platforms with Windows 10 the drawing origin is not correct.
      The content loaded using a loader and after the content is loaded I set the position of root item to (0, 0) but no luck!
      The window buttons mouse area seems work well but the sensitive are of them are in the transparent area!
      Is this a bug in the scene graph? is there any workaround ?
      0_1506343773248_photo.png

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @HojjatJafary
      show some code please.
      What is the type of your root item?
      What flags exactly do you set for the frameless border window hint?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • HojjatJafaryH Offline
        HojjatJafaryH Offline
        HojjatJafary
        wrote on last edited by
        #3

        Root item is Item with a loader that loads the content.

        Item
        {
        	id: root;
        	width: 430;
        	height: 485;
        
        	Loader
        	{
        		id: loader;
        		anchors.fill: parent;
        		source: "Window.qml";
        		asynchronous: true;
        		onLoaded:
                        {
        			loader.visible = true;    
        		}
        	}
        }
        

        The view is:

        QQuickView view;
        view.setResizeMode(QQuickView::SizeRootObjectToView);
        view.setFlags(Qt::Window | Qt::FramelessWindowHint);
        view.setColor("transparent");
        view.setSource(QUrl("RootWindow.qml"));
        QtWin::extendFrameIntoClientArea(view, 1, 1, 1, 1);
        view->show();
        
        

        I also install a native event filter to filter some of windows events to remove the border.

        raven-worxR 1 Reply Last reply
        0
        • HojjatJafaryH HojjatJafary

          Root item is Item with a loader that loads the content.

          Item
          {
          	id: root;
          	width: 430;
          	height: 485;
          
          	Loader
          	{
          		id: loader;
          		anchors.fill: parent;
          		source: "Window.qml";
          		asynchronous: true;
          		onLoaded:
                          {
          			loader.visible = true;    
          		}
          	}
          }
          

          The view is:

          QQuickView view;
          view.setResizeMode(QQuickView::SizeRootObjectToView);
          view.setFlags(Qt::Window | Qt::FramelessWindowHint);
          view.setColor("transparent");
          view.setSource(QUrl("RootWindow.qml"));
          QtWin::extendFrameIntoClientArea(view, 1, 1, 1, 1);
          view->show();
          
          

          I also install a native event filter to filter some of windows events to remove the border.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @HojjatJafary said in Wrong draw origin (qml):

          QtWin::extendFrameIntoClientArea(view, 1, 1, 1, 1);

          remove this line, it's not needed, since it actually does the exact opposite you want.

          Also try the following window flags:

          view.setFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
          

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • HojjatJafaryH Offline
            HojjatJafaryH Offline
            HojjatJafary
            wrote on last edited by
            #5

            If I remove that line the window will not have shadow!
            The strange part is that it works on almost PCs!

            1 Reply Last reply
            0
            • HojjatJafaryH Offline
              HojjatJafaryH Offline
              HojjatJafary
              wrote on last edited by
              #6

              The issue is fixed by setting QCoreApplication::setAttribute(Qt::AA_UseOpenGLES) it seems the issue is related to IntelHD driver bug.

              1 Reply Last reply
              1

              • Login

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