Important: Please read the Qt Code of Conduct -

Wrong draw origin (qml)

  • 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 ?

  • Moderators

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

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

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

    The view is:

    QQuickView view;
    view.setFlags(Qt::Window | Qt::FramelessWindowHint);
    QtWin::extendFrameIntoClientArea(view, 1, 1, 1, 1);

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

  • Moderators

    @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);

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

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

Log in to reply