本文整理汇总了C++中processEvents函数的典型用法代码示例。如果您正苦于以下问题:C++ processEvents函数的具体用法?C++ processEvents怎么用?C++ processEvents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processEvents函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processEvents
void DirectShowEventLoop::customEvent(QEvent *event)
{
if (event->type() == QEvent::User) {
processEvents();
} else {
QObject::customEvent(event);
}
}
示例2: pixmap
bool DesignerApp::initApplication(QString cmdLine)
{
QLocale::setDefault(QLocale(QLocale::English));
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
QPixmap pixmap(":/designer/splash.png");
QSplashScreen *splash = new QSplashScreen(pixmap);
splash->show();
splash->showMessage(tr("Loading..."));
processEvents();
writeConfigValue("", "apppath", QtSingleApplication::applicationFilePath());
dbIgame = QSqlDatabase::addDatabase("QMYSQL","igame");
dbIgame.setDatabaseName("MoDeL");
dbIgame.setHostName("localhost");
dbIgame.setUserName("root");
dbIgame.setPassword("lovewin");
dbIgame.open();
DesignerViewMgr::initializeIfNotYet();
DesignerDocMgr::initializeIfNotYet();
DesignerModelMgr::initializeIfNotYet();
DesignerExtensionMgr::initializeIfNotYet();
DesignerMainWnd* mainWnd = DesignerMainWnd::globalCreateNewMainWnd();
setActivationWindow(mainWnd);
QObject::connect(this, SIGNAL(messageReceived(const QString&)), mainWnd, SLOT(instanceMessageReceived(const QString&)));
splash->setWindowFlags(Qt::WindowStaysOnTopHint);
splash->setParent(mainWnd);
splash->show();
QTimer::singleShot(1500, splash, SLOT(close()));
if(cmdLine!="/new")
mainWnd->instanceMessageReceived(cmdLine);
while(splash->isVisible())
{
processEvents();
}
return true;
}
示例3: while
void Game::run()
{
while (mWindow.isOpen())
{
processEvents();
render();
}
}
示例4: while
void Game::run()
{
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;
while (mWindow.isOpen())
{
processEvents();
timeSinceLastUpdate += clock.restart();
while (timeSinceLastUpdate > TimePerFrame)
{
timeSinceLastUpdate -= TimePerFrame;
processEvents();
update(TimePerFrame);
}
render();
}
}
示例5: DBG
void AmCallWatcher::run() {
DBG("starting call watcher.\n");
garbage_collector->start();
while (true) {
waitForEvent();
processEvents();
}
}
示例6: while
/**
* Waits for new OSX event (TODO: thread)
* Virtual
*
* @return RawEvent object
*/
void EventMonitorMac::waitForEvents() {
int i = 10;
while ( events.size() == 0 ) {
// Wait for some event
processEvents();
usleep(75000);
}
}
示例7: while
void TuioDemo::run() {
running=true;
while (running) {
drawObjects();
processEvents();
SDL_Delay(40);
}
}
示例8: run
void run() {
do {
processEvents();
update();
render();
}
while (_window.isOpen());
}
示例9: processEvents
void InputSystem::tick()
{
if (!m_isCapturing) {
return;
}
processEvents();
}
示例10: ERR_PRINT
// ============================================================================
ssize_t PacketManager::sendto_Err(int s, void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen)
{
int nResult = 0;
if (buf == NULL)
{
ERR_PRINT("buf pointer == NULL\n");
exit(1);
}
if (len == 0)
{
ERR_PRINT("len == 0: %u\n", len);
exit(1);
}
if (to == NULL)
{
ERR_PRINT("sockaddr pointer == NULL\n");
exit(1);
}
++m_MsgNo;
uint32_t seqNo = ntohl(*(uint32_t*)(buf));
MSG_PRINT("MSG# %3u SEQ# %3u LEN %4u FLAGS 0x%08X\n", m_MsgNo, seqNo, len, flags);
size_t lenTmp = len;
unsigned char bufTmp[len];
memcpy(bufTmp, buf, lenTmp);
void* pBuf = bufTmp;
nResult = processEvents((void**)&pBuf, &lenTmp, m_MsgNo);
if (nResult < 0)
{
ERR_PRINT("prcoessEvents\n");
return nResult;
}
else if ((nResult == 0) || (nResult == 1))
{
ssize_t lenSent = sendto(s, pBuf, lenTmp, flags, to, tolen);
if (lenSent == (ssize_t)lenTmp)
{
return len;
}
else
{
return lenSent;
}
}
else
{
return len;
}
return -1;
}
示例11: main
int main(int argc, const char** argv)
{
XInitThreads();
s_display = XOpenDisplay(0);
int32_t screen = DefaultScreen(s_display);
int32_t depth = DefaultDepth(s_display, screen);
Visual* visual = DefaultVisual(s_display, screen);
Window root = RootWindow(s_display, screen);
XSetWindowAttributes windowAttrs = { 0 };
windowAttrs.background_pixmap = 0;
windowAttrs.border_pixel = 0;
windowAttrs.event_mask = 0
| ButtonPressMask
| ButtonReleaseMask
| ExposureMask
| KeyPressMask
| KeyReleaseMask
| PointerMotionMask
| StructureNotifyMask
;
int width = 800;
int height = 600;
s_window = XCreateWindow(s_display
, root
, 0, 0
, width, height, 0, depth
, InputOutput
, visual
, CWBorderPixel | CWEventMask
, &windowAttrs
);
// Clear window to black.
XSetWindowAttributes attr = { 0 };
XChangeWindowAttributes(s_display, s_window, CWBackPixel, &attr);
const char* wmDeleteWindowName = "WM_DELETE_WINDOW";
XInternAtoms(s_display, (char**)&wmDeleteWindowName, 1, False, &wmDeleteWindow);
XSetWMProtocols(s_display, s_window, &wmDeleteWindow, 1);
XMapWindow(s_display, s_window);
XStoreName(s_display, s_window, "ProDBG");
bgfx::x11SetDisplayWindow(s_display, s_window);
ProDBG_create((void*)s_window, width, height);
processEvents();
XUnmapWindow(s_display, s_window);
XDestroyWindow(s_display, s_window);
return EXIT_SUCCESS;
}
示例12: while
void MenuServeur::run()
{
while (mWindow.isOpen())
{
// musiccc();
processEvents();
render();
}
}
示例13: App
int Application::main(int argc, char **argv) {
app = new App(argc, argv);
#if !defined(_WIN32)
//Windows port uses 256x256 icon from resource file
app->setWindowIcon(QIcon(":/bsnes.png"));
#endif
initargs(argc, argv); //ensure argv[]s are in UTF-8 format
initPaths(argv[0]);
locateFile(configFilename = "bsnes.cfg", true);
locateFile(styleSheetFilename = "style.qss", false);
string customStylesheet;
if(customStylesheet.readfile(styleSheetFilename) == true) {
app->setStyleSheet((const char*)customStylesheet);
} else {
app->setStyleSheet(defaultStylesheet);
}
config.load(configFilename);
init();
snes.init();
if(argc == 2) {
//if valid file was specified on the command-line, attempt to load it now
utility.loadCartridge(argv[1]);
}
while(terminate == false) {
processEvents();
utility.updateSystemState();
inputManager.refresh();
if(config.input.focusPolicy == Configuration::Input::FocusPolicyPauseEmulation) {
bool inactive = (winMain->window->isActiveWindow() == false);
if(!autopause && inactive) {
autopause = true;
audio.clear();
} else if(autopause && !inactive) {
autopause = false;
}
} else {
autopause = false;
}
if(cartridge.loaded() && !pause && !autopause) {
snes.runtoframe();
} else {
usleep(20 * 1000);
}
supressScreenSaver();
}
config.save(configFilename);
return 0;
}
示例14: run
void run()
{
while (mWindow.isOpen())
{
processEvents();
update();
render();
}
}
示例15: while
void PongGame::run() {
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;
while (mainWindow.isOpen()) {
processEvents();
sf::Time elapsedTime = clock.restart();
timeSinceLastUpdate += elapsedTime;
while (timeSinceLastUpdate > timePerFrame) {
timeSinceLastUpdate -= timePerFrame;
processEvents();
// no matter what happens, give the same delta time to the update function
update();
}
updateStatistics(elapsedTime);
render();
}
}