本文整理汇总了C++中QList::find方法的典型用法代码示例。如果您正苦于以下问题:C++ QList::find方法的具体用法?C++ QList::find怎么用?C++ QList::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QList
的用法示例。
在下文中一共展示了QList::find方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tile_maximize
void qapp::tile_maximize(xwindow *client)
{
int i;
if(tmaxclient != NULL && (i = clients.find(tmaxclient)) != -1)
clients.insert(clients.find(client), clients.take(i));
tile_order(client);
}
示例2: toggle_tiled
void qapp::toggle_tiled(void) // toggle overlapped/tiled desk
{
xwindow *client;
if(smode)
return;
if(tdesks[adesk])
{
for(client = clients.first(); client != NULL; client = clients.next())
{
if(is_curdesk(client))
client->unset_tile();
}
tdesks[adesk] = FALSE;
tmaxclient = NULL;
if(focusclient != NULL && clients.find(client) != -1)
focusclient->focus_mouse();
tb_wl->set_pixmap();
return;
}
tile_order(focusclient);
tdesks[adesk] = TRUE;
tb_wl->set_pixmap();
}
示例3: setinactive
void qapp::setinactive(xwindow *client) // set last active client to inactive
{
if(client != focusclient)
{
if(focusclient != NULL && clients.find(focusclient) != -1) // still there
focusclient->setinactive();
focusclient = client;
}
}
示例4: stopautofocus
void qapp::stopautofocus(void)
{
if(focusclient != NULL && clients.find(focusclient) != -1)
focusclient->stopautofocus();
}
示例5: if
bool qapp::x11EventFilter(XEvent *event)
{
xwindow *client;
Window w;
XEvent ev;
XConfigureRequestEvent *cev;
XClientMessageEvent *mev;
XCrossingEvent *xev;
XCirculateRequestEvent *rev;
XPropertyEvent *pev;
#ifdef DEBUGMSG
#include "eventnames.h"
if(event->type < 36)
logmsg << "Received: " << event_names[event->type] << " (WId:" << event->xany.window << ")\n";
#endif
while(waitpid(-1, NULL, WNOHANG) > 0);
if(sighup)
{
wm_restart();
tb_mn->readmenu();
read_cprops();
sighup = FALSE;
}
switch(event->type)
{
case DestroyNotify:
w = event->xdestroywindow.window;
if((client = cwindows.find(w)) != NULL)
{
clients.remove(client);
if(smode && client->isstate())
keyboard::tscreen(); // turn off screen mode
tb_pg->draw_pager();
return TRUE;
}
if(tb_ap->remove(w)) // client on toolbar
return TRUE;
if(event->xdestroywindow.event != w)
return TRUE;
if(w == tb->winId() || w == tb_pg->winId() || w == tb_wl->winId() || w == tb_mn->winId() || w == tb_pb->winId())
sig_term(SIGTERM);
return FALSE;
case MapNotify:
if(event->xmap.event != event->xmap.window)
return TRUE;
if((client = pwindows.find(event->xmap.window)) != NULL)
tb_pg->add(client); // add to pager
return FALSE;
case UnmapNotify:
if((client = cwindows.find(event->xunmap.window)) != NULL)
{
if(event->xunmap.send_event)
{
// client requested transitions
// normal -> withdrawn
// iconic -> withdrawn
client->withdraw();
}
else
client->unmap();
return TRUE;
}
if(event->xunmap.event != event->xunmap.window)
return TRUE;
if(pwindows.find(event->xunmap.window) != NULL)
tb_pg->draw_pager();
return FALSE;
case EnterNotify:
xev = &event->xcrossing;
if(event->xcrossing.window == qt_xrootwin())
{
stopautofocus();
rootptr = TRUE;
}
else if(mrb == FALSE && menu_open == FALSE && (client = (xwindow *)widgetAt(xev->x_root, xev->y_root)) != NULL &&
clients.find(client) != -1 && ((client = clients.current()) != focusclient || rootptr))
{
rootptr = FALSE;
setinactive(client); // old client to inactive, save new client
//.........这里部分代码省略.........
示例6: tile_order
void qapp::tile_order(xwindow *actclient)
{
if(smode)
return;
xwindow *client,*tmcl=NULL;
int cct=0,cheight,lh=0;
QWidget *dt = QApplication::desktop();
if(actclient != NULL && (clients.find(actclient) == -1 || ! actclient->is_tileable() || actclient->is_unmapped() || ! is_curdesk(actclient)))
actclient = NULL;
for(client = clients.first(); client != NULL; client = clients.next())
{
if(client != actclient && ! client->is_unmapped() && is_curdesk(client) && client->is_tileable())
cct++;
}
if(actclient == NULL && cct > 0)
cct--;
tmaxclient = NULL;
if(cct)
cheight = (dt->height()-defaults::tb_height)/cct;
int xpos,xcw,ypos,yp;
ypos = yp = defaults::toolbar_top?defaults::tb_height+1:0;
xpos = (int)(dt->width()*defaults::tleftspace);
xcw = dt->width()-xpos-1;
for(client = clients.first(); client != NULL; client = clients.next())
{
if(! client->is_tileable() || client->is_unmapped() || ! is_curdesk(client))
continue;
if(actclient == NULL || cct == 0)
actclient = client;
if(client == actclient)
{
tmcl = tmaxclient = client;
continue;
}
if(lh < 0)
lh = 0;
client->minimize_frame(cct > defaults::wminframe?TRUE:FALSE);
lh = client->set_tile(xpos+1, ypos-lh, xcw, cheight+lh);
ypos += cheight;
}
if(tmcl != NULL)
{
tmcl->minimize_frame(FALSE);
tmcl->set_tile(0, yp, xpos, dt->height()-defaults::tb_height);
}
if(actclient != NULL)
clients.prepend(clients.take(clients.find(actclient)));
}