[Qt-interest] Trying to understand Signal/slots.

Francisco Gonzalez Morell gzmorell at gmail.com
Mon Aug 23 02:08:55 CEST 2010


On Sábado 21 Agosto 2010 20:51:51 Thiago Macieira escribió:

> Emitting signals from classes derived from QThread is ok. The big NO-NO is
> the use of slots in such classes (see the "You're doing it wrong" blog).
 
>From the example in queuedcustomtype in 4.6.3 examples:


class RenderThread : public QThread
 {
     Q_OBJECT

   ...

 public slots:
     void stopProcess();

 protected:
     void run();

 private:
     bool m_abort;
     QImage m_image;
     QMutex mutex;
 };

 Window::Window()
 {
     thread = new RenderThread();
      ..

     connect(resetButton, SIGNAL(clicked()), thread, SLOT(stopProcess()));
     ..
}


Is any problem with the slot stopProcess?




More information about the Qt-interest-old mailing list