本文整理汇总了C++中QScrollArea::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::hide方法的具体用法?C++ QScrollArea::hide怎么用?C++ QScrollArea::hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createWidgets
QWidget* createWidgets(BasePropertyWidget* parent)
{
m_parent = parent;
m_property = parent->property();
m_propertyValue = m_property->value<value_type>();
if (!m_propertyValue)
return nullptr;
m_value = m_propertyValue->value();
// Get widget creator
std::string widget;
auto meta = m_propertyValue->metaContainer().get<meta::Widget>();
if (meta)
widget = meta->type();
auto id = std::type_index(typeid(base_type));
m_widgetCreator = PropertyWidgetFactory::instance().creator(id, widget);
auto container = new QWidget(parent);
auto layout = new QVBoxLayout(container);
layout->setContentsMargins(0, 0, 0, 0);
auto topLayout = new QHBoxLayout;
m_toggleButton = new QPushButton(QPushButton::tr("show"));
m_toggleButton->setCheckable(true);
QObject::connect(m_toggleButton, &QPushButton::toggled, [this](bool toggled){ toggleView(toggled); });
topLayout->addWidget(m_toggleButton);
if (!list_traits::fixed(m_value))
{
m_spinBox = new QSpinBox;
m_spinBox->setMaximum(INT_MAX);
m_spinBox->setValue(list_traits::size(m_value));
topLayout->addWidget(m_spinBox, 1);
auto resizeButton = new QPushButton(QPushButton::tr("resize"));
QObject::connect(resizeButton, &QPushButton::clicked, [this]() {
for (auto w : m_propertyWidgets)
w->updatePropertyValue();
resize(m_spinBox->value());
});
QObject::connect(resizeButton, &QPushButton::clicked, parent, &BasePropertyWidget::setWidgetDirty);
topLayout->addWidget(resizeButton);
}
else
topLayout->addStretch();
m_scrollArea = new QScrollArea();
layout->addLayout(topLayout);
layout->addWidget(m_scrollArea, 1);
m_scrollArea->hide();
m_scrollArea->setWidgetResizable(true);
return container;
}