Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt 5 setParent coupled with Large Data Copy leads to temporary black screen/widget?



  • I am developing an application which imports large amounts of data.
    When I use a small data set as a test sample, I do not experience this problem.

    Issue:
    I use a non-standard pagination method to switch "pages" in the app.
    When a user navigates to page 2, the parent of page 1 is set to 0, and the centralWidget is set to page 2.
    This works vice-versa going back from page 2 to page 1.

    When copying a HUGE amount of data from page 1 to page 2 a second time, the UI locks up and an all black screen is visible.
    After some time, this black screen disappears to reveal page 2, and the operation is successful.
    During my studies, I learned a lot about how user's like to interact with applications, and this temporary black screen is sure to make users think that the application has reached a fail state.

    Is there any explanation as to where this black/blank dialog comes from? Is it page 1 after the hide() subroutine has been called? Is it a side effect of a large data copy? Has anyone seen it before?

    I welcome comments on the design as well.
    I know that the pagination technique did not turn out as well as I had hoped.
    I scoured similar posts in the archive, but none seemed to be like mine.


  • Lifetime Qt Champion

    Hi,

    What kind of data are you copying ?
    What do you mean by huge ?
    Why are you copying that much data ?

    When you have high volumes of data, it's not unusual to have them in a model and share that model between actors using these data.

    Have a look at the MVC pattern as well as Qt Model View framework.



  • @SGaist Hello, Thanks for answering. The data that I am copying is a table of roughly 9000 rows by 5 columns.
    I am very new to UI programming. I may have to examine the Qt Model View framework you have proposed. As I do not seeany other way to get the blank frame from appearing.


Log in to reply