Yes, that's a workable direction.
Cheers,
_
Yes, that's a workable direction.
Cheers,
_
If I define IThread::run() in Lister.cpp with definition of Lister::walk(QString path0), lower in the same file I got such errors with 2 modifications - should I define these 2 methods in different files or in inverse order?
There is also run-time error with the argument of walk(pp) - so should I understand that I need just walk()?Qt Code:
1. void IThread::run() { } ERRROR:invalid use of qualified-name 'Lister::walk' 2. void IThread::run() { } ERROR:expected primary-expression before ')' tokenTo copy to clipboard, switch view to plain text mode
QString p="C:\\C";
Object::connect: No such slot Lister::walk(pp) in ..\Filewalker2\main.cpp:32
Last edited by artt; 20th December 2015 at 02:18.
The first one doesn't make sense. You want to call a function, not declare one.
The second one is a function call, but you are passing a type as the argument instead of a value.
Since that would not work in Java either I have now serious doubts that you have even programmed a single line in Java as well.
That has been already been answered several times.
Cheers,
_
1. You provided such radical thoughts: it is very big blame to write I do not write a line in a Java
despite it seems is thirdly light than Qt for such project. And of course there were attempts and errors.
After providing arguments:
QString path0="C:\\C";
for Lister::walk(path0) it works (and after putting A->start() on the heap).
But walkwiththread() works with small folders -- for example with 28 entities (shows the properties of 28 files) - but when with C:\Windows, it is inactive. And in debugger mode - when clicking on indexate() button for running walkwiththread()
I got the instant message: "Thread 1 of Group 1 finished" (in one of status bar of Qtcreator tabs), then clicking the second time "Thread 2 of Group 1 finished", etc. So maybe I need some another wrapper or additional method for launching
time-consuming thread - as 28 entities(or 19, or 5) renders instantly??
Anyway in both cases when seeing Debugger launched in console - I see at first the familiar message about absence of 22 libraries--but it display after the list of results with small folders..
And I put in .pro file: Qt+= gui core thread concurrent or ... threads concucrrent --despite I cannot found the reference about it in 2 my read books, but there is reference for "concurrent" in Blanchette despite it is another Qtconcurrent class.
So partially such scheme works..
And what about walk(pp) -- even in Auto-fill mode of Qtcreator I see SLOT(walk(QString)) - so the message in some kind the error - as such slot is present. Or should I to provide walk() without arguments or make clicked(pp) with arguments.
Last edited by artt; 20th December 2015 at 15:41.
Well, that was based on the failure to understand the difference between a type and a variable.
Because Java has exactly the same terminology for these concepts.
E.g.
String is a type, pp is a variable of type String. pp is not a type.Qt Code:
class Main { static void main(String[] args) { String pp; } };To copy to clipboard, switch view to plain text mode
In Java doing this would also not compile
Again, because walk() expects an argument of type String, not the type itself.Qt Code:
void walk(String path) { } void doWalk() { walk(String); }To copy to clipboard, switch view to plain text mode
Since half of the thread deals with you not understanding these simple facts for C++, I could only conclude that you don't understand them in Java either.
What does that even mean "inactive"?
Does the method not execute depending on what you pass as its argument?
I am pretty sure "thread" is not a name for a Qt module.
"gui", "core" and "concurrent" are, the latter being needed for use of QtConcurrent, not for QThread.
QThread is part of QtCore.
QtConcurrent is a namespace for functions that primarily deal with parallel algorithms, such as invoking the same function on all elements in a container, for multiple container entries concurrently.
So far your code indicated that pp was a variable of type QString, not a type called pp.
Do you have a class called "pp"?
Is the slot taking an argument of type "pp"?
Cheers,
_
Of course, QString pp="C:\\C" means that pp is variable of Qstring. But I cannot put simply SLOT(walk(Qstring)), as the folder would not be defined so I put there concrete variable pp. Oh, in the course of writing these comment, I guessed maybe I need
to put Lister::walk(QString) as Lister::walk(pp), or even put pp("C:\\C") as a argument in declaration of slot public Lister { slot: walk(QString pp). } So it happened to be some euristics. In some way it should works.
Anyway - in thread environment this issue should be absent- but QThread do not work with processing big folder - taht is issue now. So I do undestand I need some tool for time-consuming for time-sonsuming thread.
Good that we could clarify that.
Explained several times already.
A thread is just a parallel execution context.
It doesn't matter to the thread how big a folder is.
No idea what you mean.
Cheers,
_
doublefacepalm.jpg
I'm beaming out of here.
I do not really understand you facepalm, and suspects of java code-- the only I copied from the net was exactly filewalker pattern (yet in qt).
Anyway eveything almost works
-- "is inactive" -- when I press indexate button and walkerwiththread() process C:\\Document and Settings (wriitten directly in Lister.cpp)-- i got nothing in console.
If it processes C:\\C (wriitten directly in Lister.cpp) it instantly render 28 results for other folder.
Maybe not everything is on heap, and yet in stack as it was at the beginning?
Anyway in both cases -- when Debug started...
I got such lines in console:
Could not load shared library symbols for 22 libraries, e.g. C:\WINDOWS\system32\ntdll.dll.
Use the "info sharedlibrary" command to see the complete listing.
So it happened when my Qfilelistinfo was on the stack.
Then small folders shows:... (Big Folders nothing).Qt Code:
File:1656 catalog.php C:/includes/admin 4 File:1735 conf.php C:/includes/admin 4 File:1590 custord.php C:/includes/admin 4 File:4256 catalog_products_categories.php C:/includes/admin/sub 4 File:2754 catalog_special.php C:/includes/admin/sub 4To copy to clipboard, switch view to plain text mode
If I click again thread(it shows the thread2, and so on)
I got again
File:1656 catalog.php C:/includes/admin 4
File:1735 conf.php C:/includes/admin 4...
So this "Could not load shared library" appears at the beginning of run, so creation of Qwidget.
Really a very small need sto be done -- and it is really needs some SwingWorker java analogue as it renders instantly, but
in case of C:\Windows it could noty happened as well in the case of whole C:\, or all disks..
And you have equal access rights to both folders?
Have you added addition logging to see what happens?
We've already determined that this doesn't matter.
Obviously the debugger can't find the debug symbols for these libraries.
Not a problem until you have to debug into them.
So it works when you run everything from the main thread?
Cheers,
_
Bookmarks