I though that I should do in such way(I didnot explored Qthread enough yet):
public void run() {
Filewalker::writetoXML();
}
}
class Writefile: public QThread {
public void run() {
Filewalker::writetoXML();
}
}
To copy to clipboard, switch view to plain text mode
here is question is it enough just put Filewalker.h (just with Filewalker::writetoXML() declaration, but definition in main.cpp --really seems improbable, so I think I need to create header for writetoXML() --writetoXML.h ) in aforementioned file with Writefile
then, to initialize Qthread in QWidget:
Writefile wr; //(or Writefile* wr=new WriteFile();)
Qtobject::connect(writebutton,SIGNAL(clicked()), this (//or &wr), SLOT(wr.exec() //or wr.start);
Writefile wr; //(or Writefile* wr=new WriteFile();)
Qtobject::connect(writebutton,SIGNAL(clicked()), this (//or &wr), SLOT(wr.exec() //or wr.start);
To copy to clipboard, switch view to plain text mode
What is incorrect, it is my blueprint...
So should I Extend MyWidget the Qobject or can I realize just with main(widget).cpp --that is--should I declare the slots in final Widget file or in initial file such as FileWalker.h
or methodheader - writetoXML.h?
So maybe I should abstain of this console file from here http://www.qtcentre.org/threads/6455...197#post285197 and put all definition of
slots (that are functions from Filewalker) in one big Widget File that defines such functions as (indexate files, writetoxml, renderxml, searchbyname) with QButtons, Qlabels, and connect statements.
The question is appered in such case -- where to define Qthread class for every button (in header?), and then initialize it in Widget file???
Bookmarks