本文整理汇总了C++中QStackedWidget::setMinimumWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ QStackedWidget::setMinimumWidth方法的具体用法?C++ QStackedWidget::setMinimumWidth怎么用?C++ QStackedWidget::setMinimumWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStackedWidget
的用法示例。
在下文中一共展示了QStackedWidget::setMinimumWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
CleanupSettings::CleanupSettings(QWidget *parent)
: QWidget(parent), m_attached(false)
{
QVBoxLayout *vLayout = new QVBoxLayout(this);
vLayout->setMargin(1); // NOTE: This works to show the 1-pix black border,
// because this is a QWidget (not QFrame) heir...
setLayout(vLayout);
// Tabs Container
// Used to deal with styled background and other stuff
TabBarContainter *tabBarContainer = new TabBarContainter(this);
QHBoxLayout *hLayout = new QHBoxLayout(tabBarContainer);
hLayout->setMargin(0);
hLayout->setAlignment(Qt::AlignLeft);
hLayout->addSpacing(6);
vLayout->addWidget(tabBarContainer);
// Tabs Bar
DVGui::TabBar *tabBar = new DVGui::TabBar(this);
hLayout->addWidget(tabBar);
tabBar->addSimpleTab(tr("Cleanup"));
tabBar->addSimpleTab(tr("Processing"));
tabBar->addSimpleTab(tr("Camera"));
tabBar->setDrawBase(false);
// Splitter
QSplitter *split = new QSplitter(Qt::Vertical, this);
split->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
vLayout->addWidget(split);
// Stacked Widget
QStackedWidget *stackedWidget = new QStackedWidget(split);
stackedWidget->setMinimumWidth(300);
//stackedWidget->setMinimumHeight(250);
split->addWidget(stackedWidget);
split->setStretchFactor(0, 1);
// Cleanup Tab
QScrollArea *scrollArea = new QScrollArea(stackedWidget);
stackedWidget->addWidget(scrollArea);
scrollArea->setWidgetResizable(true);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_cleanupTab = new CleanupTab;
scrollArea->setWidget(m_cleanupTab);
// Processing Tab
scrollArea = new QScrollArea(stackedWidget);
stackedWidget->addWidget(scrollArea);
scrollArea->setWidgetResizable(true);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_processingTab = new ProcessingTab;
scrollArea->setWidget(m_processingTab);
// Camera Tab
scrollArea = new QScrollArea(stackedWidget);
stackedWidget->addWidget(scrollArea);
scrollArea->setWidgetResizable(true);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_cameraTab = new CameraTab;
scrollArea->setWidget(m_cameraTab);
m_cameraTab->setCameraPresetListFile(ToonzFolder::getReslistPath(true));
// Swatch
m_swatch = new CleanupSwatch(split, 200, 150);
split->addWidget(m_swatch);
// ToolBar
QWidget *toolBarWidget = new QWidget(this);
vLayout->addWidget(toolBarWidget);
toolBarWidget->setFixedHeight(22);
QHBoxLayout *toolBarLayout = new QHBoxLayout(toolBarWidget);
toolBarWidget->setLayout(toolBarLayout);
toolBarLayout->setMargin(0);
toolBarLayout->setSpacing(0);
QToolBar *leftToolBar = new QToolBar(toolBarWidget);
toolBarLayout->addWidget(leftToolBar, 0, Qt::AlignLeft);
//.........这里部分代码省略.........
示例2: CreateWidgets
void interface::CreateWidgets(){
QString name, type, title, wight, image, id, act;
xmlItem childItem;
xmlItem md = xml.find(xml_root,md_metadata);
xmlItem ifTabs = xml.find(xml_root,md_tabs);
xmlItem itActions = xml.find(xml_root,md_actions);
currentTab = 0;
int idTab = 0;
int idVal = 0;
while (!ifTabs.isNull()){
name = xml.attr(ifTabs,mda_name);
type = xml.attr(ifTabs,mda_type);
title = xml.attr(ifTabs,mda_title);
QGridLayout *l = new QGridLayout(this);
QTabWidget *root = new QTabWidget;
l->addWidget(root);
connect(root,SIGNAL(currentChanged(int)),this,SLOT(on_clicked_tab(int)));
//—оздаем вкладки разделов
childItem = xml.find(ifTabs,md_tab);
while (!childItem.isNull()){
name = xml.attr(childItem,mda_name);
type = xml.attr(childItem,mda_type);
title = xml.attr(childItem,mda_title);
image = xml.attr(childItem,mda_image);
QWidget *Tab = UIload.createWidget(type,root,name);
Tab->setObjectName(name);
QIcon ic(":/"+image);
root->setIconSize(QSize(50,50));
root->addTab(Tab,ic,title);
QHBoxLayout *vb = new QHBoxLayout(Tab);
QStackedWidget *stWidget = new QStackedWidget();
listWindow.insert(idTab,stWidget);
idTab++;
//idVal = 0;
// —оздаем левое меню
xmlItem childrenItem = xml.find(childItem,md_left_menu,0);
while (!childrenItem.isNull() && childrenItem.nodeName() == md_left_menu){
name = xml.attr(childrenItem,mda_name);
type = xml.attr(childrenItem,mda_type);
title = xml.attr(childrenItem,mda_title);
wight = xml.attr(childrenItem,mda_width);
iisTaskPanel *tskPanel = new iisTaskPanel(Tab);
if (!wight.isEmpty())
tskPanel->setMinimumWidth(wight.toInt());
vb->addWidget(tskPanel,0);
vb->setAlignment(tskPanel,Qt::AlignLeft);
// √руппы меню
tskPanel->layout()->setAlignment(Qt::AlignTop);
xmlItem xmlGr = xml.find(childrenItem,md_group);
while (!xmlGr.isNull()){
name = xml.attr(xmlGr,mda_name);
type = xml.attr(xmlGr,mda_type);
title = xml.attr(xmlGr,mda_title);
//QGroupBox *Gr = new QGroupBox(name,prev);
iisTaskBox *Gr = new iisTaskBox(title);
tskPanel->addWidget(Gr);
Gr->setObjectName(name);
//Ёлементы меню
xmlItem xmlValue = xml.find(xmlGr,md_value);
while (!xmlValue.isNull()){
name = xml.attr(xmlValue,mda_name);
id = xml.attr(xmlValue,mda_id);
title = xml.attr(xmlValue,mda_title);
act = xml.sText(xmlValue,md_comaction);
iisIconLabel *val = new iisIconLabel(title);
val->setObjectName(name);
connect(val,SIGNAL(clicked()),this,SLOT(on_clicked_item()));
Gr->addIconLabel(val);
list.insert(val,idVal);
xmlItem iact = xml.findId(itActions,"",act);
xmlItem iObj, iFrm;
if (!iact.isNull()){
QString idObj = xml.sText(iact,md_objectid);
xmlItem tmp = xml.firstChild(md);
while (!tmp.isNull()){
iObj = xml.findId(tmp,"",idObj);
tmp = xml.nextSibling(tmp);
if (!iObj.isNull()) break;
}
}
if (!iObj.isNull()){
QString idFrm = xml.sText(iact,md_formid);
iObj = xml.find(iObj,md_forms);
iFrm = xml.findId(iObj,"",idFrm);
// —оздаем форму
//.........这里部分代码省略.........