Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Sujan Dasmahapatra
I have now removed Threads[th].cancel(). Only waitForFinished is there as below. for(int th=0; th wrote: > Cancelling threads is a no-no in most threading systems I'm familiar > with, so even reading such code somehow brushes me against feathers... > > So out of habit I'd steer away from using c

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Harri Pasanen
Cancelling threads is a no-no in most threading systems I'm familiar with, so even reading such code somehow brushes me against feathers... So out of habit I'd steer away from using cancel even if it were supported. On 10/05/2012 12:34 AM, Alex Malyushytskyy wrote: > Why do you need Threads[th]

Re: [Interest] Adding objects in QML and scrolling it

2012-10-04 Thread Mark
On Fri, Oct 5, 2012 at 8:25 AM, Bo Thorsen wrote: > Den 04-10-2012 01:11, Николай Шатохин skrev: >> Hello. >> >> Can anybody help me with my problem? I have a scene (Rectangle). I >> need add objects (circles) into scene by signal (signal returns >> coordinates) from C++ class and move all objects

Re: [Interest] Adding objects in QML and scrolling it

2012-10-04 Thread Bo Thorsen
Den 04-10-2012 01:11, Николай Шатохин skrev: > Hello. > > Can anybody help me with my problem? I have a scene (Rectangle). I > need add objects (circles) into scene by signal (signal returns > coordinates) from C++ class and move all objects on scene to left > after it (scrolling). > > So, how c

Re: [Interest] Send signal from non-GUI thread

2012-10-04 Thread Bo Thorsen
Hi Kio, You can use QCoreApplication::postEvent to do this from your thread. You have to define a custom event for this, but that's not difficult. It would have been simpler if the connect worked, but I'm afraid you need a bit more effort :) Bo. Den 03-10-2012 12:43, Kio skrev: > Hello, > > i

[Interest] Adding objects in QML and scrolling it

2012-10-04 Thread Николай Шатохин
Hello. Can anybody help me with my problem? I have a scene (Rectangle). I need add objects (circles) into scene by signal (signal returns coordinates) from C++ class and move all objects on scene to left after it (scrolling). So, how can I add new object (Qml type)? How can I move all added objec

[Interest] Send signal from non-GUI thread

2012-10-04 Thread Kio
Hello, i'm trying to display a QMessageBox from a non-GUI thread. For this i use signal&slots: in a QMainWindow based object i defined the slot. In the sending object i defined the signal and in the c'tor i connect them. Then, from a background thread, i emit the signal. Connecting and emitting

Re: [Interest] sequential animations on ListView Elements

2012-10-04 Thread SUNIL KUMAR M
Hai, I need sample code for doing animations on states and transitions using timer I created States in my coding, I want to animate those states with respect to timer on properties like opacity, rotation...etc... Please provide sample code for supporting animations ..

[Interest] sequential animations on ListView Elements

2012-10-04 Thread SUNIL KUMAR M
Hai, I need sample code for doing animations on list-view elements in Qt I created list-view menu where for each element there will be index, I want to animate listview elements on properties like opacity, rotation...etc...but not adding, appending , deleting. just with the help of timer

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Alex Malyushytskyy
Why do you need Threads[th].cancel();? According to documentation not only "the QFuture returned by QtConcurrent::run() does not support canceling,...", but I do not see any reason you could want to do this. Alex On Thu, Oct 4, 2012 at 6:25 AM, André Somers wrote: > Op 4-10-2012 15:21, Sujan

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Sascha Cunz
Am Freitag, 5. Oktober 2012, 00:35:44 schrieb Sujan Dasmahapatra: > which loop? > for(int th=0; th { > if(Threads[th].isRunning()) > Threads[th].waitForFinished(); > Threads[th].cancel(); > } > Threads.clear(); > > This loop is correct. If threads is running wait, then cancel it. braces > are prop

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Jan Kundrát
On 10/04/12 23:35, Sujan Dasmahapatra wrote: > for(int th=0; th { > if(Threads[th].isRunning()) > Threads[th].waitForFinished(); > Threads[th].cancel(); > } > Threads.clear(); > This loop is correct. If threads is running wait, then cancel it. braces > are proper Sascha. The code you pasted is equ

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Sujan Dasmahapatra
which loop? for(int th=0; th wrote: > Hi Sujan, > > your threads don't output all data to disk, because you forgot some curly > braces in the second loop. > > Sascha > > Am Donnerstag, 4. Oktober 2012, 16:21:10 schrieb Sujan Dasmahapatra: > > I am not able to run my threads concurrently please hel

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Sascha Cunz
Hi Sujan, your threads don't output all data to disk, because you forgot some curly braces in the second loop. Sascha Am Donnerstag, 4. Oktober 2012, 16:21:10 schrieb Sujan Dasmahapatra: > I am not able to run my threads concurrently please help. > How can I run 21 threads concurrently and get

Re: [Interest] qt5: deprecated QAbstractItemModel::reset()

2012-10-04 Thread Christian Kandeler
On 10/04/12 18:09, Stephen Kelly wrote: > On Thursday, October 04, 2012 16:38:42 Jan Kundrát wrote: >> >> I have always assumed that the users of the model are more or less free >> to call a "reasonable" subset of model's functions form inside slots >> attached to modelAboutToBeReset() -- like ind

Re: [Interest] qt5: deprecated QAbstractItemModel::reset()

2012-10-04 Thread Stephen Kelly
On Thursday, October 04, 2012 16:38:42 Jan Kundrát wrote: > Hi, > my application makes heavy use of QAIM::reset() in its proxy models, > most notably in situations where the parent model either "goes away" or > otherwise fails in a manner which cannot be accommodated by the > beginResetModel/endRes

[Interest] qt5: deprecated QAbstractItemModel::reset()

2012-10-04 Thread Jan Kundrát
Hi, my application makes heavy use of QAIM::reset() in its proxy models, most notably in situations where the parent model either "goes away" or otherwise fails in a manner which cannot be accommodated by the beginResetModel/endResetModel pair of functions. I could convert some of these into pr

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Constantin Makshin
Sujan said he uses threads to generate files, so there's some chance that his task'll be IO-bound and extra threads will actually increase overall performance. But this is just a guess and running 21 threads on an 8-core CPU is probably an overkill (unless the task is *really* IO-limited). On Oct

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Thiago Macieira
On quinta-feira, 4 de outubro de 2012 17.07.44, Sujan Dasmahapatra wrote: > I agree with you Thiago. QtConcurrent runs as many threads as are > processor. I submitted 21 threads through a for loop. Then the first 8 > threads should be running intially right. When anyone thread is finished > the doe

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Thiago Macieira
On quinta-feira, 4 de outubro de 2012 16.04.41, Bo Thorsen wrote: > Den 04-10-2012 15:51, Thiago Macieira skrev: > > On quinta-feira, 4 de outubro de 2012 15.46.57, André Somers wrote: > >> If you think that running 21 threads on an 8 core system will run make > >> your task go faster, then Thiago

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Karl Ruetz
I'm not sure why you would want to run 21 threads that are writing files on an 8 core machine. Depending on the OS, it is likely you will start time slicing which can actually be slower than waiting for a thread to finish before starting another one. Since you are writing files, the Disk I/O is

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Sujan Dasmahapatra
I agree with you Thiago. QtConcurrent runs as many threads as are processor. I submitted 21 threads through a for loop. Then the first 8 threads should be running intially right. When anyone thread is finished the does it take automatically 9th thread? and so on. I am currently doing exactly the sa

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Samuel Rødal
On 10/04/2012 03:21 PM, Sujan Dasmahapatra wrote: > I am not able to run my threads concurrently please help. > How can I run 21 threads concurrently and get the job done by 8 cpus > what I have in my machine. > > I am doing like this > [code] > > std::vector > Threads; > QFuture Th; > > for(int z

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Bo Thorsen
Den 04-10-2012 15:51, Thiago Macieira skrev: > On quinta-feira, 4 de outubro de 2012 15.46.57, André Somers wrote: >> If you think that running 21 threads on an 8 core system will run make >> your task go faster, then Thiago is right: you don't understand your >> problem. > If you run 8 threads on

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Thiago Macieira
On quinta-feira, 4 de outubro de 2012 15.46.57, André Somers wrote: > If you think that running 21 threads on an 8 core system will run make > your task go faster, then Thiago is right: you don't understand your > problem. If you run 8 threads on an 8-core system and they use the CPU fully, then y

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread André Somers
Op 4-10-2012 15:44, Sujan Dasmahapatra schreef: > I want the job to be faster. if 8 cpus are executing 8 threads at a > time then my processing will be fater right. I want my 8 cpus be > always processing one thread each cpu simultaneously so that my > process runs faster. Am i able to make you

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Sujan Dasmahapatra
I want the job to be faster. if 8 cpus are executing 8 threads at a time then my processing will be fater right. I want my 8 cpus be always processing one thread each cpu simultaneously so that my process runs faster. Am i able to make you understand what i want to achieve. How the execution can b

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Thiago Macieira
On quinta-feira, 4 de outubro de 2012 16.31.54, Sujan Dasmahapatra wrote: > Thanks andre for your reply. Can u give me some sample code of using > QThreadPool. Can u refer my code snippet how i can implement the same > function which is being called 21 times for 21 z values..How to run > them

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread Sujan Dasmahapatra
Thanks andre for your reply. Can u give me some sample code of using QThreadPool. Can u refer my code snippet how i can implement the same function which is being called 21 times for 21 z values..How to run them parallely using QThreadPool. Some code snippet will be fine so that I get some ide

Re: [Interest] how to run 21 threads concurrently

2012-10-04 Thread André Somers
Op 4-10-2012 15:21, Sujan Dasmahapatra schreef: > > I am not able to run my threads concurrently please help. > How can I run 21 threads concurrently and get the job done by 8 cpus > what I have in my machine. > > I am doing like this > [code] > > std::vector > Threads; > QFuture Th; > > for(int

[Interest] how to run 21 threads concurrently

2012-10-04 Thread Sujan Dasmahapatra
I am not able to run my threads concurrently please help. How can I run 21 threads concurrently and get the job done by 8 cpus what I have in my machine. I am doing like this [code] std::vector > Threads; QFuture Th; for(int z=0; z<21; z++) { Th = QtConcurrent::run(this,&UnrstParser,z); Thraeds

Re: [Interest] Aligning QProgressBar inside a QSplashScreen

2012-10-04 Thread Thiago Macieira
On quinta-feira, 4 de outubro de 2012 12.44.21, Jan Kundrát wrote: > That's the reason. I expect Q_CHECK_PTR's error message is not going to > change, so in my opinion it's better to get 'ASSERT: "foo"' than "out of > memory". In Qt 5, Q_CHECK_PTR will throw std::bad_alloc in case it runs into a n

Re: [Interest] Aligning QProgressBar inside a QSplashScreen

2012-10-04 Thread Jan Kundrát
On 10/04/12 02:08, Alex Malyushytskyy wrote: > And I still do not see a reason to prefer Q_ASSERT over Q_CHECK_PTR > when checking pointers for NULL, even though I would change the > default message it prints to mention "NULL pointer" instead of "out of > memory". That's the reason. I expect Q_CHE

[Interest] Prevent drag-selection in QTreeView

2012-10-04 Thread Daniel Price
I have a QTreeView (actually a QTreeWidget) with multiple selection and drag and drop but I want to disable the 'drag and select' behaviour (i.e. if you click and drag an item which is not itself draggable, the selection is extended to include the items that you mouse over). I still want the shi

Re: [Interest] QCombobox - resize list view to horizontal contents

2012-10-04 Thread Daniel Price
In case anyone else has this problem, I figured it out. The call to setView() on a QComboBox resets the size policies on the view passed in. So any customizations within a subclass constructor WILL BE IGNORED. There's no hint of this in the documentation and I had to dig through the Qt source