English 中文(简体)
Qt: 如何防止一些植被getting升。
原标题:Qt: How to prevent some of the widgets from getting scrollbars
  • 时间:2011-11-14 04:49:07
  •  标签:
  • qt
  • layout

I have the following widget layout:

HBox
 - VBox
    - HBox
        widget "A"
        widget "B"
    - widget "C"
 - widget "D"

换言之,我有这样的情况:

+-----+--------------+
|  A  |              |
+-----+       C      |
|  B  |              |
+-----+--------------+
|         D          |
+--------------------+

视内容而定,“A”和“B”需要扩大和消费尽可能多的垂直空间,而不显示任何滚动障碍。 “D”可以在必要时签订合同。

我试图确定“A”和“B”的大小政策为“最低限度”,并根据“A”和“B”的表现,对“A”和“B”实施“体积”。 然而,在“A”和“B”中,我仍然看到滚动障碍,而“D”则比它所需要的空间更多。

我还尝试了“最小扩展”规模政策,但我仍然看到一些障碍。

我如何确保,如果有空间,“A”和“B”就会得到优惠待遇,从而避免排放?

最佳回答

http://doc.qt.nokia.com A和B的财产,在无排放障碍的情况下,价值最低。 他们仍然能够扩大,但比这个规模缩小。

[Edit:] After re-reading your question I realized your content of A and B don t always have the same size. Obviously the approach above would only be possible if you know the size of the content whenever it changes. You can just call setMinimumHeight()/setMinimumWidth() or equally setMinimumSize() from your code in this case.

问题回答

使用<代码>Expanding作为>AB的大小政策。 关于植被D,你应当每次复制<代码>A和/或B的内容。 变化。 它的规模政策应当尽量缩小,你应当使用setMinimumH8

如果植被有隔.,则应继承rel=“nofollow”>QAbstractScrollArea。 您可使用setHorizontalScrollBarPolicy 和

A->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
B->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);




相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...

热门标签