本文整理汇总了C++中ToolButton::setFixedSize方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolButton::setFixedSize方法的具体用法?C++ ToolButton::setFixedSize怎么用?C++ ToolButton::setFixedSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolButton
的用法示例。
在下文中一共展示了ToolButton::setFixedSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initSaveLabel
void SubToolBar::initSaveLabel() {
//save to...
QList<ToolButton*> toolBtnList;
ToolButton* saveDesktopBtn = new ToolButton();
saveDesktopBtn->setFixedSize(SAVEBTN_SIZE);
saveDesktopBtn->setObjectName("SaveToDesktop");
saveDesktopBtn->setTips(tr("Save to desktop"));
toolBtnList.append(saveDesktopBtn);
ToolButton* savePicBtn = new ToolButton();
savePicBtn->setFixedSize(SAVEBTN_SIZE);
savePicBtn->setObjectName("SaveToPictureDir");
savePicBtn->setTips(tr("Autosave"));
toolBtnList.append(savePicBtn);
ToolButton* saveSpecificDirBtn = new ToolButton();
saveSpecificDirBtn->setFixedSize(SAVEBTN_SIZE);
saveSpecificDirBtn->setObjectName("SaveToSpecificDir");
saveSpecificDirBtn->setTips(tr("Save to specified folder"));
toolBtnList.append(saveSpecificDirBtn);
ToolButton* saveClipboardBtn = new ToolButton();
saveClipboardBtn->setFixedSize(SAVEBTN_SIZE);
saveClipboardBtn->setObjectName("SaveToClipboard");
saveClipboardBtn->setTips(tr("Copy to clipboard"));
toolBtnList.append(saveClipboardBtn);
ToolButton* saveAutoClipboardBtn = new ToolButton();
saveAutoClipboardBtn->setObjectName("SaveToAutoClipboard");
saveAutoClipboardBtn->setTips(tr("Autosave and copy to clipboard"));
toolBtnList.append(saveAutoClipboardBtn);
QLabel* lowQualityText = new QLabel();
lowQualityText->setObjectName("LowQualityLabel");
lowQualityText->setText(tr("Low"));
QSlider* saveQualitySlider = new QSlider(Qt::Horizontal);
saveQualitySlider->setFixedWidth(58);
saveQualitySlider->setMinimum(50);
saveQualitySlider->setMaximum(100);
saveQualitySlider->setPageStep(1);
saveQualitySlider->setSliderPosition(100);
setSaveQualityIndex(saveQualitySlider->value());
connect(saveQualitySlider, &QSlider::valueChanged,
this, &SubToolBar::setSaveQualityIndex);
QLabel* highQualityText = new QLabel();
highQualityText->setObjectName("HighQualityLabel");
highQualityText->setText(tr("High"));
m_saveLabel = new QLabel(this);
QHBoxLayout* saveLayout = new QHBoxLayout();
saveLayout->setMargin(0);
saveLayout->setSpacing(0);
saveLayout->addSpacing(1);
foreach (ToolButton* btn, toolBtnList) {
saveLayout->addWidget(btn);
// saveLayout->addSpacing(1);
connect(btn, &ToolButton::clicked, this, [=]{
qDebug() << "saveButtonList:" << toolBtnList.indexOf(btn);
setSaveOption(toolBtnList.indexOf(btn));
});
connect(btn, &ToolButton::onEnter, this, [=]{
emit showSaveTip(btn->getTips());
});
connect(btn, &ToolButton::onExist, this, [=]{
emit hideSaveTip();
});
}