QPage - Is it really neccessary to have QPageContainer which just offsets the dimensions? #10788
-
|
For QPageContainer, it is just to offset the box-model using padding values. Indeed it can be done in QPage - giving margin values and set the This would increase the performance as:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
|
Suggested coding changes can refer to PR #10789 CodePen Examples |
Beta Was this translation helpful? Give feedback.
-
I think the devs followed a 'known to work' design pattern/structure. As you showed it's possible to go without the separation of If that happens then instead of just |
Beta Was this translation helpful? Give feedback.
-
|
I believe that qpagecontainer is useful as it handles the space taken by the optional header and footer by calculating and padding as appropriate. This allows qpage, (which is not strictly necessary as you can use another element instead) in the main content area to ignore the header and footer information. I believe that this is all based on each part of layout being full window size and then padding and margins are changed to do things like deciding whether the left sidebar overlaps the title is is under it. It could definitely be better in some cases if the page was a distinct entity so that when there was a fixed title the scrollbar for the page didn't extend to the top of the window. |
Beta Was this translation helpful? Give feedback.
-
|
It may seem like a performance enhancement to eliminate one component, but it’s really not.
|
Beta Was this translation helpful? Give feedback.
-
|
After much research, I found that QLayout uses wrappers for the various parts, drawer, page in order to remove layout concerns from the code that you write. Qpagecontainer is visible because it has to be in the layout in order to have a place to inject the pages with the router. |
Beta Was this translation helpful? Give feedback.

It may seem like a performance enhancement to eliminate one component, but it’s really not.
QPageContainer is needed because of all the following combined:
transition>component) without the need of “hacks”. Won’t get into detail here because this would deserve a thread of its own by how complex it is.