Lets assume that several signals could be connected to one slot -- despite it seems that it could be without signals in the whole.
We have such method:
void Lister::readxmldirectly() {
QXmlStreamWriter stream(ba);
stream.setAutoFormatting(true);
stream.writeStartDocument();
stream.writeStartElement("FILESYSTEM");
foreach (Filewalker* fp, Lister::listed) {
stream.writeStartElement("FILE");
stream.writeStartElement("NAME");
..........
Lister::textview->setText(ReadFile.readAll()); (2)
}
void Lister::readxmldirectly() {
QByteArray* ba=new QByteArray();
QXmlStreamWriter stream(ba);
stream.setAutoFormatting(true);
stream.writeStartDocument();
stream.writeStartElement("FILESYSTEM");
foreach (Filewalker* fp, Lister::listed) {
stream.writeStartElement("FILE");
stream.writeStartElement("NAME");
..........
QTextStream ReadFile(ba); (1)
Lister::textview->setText(ReadFile.readAll()); (2)
}
To copy to clipboard, switch view to plain text mode
then I could put the (1) in signal processing method --signal()
then emit it, or simply put in run(), but in this case the signal() should be static one.
Then pass the (1) Qtextstream already outside of thread in SLOT of Lister
where would be the last line of above method-
Lister::textview->setText(ReadFile.readAll());
Lister::textview->setText(ReadFile.readAll());
To copy to clipboard, switch view to plain text mode
--If use the emit signal() --where put [emit signal()]?
Inside run()?
And it is in case if the signature of connect would be such one,
connect(f->readxml, SIGNAL(clicked()),f, SLOT(readthread()));
connect(f->readxml, SIGNAL(clicked()),f, SLOT(readthread()));
To copy to clipboard, switch view to plain text mode
As I need connect readxml button with Slot
--So I need put
Lister::textview->setText(ReadFile.readAll())
Lister::textview->setText(ReadFile.readAll())
To copy to clipboard, switch view to plain text mode
just inside (readthread())??
Bookmarks