本文整理汇总了C++中QToolBar::setFixedWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolBar::setFixedWidth方法的具体用法?C++ QToolBar::setFixedWidth怎么用?C++ QToolBar::setFixedWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolBar
的用法示例。
在下文中一共展示了QToolBar::setFixedWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createToolBars
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setObjectName("toolbar");
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setFixedWidth(205);
toolbar->setMovable( false );
toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);
QLabel* header = new QLabel();
header->setMinimumSize(156,156);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setPixmap(QPixmap(":/images/header"));
header->setMaximumSize(156,156);
header->setContentsMargins(26,26,0,0);
header->setScaledContents(true);
toolbar->addWidget(header);
QLabel *l = new QLabel(this);
l->setPixmap(QPixmap(":/images/spacer"));
toolbar->addWidget(l);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");
}
示例2: QWidget
//.........这里部分代码省略.........
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);
leftToolBar->setFixedWidth(110);
m_swatchAct = new QAction(createQIconOnOffPNG("preview", true), tr("Toggle Swatch Preview"), this);
m_swatchAct->setCheckable(true);
leftToolBar->addAction(m_swatchAct);
leftToolBar->addSeparator();
m_opacityAct = new QAction(createQIconOnOffPNG("opacitycheck", true), tr("Toggle Opacity Check"), this);
m_opacityAct->setCheckable(true);
leftToolBar->addAction(m_opacityAct);
QToolBar *spacingToolBar1 = new QToolBar(toolBarWidget);
toolBarLayout->addWidget(spacingToolBar1, 1);
spacingToolBar1->setMinimumHeight(22);
QToolBar *rightToolBar = new QToolBar(toolBarWidget);
toolBarLayout->addWidget(rightToolBar, 0, Qt::AlignRight);
rightToolBar->setFixedWidth(110);
QAction *saveAct = new QAction(createQIconOnOffPNG("save", false), tr("Save Settings"), this);
rightToolBar->addAction(saveAct);
QAction *loadAct = new QAction(createQIconOnOffPNG("load", false), tr("Load Settings"), this);
rightToolBar->addAction(loadAct);
rightToolBar->addSeparator();
QAction *resetAct = new QAction(createQIconOnOffPNG("resetsize", false), tr("Reset Settings"), this);
rightToolBar->addAction(resetAct);
// Model-related stuff
CleanupSettingsModel *model = CleanupSettingsModel::instance();
m_backupParams.assign(model->getCurrentParameters(), false);
// Connections
QAction *opacityCheckCmd = CommandManager::instance()->getAction(MI_OpacityCheck);
assert(opacityCheckCmd);
bool ret = true;
ret = ret && connect(tabBar, SIGNAL(currentChanged(int)), stackedWidget, SLOT(setCurrentIndex(int)));
ret = ret && connect(m_swatchAct, SIGNAL(toggled(bool)), SLOT(enableSwatch(bool)));
ret = ret && connect(m_opacityAct, SIGNAL(triggered(bool)), opacityCheckCmd, SLOT(trigger()));
ret = ret && connect(saveAct, SIGNAL(triggered()), model, SLOT(promptSave()));
ret = ret && connect(loadAct, SIGNAL(triggered()), model, SLOT(promptLoad()));
ret = ret && connect(resetAct, SIGNAL(triggered()), this, SLOT(onRestoreSceneSettings()));
assert(ret);
}