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


C++ UserTab::wnd方法代码示例

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


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

示例1: mousePressEvent

void UserTabBar::mousePressEvent(QMouseEvent *e)
{
    if (e->button() == RightButton){
        QTab *t = selectTab(e->pos());
        if (t == NULL) return;
        UserTab *tab = static_cast<UserTab*>(t);

        EventMenuProcess eMenu(MenuContact, (void*)tab->wnd()->id());
        eMenu.process();
        QPopupMenu *menu = eMenu.menu();
        if (menu)
            menu->popup(e->globalPos());
        return;
    }
    if (e->button() == MidButton){
        //Close tab on middle button pressed
        QTab *t = selectTab(e->pos());
        if (t == NULL) return;
        UserTab *tab = static_cast<UserTab*>(t);
        Command cmd;
        cmd->id = CmdClose;
        cmd->param = (void*)tab->wnd()->id();
        EventCommandExec(cmd).process();
    }
    QTabBar::mousePressEvent(e);
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:26,代码来源:container.cpp

示例2: layoutTabs

UserWnd *UserTabBar::wnd(unsigned id)
{
    layoutTabs();
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id)
            return tab->wnd();
    }
    return NULL;
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例3: changeTab

void UserTabBar::changeTab(unsigned id)
{
    layoutTabs();
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id){
            tab->setText(tab->wnd()->getName());
            break;
        }
    }
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例4: isBold

bool UserTabBar::isBold(UserWnd *wnd)
{
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd() == wnd)
            return tab->isBold();
    }
    return false;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例5: raiseTab

void UserTabBar::raiseTab(unsigned id)
{
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id){
            setCurrentTab(tab);
            return;
        }
    }
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例6: setBold

void UserTabBar::setBold(unsigned id, bool bBold)
{
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id){
            if (tab->setBold(bBold))
                repaint();
            break;
        }
    }
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例7: count

list<UserWnd*> UserTabBar::windows()
{
    list<UserWnd*> res;
    unsigned n = count();
    for (unsigned i = 0; n > 0; i++){
        UserTab *t = static_cast<UserTab*>(tab(i));
        if (t == NULL)
            continue;
        res.push_back(t->wnd());
        n--;
    }
    return res;
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例8: removeTab

void UserTabBar::removeTab(unsigned id)
{
    layoutTabs();
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab == NULL)
            continue;
        if (tab->wnd()->id() == id){
            QTabBar::removeTab(tab);
            break;
        }
    }
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例9: mousePressEvent

void UserTabBar::mousePressEvent(QMouseEvent *e)
{
    if (e->button() == RightButton){
        QTab *t = selectTab(e->pos());
        if (t == NULL) return;
        UserTab *tab = static_cast<UserTab*>(t);
        ProcessMenuParam mp;
        mp.id = MenuContact;
        mp.param = (void*)(tab->wnd()->id());
        mp.key = 0;
        Event eMenu(EventProcessMenu, &mp);
        QPopupMenu *menu = (QPopupMenu*)eMenu.process();
        if (menu)
            menu->popup(e->globalPos());
        return;
    }
    QTabBar::mousePressEvent(e);
}
开发者ID:,项目名称:,代码行数:18,代码来源:


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