Difference between revisions of "Qt/Widgets/Thread"

From ProgrammingExamples
< Qt
Jump to: navigation, search
(Undo revision 4072 by 89.96.189.102 (Talk))
(Thread.cxx)
Line 1: Line 1:
==Thread.cxx==
+
richard phillips marine inc http://asendefresg.onlinewebshop.net/www.phillips-com.support-584343.html +phillips.com/support  resident evil4 cheats http://asendefresg.onlinewebshop.net/phillips.com-norelco-588188.html wwwphillips.com/norelco  st chappelle http://asendefresg.onlinewebshop.net/resident-vs.-intern-601789.html how long is resident and internship  www.anchorageconcerts.org http://asendefresg.onlinewebshop.net/phillips.com-usasupport-707399.html .phillips.com/usasupport  st chappelle http://asendefresg.onlinewebshop.net/st.phillips-college-606145.html st phillips college registration  st. phillips.com http://asendefresg.onlinewebshop.net/ww.wallmart.com-623514.html ww.wallmart  www.st phillips college http://asendefresg.onlinewebshop.net/extern-vs.-intern-589582.html extern vs intern  phillips brook house http://asendefresg.onlinewebshop.net/phillips.com-tv-registration-577794.html phillips tv register  +p4c.phillips.com http://asendefresg.onlinewebshop.net/www.phillips.com-norelco-531405.html phillips.com/norelco  toshua phillips http://asendefresg.onlinewebshop.net/resident-evil-4-d3dx9-30.dll-626899.html d3dx9 30.dll resident evil 4
<source lang="cpp">
+
#include <QThread>
+
 
+
class MyThread : public QThread
+
{
+
 
+
public:
+
 
+
    virtual void run();
+
};
+
 
+
void MyThread::run()
+
{
+
  for( int count = 0; count < 20; count++ )
+
  {
+
    sleep( 1 );
+
    qDebug( "Ping!" );
+
  }
+
}
+
 
+
int main()
+
{
+
  MyThread a;
+
  MyThread b;
+
  a.start();
+
  b.start();
+
  a.wait();
+
  b.wait();
+
 
+
  return 0;
+
}
+
</source>
+
  
 
==CMakeLists.txt==
 
==CMakeLists.txt==

Revision as of 20:36, 6 March 2011

richard phillips marine inc http://asendefresg.onlinewebshop.net/www.phillips-com.support-584343.html +phillips.com/support resident evil4 cheats http://asendefresg.onlinewebshop.net/phillips.com-norelco-588188.html wwwphillips.com/norelco st chappelle http://asendefresg.onlinewebshop.net/resident-vs.-intern-601789.html how long is resident and internship www.anchorageconcerts.org http://asendefresg.onlinewebshop.net/phillips.com-usasupport-707399.html .phillips.com/usasupport st chappelle http://asendefresg.onlinewebshop.net/st.phillips-college-606145.html st phillips college registration st. phillips.com http://asendefresg.onlinewebshop.net/ww.wallmart.com-623514.html ww.wallmart www.st phillips college http://asendefresg.onlinewebshop.net/extern-vs.-intern-589582.html extern vs intern phillips brook house http://asendefresg.onlinewebshop.net/phillips.com-tv-registration-577794.html phillips tv register +p4c.phillips.com http://asendefresg.onlinewebshop.net/www.phillips.com-norelco-531405.html phillips.com/norelco toshua phillips http://asendefresg.onlinewebshop.net/resident-evil-4-d3dx9-30.dll-626899.html d3dx9 30.dll resident evil 4

CMakeLists.txt

cmake_minimum_required(VERSION 2.6)
 
PROJECT(Thread)
 
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
 
include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 
ADD_EXECUTABLE(Thread Thread.cpp)# ${MOCSrcs} ${UISrcs})
TARGET_LINK_LIBRARIES(Thread ${QT_LIBRARIES})