• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setCurrentItem函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: currentItem

void SummaryTree::deleteTask()
{
    if (QMessageBox::warning(this, tr("Lemon"), tr("Are you sure to delete this task?"),
                             QMessageBox::Yes, QMessageBox::Cancel) == QMessageBox::Cancel)
        return;
    QTreeWidgetItem *curItem = currentItem();
    if (indexOfTopLevelItem(curItem) == -1)
        curItem = curItem->parent();
    int index = indexOfTopLevelItem(curItem);
    if (index + 1 < topLevelItemCount())
        setCurrentItem(topLevelItem(index + 1));
    else
        if (index - 1 >= 0)
            setCurrentItem(topLevelItem(index - 1));
        else
            setCurrentItem(0);
    delete curItem;
    curContest->deleteTask(index);
}
开发者ID:DapperX,项目名称:project-lemon,代码行数:19,代码来源:summarytree.cpp


示例17: initializeItem

PassRefPtr<HistoryItem> HistoryController::createItem()
{
    RefPtr<HistoryItem> item = HistoryItem::create();
    initializeItem(item.get());
    
    // Set the item for which we will save document state
    setCurrentItem(item.get());
    
    return item.release();
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:10,代码来源:HistoryController.cpp


示例18: initializeItem

Ref<HistoryItem> HistoryController::createItem()
{
    Ref<HistoryItem> item = HistoryItem::create();
    initializeItem(item);
    
    // Set the item for which we will save document state
    setCurrentItem(item.ptr());
    
    return item;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:10,代码来源:HistoryController.cpp


示例19: itemAt

void RListWidget::contextMenuEvent(QContextMenuEvent* e) {
    if (e != NULL) {
        QListWidgetItem* item = itemAt(e->pos());
        if (item != NULL) {
            setCurrentItem(item);
            emit itemClicked(item);
        }
    }
    e->ignore();
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:10,代码来源:RListWidget.cpp


示例20: Q3ComboBox

ComboVisibility::ComboVisibility(QWidget * parent, UmlVisibility v, bool nodefault) 
    : Q3ComboBox(FALSE, parent) {
  // the last value MUST be default
  for (int i = 0; i != (int) UmlDefaultVisibility; i += 1)
    insertItem(stringify((UmlVisibility) i));

  if (!nodefault)
    insertItem(stringify(UmlDefaultVisibility));
  setCurrentItem(v);
}
开发者ID:SciBoy,项目名称:douml,代码行数:10,代码来源:ClassSettingsDialog.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setCurrentPage函数代码示例发布时间:2022-05-30
下一篇:
C++ setCurrentIndex函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap