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


C++ setCurrentItem函数代码示例

本文整理汇总了C++中setCurrentItem函数的典型用法代码示例。如果您正苦于以下问题:C++ setCurrentItem函数的具体用法?C++ setCurrentItem怎么用?C++ setCurrentItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: itemAt

void VDirectoryTree::mousePressEvent(QMouseEvent *event)
{
    QTreeWidgetItem *item = itemAt(event->pos());
    if (!item) {
        setCurrentItem(NULL);
    }

    VTreeWidget::mousePressEvent(event);
}
开发者ID:vscanf,项目名称:vnote,代码行数:9,代码来源:vdirectorytree.cpp

示例2: setCurrentItem

void XmlTreeWidget::slotFindPrev()
{
    int iCur, iPrev;
    iCur = m_foundItems.indexOf(currentItem());
    if(iCur != -1 && iCur > 0) {
        iPrev = iCur-1;
        setCurrentItem(m_foundItems.at(iPrev));
    }
}
开发者ID:cidadao,项目名称:DamnSimpleXML,代码行数:9,代码来源:xmltreewidget.cpp

示例3: findItemByUrl

void ScanGallery::slotSelectImage(const KUrl &url)
{
    FileTreeViewItem *found = findItemByUrl(url);
    if (found==NULL) found = m_defaultBranch->root();

    scrollToItem(found);
    setCurrentItem(found);
    slotItemActivated(found);
}
开发者ID:KDE,项目名称:kooka,代码行数:9,代码来源:scangallery.cpp

示例4: setCurrentItem

void DualEditableTree::itemClicked(QListViewItem *item, const QPoint &, int column)
{
  if(item)
  {
    curCol = column;
    if(item == currentItem())
      setCurrentItem(item);
  }
}
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:9,代码来源:tagattributetree.cpp

示例5: currentItemFromSelection

void PropertyWidget_PathText::handleSelectionChanged()
{
	if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning())
		return;

	PageItem* currItem = currentItemFromSelection();
	setCurrentItem(currItem);
	updateGeometry();
}
开发者ID:Fahad-Alsaidi,项目名称:scribus-svn,代码行数:9,代码来源:propertywidget_pathtext.cpp

示例6: currentItemFromSelection

void PropertiesPalette_Group::handleSelectionChanged()
{
	if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
		return;

	PageItem* currItem = currentItemFromSelection();
	if (m_doc->m_Selection->count() > 1)
	{
		bool widgetEnabled = false;
		if (m_haveItem && m_item)
		{
			if ((m_item->isGroup()) && (!m_item->isSingleSel))
				widgetEnabled = true;
		}
		setEnabled(widgetEnabled);
	}
	else
	{
		int itemType = currItem ? (int) currItem->itemType() : -1;
		m_haveItem = (itemType != -1);

		switch (itemType)
		{
		case -1:
			setEnabled(false);
			break;
		case PageItem::ImageFrame:
		case PageItem::LatexFrame:
		case PageItem::OSGFrame:
			if (currItem->asOSGFrame())
			{
				setEnabled(false);
			}
			break;
		case PageItem::Arc:
		case PageItem::TextFrame:
		case PageItem::Line:
		case PageItem::ItemType1:
		case PageItem::ItemType3:
		case PageItem::Polygon:
		case PageItem::PolyLine:
		case PageItem::PathText:
		case PageItem::RegularPolygon:
			setEnabled(false);
			break;
		case PageItem::Symbol:
			setEnabled(true);
			break;
		}
	}
	if (currItem)
	{
		setCurrentItem(currItem);
	}
	updateGeometry();
	repaint();
}
开发者ID:pvanek,项目名称:scribus-cuba-trunk,代码行数:57,代码来源:propertiespalette_group.cpp

示例7: setCurrentItem

void KCombo::setText( const char *text)
{
    setCurrentItem(0);
    if (!set_text_called) {
	set_text_called = true;
	insertItem(text, 0);
    } 
    changeItem(text, 0);
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:9,代码来源:kcombo.cpp

示例8: getNoteWithGuid

void NotesWidget::selectNoteWithGuid(QString guid)
{
    ListItem *item = getNoteWithGuid(guid);

    if (item == NULL)
        return;

    setCurrentItem(item);
}
开发者ID:MidoriYakumo,项目名称:hippo,代码行数:9,代码来源:noteswidget.cpp

示例9: QTreeWidget

    /* 构造函数实现 */
    _CategoriesTree::_CategoriesTree(QWidget *_Parent)
        : QTreeWidget(_Parent)
        {
        /* "评分" */
        m_RatingRootItem = new QTreeWidgetItem(this, QStringList() << wxNote::g_RatingListName);
        m_RatingRootItem->setIcon(0, QIcon(":/wxNote_Icons/rating.png"));
        m_RatingRootItem->setExpanded(true);

        m_ExcellentItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_ExcellentName);
        m_ExcellentItem->setIcon(0, QIcon(":/wxNote_Icons/excellent.png"));

        m_GoodItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_GoodName);
        m_GoodItem->setIcon(0, QIcon(":/wxNote_Icons/good.png"));

        m_AverageItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_AverageName);
        m_AverageItem->setIcon(0, QIcon(":/wxNote_Icons/average.png"));

        m_FairItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_FairName);
        m_FairItem->setIcon(0, QIcon(":/wxNote_Icons/fair.png"));

        m_PoorItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << ("差"));
        m_PoorItem->setIcon(0, QIcon(":/wxNote_Icons/poor.png"));

        /* "颜色标签" */
        m_ColorLabelRootItem = new QTreeWidgetItem(
                                this, QStringList() << wxNote::g_ColorLabelListName);
        m_ColorLabelRootItem->setIcon(0, QIcon(":/wxNote_Icons/colorLabel.png"));
        m_ColorLabelRootItem->setExpanded(true);

        m_ImportantItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                              QStringList() << wxNote::g_ImportantName);
        m_ImportantItem->setIcon(0, QIcon(":/wxNote_Icons/important.png"));

        m_WorkItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                         QStringList() << wxNote::g_WorkName);
        m_WorkItem->setIcon(0, QIcon(":/wxNote_Icons/work.png"));

        m_PersonalItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                             QStringList() << wxNote::g_PersonalName);
        m_PersonalItem->setIcon(0, QIcon(":/wxNote_Icons/personal.png"));

        m_ToDoItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                         QStringList() << wxNote::g_ToDoName);
        m_ToDoItem->setIcon(0, QIcon(":/wxNote_Icons/toDo.png"));

        m_LaterItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                          QStringList() << wxNote::g_LaterName);
        m_LaterItem->setIcon(0, QIcon(":/wxNote_Icons/later.png"));

        setCurrentItem(m_RatingRootItem);
        setHeaderHidden(true);
        }
开发者ID:0xbda2d2f8,项目名称:wxNote,代码行数:58,代码来源:CategoriesTree.cpp

示例10: setItemExpanded

void ScTreeWidget::handleMousePress(QTreeWidgetItem *item)
{
    if (item == 0)
        return;
    if (item->parent() == 0)
    {
        if (item->isDisabled())
        {
            setItemExpanded(item, false);
            return;
        }
        int wide = 0;
        int tops = topLevelItemCount();
        if (m_toolbox_mode)
        {
            for (int t = 0; t < tops; t++)
            {
                setItemExpanded(topLevelItem(t), false);
            }
            setCurrentItem(item);
            setItemExpanded(item, true);
            if (item->childCount() != 0)
            {
                QTreeWidgetItem *child = item->child(0);
                if (child != 0)
                    wide = itemWidget(child, 0)->minimumSizeHint().width()+5;
            }
            if (wide != 0)
                setColumnWidth(0, wide);
            else
                resizeColumnToContents(0);
        }
        else
        {
            setItemExpanded(item, !isItemExpanded(item));
            for (int t = 0; t < tops; t++)
            {
                QTreeWidgetItem *top = topLevelItem(t);
                if (isItemExpanded(top))
                {
                    if (top->childCount() != 0)
                    {
                        QTreeWidgetItem *child = top->child(0);
                        if (child != 0)
                            wide = qMax(wide, itemWidget(child, 0)->minimumSizeHint().width()+5);
                    }
                }
            }
        }
        if (wide != 0)
            setColumnWidth(0, wide);
        else
            resizeColumnToContents(0);
        emit currentChanged2(indexOfTopLevelItem(item));
    }
}
开发者ID:gyuris,项目名称:scribus,代码行数:56,代码来源:sctreewidget.cpp

示例11: setCurrentItem

void ButtonWithMenu::addItem(const Item &item)
{
    m_items.append(item);

    if (m_items.count() == 1) {
        setCurrentItem(item);
    }

    emit itemAdded(item);
}
开发者ID:Martii,项目名称:qupzilla,代码行数:10,代码来源:buttonwithmenu.cpp

示例12: setCurrentItem

void FeedListWidget::handleItemAboutToBeRemoved(RSS::Item *rssItem)
{
    rssItem->disconnect(this);
    delete m_rssToTreeItemMapping.take(rssItem);

    // RSS Item is still valid in this slot so if it is the last
    // item we should prevent Unread list populating
    if (m_rssToTreeItemMapping.size() == 1)
        setCurrentItem(nullptr);
}
开发者ID:paolo-sz,项目名称:qBittorrent,代码行数:10,代码来源:feedlistwidget.cpp

示例13: currentItem

void TreeWidget::collapseCurrentConnection()
{
    QTreeWidgetItem* item = currentItem();
    if (item && item->parent())
        item = item->parent();
    if (item) {
        collapseItem(item);
        setCurrentItem(item);
    }
}
开发者ID:jpnurmi,项目名称:communi-desktop,代码行数:10,代码来源:treewidget.cpp

示例14: setCurrentItem

void StatusPicker::setStatusId( int statusid )
{
    QMap<int,int>::Iterator it;
    for ( it = index2id.begin(); it != index2id.end(); ++it ) {
	if ( it.data() == statusid ) {
	    setCurrentItem( it.key() );
	    break;
	}
    }
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:10,代码来源:main.cpp

示例15: currentItemFromSelection

void PropertiesPalette_Shadow::handleSelectionChanged()
{
	if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
		return;

	PageItem* currItem = currentItemFromSelection();
	if (currItem)
		setCurrentItem(currItem);
	updateGeometry();
}
开发者ID:Fahad-Alsaidi,项目名称:scribus-svn,代码行数:10,代码来源:propertiespalette_shadow.cpp


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