本文整理汇总了C++中QTabWidget::setIconSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setIconSize方法的具体用法?C++ QTabWidget::setIconSize怎么用?C++ QTabWidget::setIconSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::setIconSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setIconSize
int TabWidget::setIconSize( lua_State * L ) // ( const QSize & size )void
{
QTabWidget* obj = ObjectHelper<QTabWidget>::check( L, 1 );
QSize* size = ValueInstaller2<QSize>::check( L, 2 );
obj->setIconSize( *size );
return 0;
}
示例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);
// —оздаем форму
//.........这里部分代码省略.........
示例3: setIconSize
void QTabWidgetProto::setIconSize(const QSize &size)
{
QTabWidget *item = qscriptvalue_cast<QTabWidget*>(thisObject());
if (item)
item->setIconSize(size);
}