krita
kis_thread.h
00001 /* 00002 * copyright (c) 2005 Boudewijn Rempt 00003 * 00004 * this program is free software; you can redistribute it and/or modify 00005 * it under the terms of the gnu general public license as published by 00006 * the free software foundation; either version 2 of the license, or 00007 * (at your option) any later version. 00008 * 00009 * this program is distributed in the hope that it will be useful, 00010 * but without any warranty; without even the implied warranty of 00011 * merchantability or fitness for a particular purpose. see the 00012 * gnu general public license for more details. 00013 * 00014 * you should have received a copy of the gnu general public license 00015 * along with this program; if not, write to the free software 00016 * foundation, inc., 675 mass ave, cambridge, ma 02139, usa. 00017 */ 00018 00019 #ifndef KIS_THREAD_ 00020 #define KIS_THREAD_ 00021 00022 #include <qthread.h> 00023 #include <ksharedptr.h> 00024 00030 class KisThread : public QThread { 00031 00032 public: 00033 00037 KisThread() : QThread(), m_canceled(false) {}; 00038 00045 virtual void cancel() { m_canceled = true; } 00046 virtual bool isCanceled() { return m_canceled; } 00047 00048 void runDirectly() { run(); } 00049 00050 protected: 00051 00052 bool m_canceled; 00053 00054 }; 00055 00056 00057 #endif