Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt 5.15.2 - Tab refresh problem with a QGLWidget #294

Closed
K4L1M3R0 opened this issue Jan 14, 2021 · 21 comments
Closed

Qt 5.15.2 - Tab refresh problem with a QGLWidget #294

K4L1M3R0 opened this issue Jan 14, 2021 · 21 comments
Assignees
Labels

Comments

@K4L1M3R0
Copy link

Hi,
First of all, thank you for your project, it's really great!

We use your advanced docking system in a big project and every thing worked find until we needed to upgrade to Qt 5.15.2 (we were using Qt 5.11.2 before).
Now, we have some widgets that shift as if there origin was the tab widget.
AdvancedDockingSystem_widgetShift
I managed to reduce the case, using the 'simple' exemple:
Just replace the original MainWindow.cpp and MainWindow.h by the following ones
MainWindow.zip

Thanks in advance
Best regards

@githubuser0xFFFF
Copy link
Owner

Is this also reproducible with Qt6?

@K4L1M3R0
Copy link
Author

I was focused on upgrading to Qt5.15 before upgrading to Qt6 so i didn't test.
I check now and i tell you.

@K4L1M3R0
Copy link
Author

QGLWidget as been removed in Qt6, and when I use a QOpenGLWidget it works.

And i forgot to share the simple.pro:
Just need to add QT += opengl and INCLUDEPATH += %QTDIR%/include/QtOpengl

@githubuser0xFFFF githubuser0xFFFF changed the title Tab refresh problem with a QGLWidget Qt 5.15.2 - Tab refresh problem with a QGLWidget Jan 17, 2021
@K4L1M3R0
Copy link
Author

Hi,
Do you have any news about this issue ?

@githubuser0xFFFF
Copy link
Owner

Sorry, I do not have any news. I do not use Qt 5.15 yet. Do you have created a bug report in the Qt bug tracker for this issue?

@K4L1M3R0
Copy link
Author

As QGLWidget works with QDockWidgets and stop working properly when I use the Advance Docking System, I suppose they'll reject the bug and send me back here.

Any idea when you're planing to migrate?

You maybe have a clue for where to look in the meantime?

We're not in the hurry but that might come ^^.

Thanks

@githubuser0xFFFF
Copy link
Owner

According to your issue report, it worked in Qt 5.11.2 and it stopped working in Qt 5.15.2. So there must be a change or changes in the QGLWidget from 5.11.2 to 5.15.2. You could pull the Qt sources and look into the changes - maybe you find the change that causes the issue.

You could also debug into ADS to see what is different in Qt 5.11.2 and 5.15.2.

@jonaslarsson
Copy link

jonaslarsson commented Apr 9, 2021

I'm reproducing this bug in both Qt 5.15.2 and Qt 6.1.0 (beta 3) using a Qt Data Visualization which is based on Q3DSurface, which has a QWindow in the bottom.

I'm creating a widget to place inside an ADS tab with QWidget::createWindowContainer(&surface)

@jonaslarsson
Copy link

I've done some more testing with different versions of Qt, here are my results

ADS + Q3DSurface rendering offset issue
	5.8.0 			No problem
	5.9.9			No problem
	5.11.3			No problem
	5.12.0			No problem
	5.12.5			No problem
	5.12.6			No problem
	5.12.7			Rendering offset issue
	5.12.8			Rendering offset issue
	5.12.9			Rendering offset issue
	5.12.10			Rendering offset issue
	5.15.2			Rendering offset issue
	6.1.0 beta 3		Rendering offset issue

According to my tests the bug first appears in Qt 5.12.7

@jonaslarsson
Copy link

I traced the bug to the following patch in Qt 5.12.7

image

When reverting this patch the bug no longer appears in Qt 5.12.7

@githubuser0xFFFF
Copy link
Owner

githubuser0xFFFF commented Apr 21, 2021

Hi Jonas,

great job, that you traced this poblem down to this commit. I will try to find out if there is a way to fix this.

@jonaslarsson
Copy link

I think the issue may be in Qt and not in ADS. I've left a bug report at https://bugreports.qt.io/browse/QTBUG-92979

However it may be possible to do some work-around for Qt >= 5.12.7

I don't know yet why this code causes problems, but it is in QWidget::event so it can probably be overloaded and handled differently, or filtered using installEventFilter.

@githubuser0xFFFF
Copy link
Owner

Yes, this was also my idea

@cipperly
Copy link

FWIW, I had this issue also. I played around a bit and the only way that I was able to resolve the issue was to override event in CDockAreaWidget like so:

bool CDockAreaWidget::event(QEvent *e)
{
    switch (e->type())
    {
    case QEvent::PlatformSurface:
        {
            return true;
        }
        break;
    default:
        break;
    }

    return QFrame::event(e);
}

Overriding the event method in my OpenGL widget did not help for me.

@githubuser0xFFFF
Copy link
Owner

Thas sounds like a good solution that I could implement - thank you fot his hint.

@jonaslarsson
Copy link

I can confirm cipperly's patch solves the issue for me too. Great work!

@githubuser0xFFFF
Copy link
Owner

Is this patch only required for Windows or for all platforms?

@cipperly
Copy link

I have only tested on Windows myself. I have no other operating systems available to test on.

@githubuser0xFFFF
Copy link
Owner

@cipperly I implemented you solution and just pushed it to master - so I hope this issue is fixed and I close it now.

@IkkiNit
Copy link

IkkiNit commented Aug 13, 2021

Hello !
When do you think this fix will be available in a new release package ?
Thank you

@githubuser0xFFFF
Copy link
Owner

Within the next 3 months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants