本文整理汇总了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);
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
}
}
示例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);
}