MantisBT - Community
View Issue Details
0027922Community[OCCT] OCCT:Samplespublic2016-09-29 20:052020-12-02 17:11
[OCCT] 7.0.0 
[OCCT] 7.5.0[OCCT] 7.5.0 
Not required
0027922: Samples - Qt sample document window display problem
Please see this thread in the user forum for more details and a link to a video demonstrating the problem: [^]

If the Qt Bottle Tutorial or Import / Export samples are built on Linux, there is a problem with the display in the document window when it is resized with the mouse. After resizing, the display will continuously shrink. Maximizing the document window will restore the display to normal.

The problem appears to be inside OcctWindow. Another user replied on the thread I linked with more information.

1) Build and run the Bottle sample using the provided scripts.
2) Create a new window and create the bottle.
3) Resize the document window by dragging the corner. Note: Not the main window, unless the document window is mazimized to the main window.
This problem does not occur in Windows, just Linux.
No tags attached.
related to 0026603closed bugmaster Community Problem with maximization and normalization document windows in Qt samples with Qt 5.x 
related to 0031815verified bugmaster Open CASCADE Visualization, TKOpenGl - avoid XResizeWindow() within OpenGl_Window::Resize() 
Issue History
2016-09-29 20:05hpmachiningNew Issue
2016-09-29 20:05hpmachiningAssigned To => bugmaster
2016-09-29 20:13kgvRelationship addedrelated to 0027779
2016-09-29 20:14kgvRelationship addedrelated to 0026603
2017-01-17 18:51BenjaminBihlerNote Added: 0062711
2017-08-23 11:30apvTest case number => Not required
2020-09-30 14:45kgvSummaryQt Samples Document Window Display Problem => Samples - Qt sample document window display problem
2020-09-30 15:47bugmasterNote Added: 0095498
2020-09-30 15:47bugmasterAssigned Tobugmaster => vsv
2020-09-30 15:47bugmasterStatusnew => assigned
2020-10-01 14:38bugmasterAssigned Tovsv => bugmaster
2020-10-01 14:39gitNote Added: 0095525
2020-10-01 14:46bugmasterTarget Version => 7.5.0
2020-10-01 14:46bugmasterRelationship addedrelated to 0031815
2020-10-01 15:19vsvNote Added: 0095528
2020-10-01 15:22vsvNote Edited: 0095528bug_revision_view_page.php?bugnote_id=95528#r23672
2020-10-01 15:39bugmasterNote Added: 0095532
2020-10-01 15:39bugmasterAssigned Tobugmaster => vsv
2020-10-01 15:39bugmasterStatusassigned => resolved
2020-10-01 15:40bugmasterNote Edited: 0095532bug_revision_view_page.php?bugnote_id=95532#r23674
2020-10-01 15:45vsvAssigned Tovsv => bugmaster
2020-10-01 15:45vsvStatusresolved => reviewed
2020-10-03 14:02bugmasterNote Added: 0095622
2020-10-03 14:02bugmasterStatusreviewed => tested
2020-10-03 14:05abvChangeset attached => occt master 7e6da17b
2020-10-03 14:05abvAssigned Tobugmaster => abv
2020-10-03 14:05abvStatustested => verified
2020-10-03 14:05abvResolutionopen => fixed
2020-10-03 14:38gitNote Added: 0095648
2020-12-02 16:40emoFixed in Version => 7.5.0
2020-12-02 17:11emoStatusverified => closed

2017-01-17 18:51   
Upvoting! I have the same issue and according to the original post we are not the only ones. When looking at the stacktrace there is a long chain of Qt methods related to showing a window that seem to call each other:

... and so on
some class calling showMaximized() of the application main window

Would you have a look at it?
2020-09-30 15:47   
Problem can be reproduced with new Qt Overview sample from branch CR31570_1.

I checked through VNC and locally on Debian 8,10

Qt Overview sample is not functional at all

The other QT samples (OCCT and Products) are not functional after display resizing
2020-10-01 14:39   
Branch CR27922 has been created by inv.

SHA-1: 116916b5b98a21a1ea204f3f29b709b518f6d208

Detailed log of new commits:

Author: bugmaster
Date: Thu Oct 1 14:42:10 2020 +0300

    0027922: Samples - Qt sample document window display problem
2020-10-01 15:19   
(edited on: 2020-10-01 15:22)
The problem of Qt samples that all successors of Aspect_Window class (usually it is OcctWindow) have a one common mistake: Method Size is redefined as following:
void OcctWindow::Size(Standard_Integer& theWidth, Standard_Integer& theHeight) const
  QRect aRect = myWidget->rect();
  theWidth = aRect.right();
  theHeight = aRect.bottom();

This is a wrong definition which causes the bug. Right definition must be:
void OcctWindow::Size(Standard_Integer& theWidth, Standard_Integer& theHeight) const
  QRect aRect = myWidget->rect();
  theWidth = aRect.width();
  theHeight = aRect.height();
it works well.

2020-10-01 15:39   
(edited on: 2020-10-01 15:40)

I recompiled QT samples for OCCT and Products. Problem is not reproduced

Please review

2020-10-03 14:02   
Combination -
OCCT branch : IR-2020-10-02
master SHA - 6522304c17181a09fa831c040219d611dc44b94a
Products branch : IR-2020-10-02 SHA - d9c364e1137eed3249e5a05befa860c708f243c0
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

No regressions/differences

CPU differences:
Total CPU difference: 18085.050000000083 / 18057.60000000009 [+0.15%]
Total CPU difference: 12174.620000000117 / 12124.200000000114 [+0.42%]
Total CPU difference: 19713.125 / 19772.65625 [-0.30%]
Total CPU difference: 13533.8125 / 13527.921875 [+0.04%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
2020-10-03 14:38   
Branch CR27922 has been deleted by inv.

SHA-1: 116916b5b98a21a1ea204f3f29b709b518f6d208