本文整理汇总了C++中Attr::getTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ Attr::getTitle方法的具体用法?C++ Attr::getTitle怎么用?C++ Attr::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attr
的用法示例。
在下文中一共展示了Attr::getTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
FilterWidget::FilterWidget(TQueryMap opts, QList<Attr*> list, Keeper *keeper, QWidget *parent) :
QWidget(parent), keeper(keeper), attrList(list), parentWidget(parent), opts(opts)
{
innerWidget = new QWidget(this);
scrollArea = new QScrollArea(this);
scrollArea->setWidget( innerWidget );
scrollArea->setWidgetResizable( true );
innerLayout = new QGridLayout( innerWidget );
innerLayout->setSpacing(2);
innerLayout->setMargin(2);
QWidget *w = 0;
int row = 0;
for( int i = 0; i < attrList.size(); i++ )
{
QApplication::processEvents();
Attr *a = list.at(i);
w = getAttrWidget( a, innerWidget );
if ( !w ) continue;
QCheckBox *box = new QCheckBox( a->getTitle(), innerWidget);
if ( opts.contains(a->getName()) ) {
box->setChecked(true);
setWidgetData(a, w, opts[a->getName()]);
} else {
w->setEnabled(false);
}
widgetMap.insert( a->getName(), w );
connect(box, SIGNAL(toggled(bool)), w, SLOT(setEnabled(bool)));
innerLayout->addWidget( box, row++, 0 );
innerLayout->addWidget( w, row++, 0);
}
filterButton = new QPushButton(tr("Filter"), innerWidget);
filterButton->setIcon(QIcon(":/icons/magnifier.png"));
clearButton = new QPushButton(tr("Clear"), innerWidget);
clearButton->setIcon(QIcon(":/icons/cancel.png"));
connect(filterButton, SIGNAL(clicked()), this, SLOT(filterButton_clicked()));
connect(clearButton, SIGNAL(clicked()), this, SLOT(clearButton_clicked()));
QBoxLayout *hlayout = new QBoxLayout(QBoxLayout::LeftToRight);
hlayout->addWidget(filterButton);
hlayout->addWidget(clearButton);
hlayout->addItem(new QSpacerItem(10, 10 ));
innerLayout->addLayout(hlayout, row++, 0);
innerLayout->addItem( new QSpacerItem(20, 1200, QSizePolicy::Maximum, QSizePolicy::Maximum), row, 0);
QGridLayout *glayout = new QGridLayout(this);
glayout->addWidget(scrollArea, 0, 0);
glayout->setSpacing(2);
glayout->setMargin(2);
setLayout(glayout);
}