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


C++ processEvents函数代码示例

本文整理汇总了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);
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:8,代码来源:directshoweventloop.cpp

示例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;
}
开发者ID:igemsoftware,项目名称:USTC-Software_2011,代码行数:46,代码来源:DesignerApp.cpp

示例3: while

void Game::run()
{
	while (mWindow.isOpen())
	{
		processEvents();
		render();
	}
}
开发者ID:MORTAL2000,项目名称:15-Puzzle-Game,代码行数:8,代码来源:Game.cpp

示例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();
	}
}
开发者ID:lukitree,项目名称:Testing,代码行数:17,代码来源:Game.cpp

示例5: DBG

void AmCallWatcher::run() {
  DBG("starting call watcher.\n");
  garbage_collector->start();
  while (true) {
    waitForEvent();
    processEvents();
  }
}
开发者ID:sems-server,项目名称:sems,代码行数:8,代码来源:AmCallWatcher.cpp

示例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);
     }
 }
开发者ID:psprint,项目名称:keyfrog,代码行数:14,代码来源:EventMonitorMac.cpp

示例7: while

void TuioDemo::run() {
	running=true;
	while (running) {
		drawObjects();
		processEvents();
		SDL_Delay(40);
	} 
}
开发者ID:Ahmedn1,项目名称:ccv-hand,代码行数:8,代码来源:TuioDemo.cpp

示例8: run

 void run() {
     do {
         processEvents();
         update();
         render();
     }
     while (_window.isOpen());
 }
开发者ID:xeloni,项目名称:ProjetsClion,代码行数:8,代码来源:application.hpp

示例9: processEvents

	void InputSystem::tick()
	{
		if (!m_isCapturing) {
			return;
		}

		processEvents();
	}
开发者ID:CharlieCraft,项目名称:axonengine,代码行数:8,代码来源:event.cpp

示例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;
}
开发者ID:pauloliver,项目名称:networkChat,代码行数:59,代码来源:PacketManager.cpp

示例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;
}
开发者ID:RobertoMalatesta,项目名称:ProDBG,代码行数:58,代码来源:linux_main.cpp

示例12: while

void MenuServeur::run()
{
  while (mWindow.isOpen())
  {
//    musiccc();
    processEvents();
    render();
}
}
开发者ID:othmane123,项目名称:ProjetMorpion,代码行数:9,代码来源:MenuServeur.cpp

示例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;
}
开发者ID:Godzil,项目名称:quickdev16,代码行数:57,代码来源:main.cpp

示例14: run

	void run()
	{
		while (mWindow.isOpen())
		{
			processEvents();
			update();
			render();
		}
	}
开发者ID:gato0429,项目名称:ForgeGame,代码行数:9,代码来源:main.cpp

示例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();
    }
}
开发者ID:Yves-T,项目名称:SFML_Pong,代码行数:18,代码来源:PongGame.cpp


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