本文整理汇总了C++中IconButton::minimumHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ IconButton::minimumHeight方法的具体用法?C++ IconButton::minimumHeight怎么用?C++ IconButton::minimumHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IconButton
的用法示例。
在下文中一共展示了IconButton::minimumHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IconButton
void
IconStackedWidget::addPage(const QString& name, QWidget *page, const QPixmap& icon)
{
IconButton *iconButton = new IconButton(m_iconPanel,icon, name);
// IconStackedWidget acts like a radio button widget with exclusive buttons
iconButton->setCheckable(true);
iconButton->setAutoExclusive(true);
// If the new button is the biggest so far, update the default size
if ((iconButton->minimumWidth() > m_buttonWidth) || (iconButton->minimumHeight() > m_buttonHeight)) {
m_buttonWidth = std::max(iconButton->minimumWidth(),m_buttonWidth);
m_buttonHeight = std::max(iconButton->minimumHeight(),m_buttonHeight);
// Update the size of previous buttons
for (iconbuttons::iterator i = m_iconButtons.begin();
i != m_iconButtons.end(); ++i)
(*i)->setMinimumSize(m_buttonWidth, m_buttonHeight);
}
iconButton->setMinimumSize(m_buttonWidth, m_buttonHeight);
// If the list of buttons is not empty set the new buttons background to the default
if (!m_iconButtons.size()) {
iconButton->setChecked(true);
}
// Store the new button in a list for later modification
m_iconButtons.push_back((IconButton *) iconButton);
// Add the button to the icon layout, insert to the second point in the list
// the first hold the stretch item
m_iconLayout->insertWidget(1,iconButton);
// Add the new page to the page layout
m_pagePanel->addWidget(page);
// Connect the button's clicked data signal to the page select slot
connect(iconButton, SIGNAL(clicked()), this, SLOT(slotPageSelect()));
}