MantisBT - Community
View Issue Details
0027922Community[OCCT] OCCT:Samplespublic2016-09-29 20:052020-12-02 17:11
hpmachining 
abv 
normalminor 
closedfixed 
Linux
[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:
https://www.opencascade.com/content/qt-bottle-tutorial-linux-display-issue [^]

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

Notes
(0062711)
BenjaminBihler   
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
QWidgetPrivate::showChildren()
QWidgetPrivate::show_helper()
QWidget::setVisible()
QWidget::show()
QWidgetPrivate::showChildren()
QWidgetPrivate::show_helper()
QWidget::setVisible()
QWidget::showMaximized()
some class calling showMaximized() of the application main window
main()

Would you have a look at it?
(0095498)
bugmaster   
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
(0095525)
git   
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
(0095528)
vsv   
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.

(0095532)
bugmaster   
2020-10-01 15:39   
(edited on: 2020-10-01 15:40)
Vitaly,

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

Please review

(0095622)
bugmaster   
2020-10-03 14:02   
Combination -
OCCT branch : IR-2020-10-02
master SHA - 6522304c17181a09fa831c040219d611dc44b94a
a206de37fbfa0bf71bd534ae47192bbec23b8522
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

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18085.050000000083 / 18057.60000000009 [+0.15%]
Products
Total CPU difference: 12174.620000000117 / 12124.200000000114 [+0.42%]
Windows-64-VC14:
OCCT
Total CPU difference: 19713.125 / 19772.65625 [-0.30%]
Products
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
(0095648)
git   
2020-10-03 14:38   
Branch CR27922 has been deleted by inv.

SHA-1: 116916b5b98a21a1ea204f3f29b709b518f6d208