{"id":636,"date":"2010-03-09T09:31:07","date_gmt":"2010-03-09T16:31:07","guid":{"rendered":"http:\/\/thesmithfam.org\/blog\/?p=636"},"modified":"2019-08-12T07:15:31","modified_gmt":"2019-08-12T13:15:31","slug":"qt-layout-squashing","status":"publish","type":"post","link":"https:\/\/thesmithfam.org\/blog\/2010\/03\/09\/qt-layout-squashing\/","title":{"rendered":"Qt Layout Squashing"},"content":{"rendered":"<p>I&#8217;ve encountered this problem a handful of times over the past few years using Qt&#8217;s layouts. Qt generally does a great job making sure that your Windows cannot be resized too small such that your content would be truncated. However, it seems that introducing a <strong>QStackedWidget<\/strong> causes a problem.<\/p>\n<p>These two screenshots illustrate the issue:<\/p>\n<p><strong>Screenshot 1<\/strong> The widget prior to resizing (all text appears correctly)<\/p>\n<p><img decoding=\"async\" src=\"\/images\/qt-layout-problem-1.png\" \/><\/p>\n<p><strong>Screenshot 2<\/strong> The user resizes the widget (the text is truncated)<\/p>\n<p><img decoding=\"async\" src=\"\/images\/qt-layout-problem-2.png\" \/><\/p>\n<p>Like I said above, I think the problem is caused by the <strong>QStackedWidget<\/strong>. Without it, Qt properly limits the widget&#8217;s minimum size such that the text cannot be truncated. I would <strong>love<\/strong> it if the <a href=\"http:\/\/qt.nokia.com\/\">Trolls<\/a> could have a look at this issue. I&#8217;ve seen the problem since Qt 4.0, but I never reduced the problem to its base (it took a while to deduce that the <strong>QStackedWidget<\/strong> was the culprit). <\/p>\n<p>If you&#8217;re interested, I&#8217;ve included the <a href=\"\/files\/LayoutProblem.ui\">minimal Designer UI file<\/a> that shows the problem (right click that link to save it). I used Designer 4.6.2 to create this file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve encountered this problem a handful of times over the past few years using Qt&#8217;s layouts. Qt generally does a great job making sure that your Windows cannot be resized too small such that your content would be truncated. However, it seems that introducing a QStackedWidget causes a problem. These two screenshots illustrate the issue: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-636","post","type-post","status-publish","format-standard","hentry","category-code-and-cruft"],"_links":{"self":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/comments?post=636"}],"version-history":[{"count":13,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/636\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/636\/revisions\/649"}],"wp:attachment":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/media?parent=636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/categories?post=636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/tags?post=636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}