English 中文(简体)
Q making UI
原标题:Qt, making UI that shrinks and expands

我试图学习如何创造我的克特霍比亚申请的布局,以便扩大/缩小并适应不同装置的屏幕规模。

在我缺席时,我添加了一张QTabWidget和5个表格,供我安装在装置的屏幕上。 我有两个问题:

  1. 我怎么能够使表格缩小,使之永远适合装置的屏幕,还是不可能做到? 如果一个装置的宽度为240px,另一个宽度为400px。 如你现在可以看到(Nokia Emulator),这些表格不在屏幕上。 (我不想使用ScrollButtons)

  2. As you can see in the red part of the picture (Nokia Emulator ) there is some spacing in the UI that I don t want. Instead I want the QTabWidget to fill the whole screen (all the red part).

简言之,我现在学习一米,如果你能给我一些ti子,谈谈在建立适合许多装置和筛选决议的“国际倡议”时,如何看待这些问题。 感谢!

这是我方济会国际档案中的法典:

void setupUi(QMainWindow *UITest)
{
    if (UITest->objectName().isEmpty())
        UITest->setObjectName(QString::fromUtf8("UITest"));
    UITest->resize(284, 167);
    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(UITest->sizePolicy().hasHeightForWidth());
    UITest->setSizePolicy(sizePolicy);
    centralwidget = new QWidget(UITest);
    centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
    verticalLayout = new QVBoxLayout(centralwidget);
    verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
    tabWidget = new QTabWidget(centralwidget);
    tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
    tabWidget->setTabPosition(QTabWidget::South);
    tabWidget->setUsesScrollButtons(false);
    tab = new QWidget();
    tab->setObjectName(QString::fromUtf8("tab"));
    tabWidget->addTab(tab, QString());
    ...More tabs...        

    verticalLayout->addWidget(tabWidget);

    UITest->setCentralWidget(centralwidget);

    retranslateUi(UITest);

    QMetaObject::connectSlotsByName(UITest);
} // setupUi

void retranslateUi(QMainWindow *UITest)
{
    UITest->setWindowTitle(QApplication::translate("UITest", "UITest", 0, QApplication::UnicodeUTF8));
    UITest->setStyleSheet(QApplication::translate("UITest", "background: red;
" "padding: 0px;", 0, QApplication::UnicodeUTF8));
    tabWidget->setStyleSheet(QApplication::translate("UITest", "background: white;
" "margin: 0px;
" "padding: 0px;", 0, QApplication::UnicodeUTF8));
} // retranslateUi

在主食中,由于我也想要底层的菜.,因此用于展示我的植被。

最佳回答

你们如何展示植被? 我建议使用“光彩”方法显示这一方法——这可能是这样。

问题回答

暂无回答




相关问题
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 ...

热门标签