当前位置: 首页>>代码示例>>C++>>正文


C++ QObjectList::clear方法代码示例

本文整理汇总了C++中QObjectList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ QObjectList::clear方法的具体用法?C++ QObjectList::clear怎么用?C++ QObjectList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QObjectList的用法示例。


在下文中一共展示了QObjectList::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setupStatusBar

void BasketStatusBar::setupStatusBar()
{
    QWidget* parent = statusBar();
    QObjectList lst = parent->findChildren<QObject*>("KRSqueezedTextLabel");

    //Tools::printChildren(parent);
    if (lst.count() == 0) {
        m_basketStatus = new QLabel(parent);
        QSizePolicy policy(QSizePolicy::Ignored, QSizePolicy::Ignored);
        policy.setHorizontalStretch(0);
        policy.setVerticalStretch(0);
        policy.setHeightForWidth(false);
        m_basketStatus->setSizePolicy(policy);
        addWidget(m_basketStatus, 1, false);  // Fit all extra space and is hiddable
    } else
        m_basketStatus = static_cast<QLabel*>(lst.at(0));
    lst.clear();

    m_selectionStatus = new QLabel(i18n("Loading..."), parent);
    addWidget(m_selectionStatus, 0, true);

    m_lockStatus = new QLabel(0/*this*/);
    m_lockStatus->setMinimumSize(18, 18);
    m_lockStatus->setAlignment(Qt::AlignCenter);
//  addWidget( m_lockStatus, 0, true );
    m_lockStatus->installEventFilter(this);

    m_savedStatusPixmap = SmallIcon("document-save");
    m_savedStatus = new QLabel(parent);
    m_savedStatus->setPixmap(m_savedStatusPixmap);
    m_savedStatus->setFixedSize(m_savedStatus->sizeHint());
    m_savedStatus->clear();
    //m_savedStatus->setPixmap(m_savedStatusIconSet.pixmap(QIconSet::Small, QIconSet::Disabled));
    //m_savedStatus->setEnabled(false);
    addWidget(m_savedStatus, 0, true);
    m_savedStatus->setToolTip("<p>" + i18n("Shows if there are changes that have not yet been saved."));


}
开发者ID:KrissN,项目名称:basket,代码行数:39,代码来源:basketstatusbar.cpp

示例2: prepareList

void EmoticonSelector::prepareList(void)
{
//	kdDebug(14000) << k_funcinfo << "called." << endl;
	int row = 0;
	int col = 0;
	QMap<QString, QStringList> list = Kopete::Emoticons::self()->emoticonAndPicList();
	int emoticonsPerRow = static_cast<int>(sqrt(list.count()));
	//kdDebug(14000) << "emoticonsPerRow=" << emoticonsPerRow << endl;

	if ( lay )
	{
		QObjectList *objList = queryList( "EmoticonLabel" );
		//kdDebug(14000) << k_funcinfo << "There are " << objList->count() << " EmoticonLabels to delete." << endl;
		objList->setAutoDelete(true);
		objList->clear();
		delete objList;
		delete lay;
	}

	lay = new QGridLayout(this, 0, 0, 4, 4, "emoticonLayout");
	movieList.clear();
	for (QMap<QString, QStringList>::const_iterator it = list.constBegin(); it != list.constEnd(); ++it )
	{
		QWidget *w = new EmoticonLabel(it.data().first(), it.key(), this);
		movieList.push_back( ((QLabel*)w)->movie() );
		connect(w, SIGNAL(clicked(const QString&)), this, SLOT(emoticonClicked(const QString&)));
//		kdDebug(14000) << "adding Emoticon to row=" << row << ", col=" << col << "." << endl;
		lay->addWidget(w, row, col);
		if ( col == emoticonsPerRow )
		{
			col = 0;
			row++;
		}
		else
			col++;
	}
	resize(minimumSizeHint());
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:38,代码来源:emoticonselector.cpp


注:本文中的QObjectList::clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。