← Back to team overview

ubuntu-phone team mailing list archive

Re: C++ extension freezing my UI

 

Thanks, I guess I assume that slots where multi-threaded by default. My
bad. I will read that link and see how I get on with it!

Thanks,

Victor


On Wed, Oct 9, 2013 at 5:40 PM, Alejandro J. Cura <
alejandro.cura@xxxxxxxxxxxxx> wrote:

> On Wed, Oct 9, 2013 at 1:30 PM, Victor Palau <victor.palau@xxxxxxxxxxxxx>
> wrote:
> > Hi,
> >
> > I was playing with building a C++ component that have a slot.  Have a UI
> in
> > QML that has a button. The button I have connected the button onclicked
> > signal with the C++ component slot, so when I clicked the button, the C++
> > object does its magic. This all works, but the UI freezes as soon as I do
> > this.
> >
> > I thought that signals and slots were async so that shouldnt happen. Any
> > thoughts?
>
> What is the C++ code doing?
>
> If the C++ code is cpu-intensive, then the UI will get blocked, and
> you'll need to run it in a thread.
> Here's how to show a busy indicator while the thread runs, and how to
> hide it when it's done:
> http://stackoverflow.com/questions/12071021/qml-and-qthread-multithreading
>
> cheers,
> --
> alecu
>

References