Results 1 to 14 of 14

Thread: increase microprocessor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2013
    Location
    Jerada, Morroco
    Posts
    106
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    11

    Default increase microprocessor

    Hi,

    is there a method to slow the loop without blocking the window.

    here is my code:
    Qt Code:
    1. while(m_pSocketUDP->hasPendingDatagrams())
    2. {
    3. T_Buffer *pBuffer=NULL;
    4. Sleep(1);///////// i'm using Sleep() but it block the window
    5. pBuffer = m_pBufferCirculaire->GetNextBuffer();
    6.  
    7. if(m_pSocketUDP)
    8. m_pSocketUDP->readDatagram((char*)pBuffer->cData,MAX_SIZE_PACKET,&QHostAddress(m_pConnectionRTAS->szAddress),&quiPort);
    9.  
    10. sReveivevalidate = *((unsigned short*) &pBuffer->cData);
    11. sSizePacketReceive = *((unsigned short*) &pBuffer->cData[POSITION_SIZE_PACKET]);
    12. sDeadValue = *((unsigned short*) &pBuffer->cData[sSizePacketReceive - SIZE_END_PACKET]);
    13.  
    14. if(sReveivevalidate == KEY_SECURITY_RTAS && sDeadValue == END_PACKET)
    15. pBuffer->cStatut = VALID_MSG;
    16.  
    17. if(m_pBufferCirculaire)
    18. m_pBufferCirculaire->EnWriteOnNextBuffer();
    19.  
    20. }
    To copy to clipboard, switch view to plain text mode 
    thank you in advance
    Last edited by anda_skoa; 13th February 2014 at 19:38. Reason: Added code tags

Similar Threads

  1. How to increase progress bar
    By shivendra46d in forum Newbie
    Replies: 7
    Last Post: 11th September 2013, 13:07
  2. memory increase when use PageStack
    By jindoniit in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 13th October 2011, 11:23
  3. QSystemTrayIcon increase width
    By sagirahmed in forum General Programming
    Replies: 1
    Last Post: 28th September 2011, 15:33
  4. How to increase available RAM for Qt Creator?
    By fezvez in forum Qt Tools
    Replies: 4
    Last Post: 19th April 2011, 21:37
  5. Increase the height of titlebar, ...
    By vql in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2008, 11:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.