Results 1 to 20 of 20

Thread: change cursor icon while program is busy

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: change cursor icon while program is busy

    Ok. Maybe this will be stupid question, but I need to ask - when child process is exiting what is happening with the pointer and all reserved memory for that process? You said that I'm probably deleting same object twice, so I removed one line to see what will happen:

    Qt Code:
    1. connect(proc, SIGNAL(finished(int)),this, SLOT(deleteLater()));
    To copy to clipboard, switch view to plain text mode 

    And now it seems everything looks fine but I don't know if I'm doing some mess in memory. So I need to know Is everything being delete when I'm closing child application.

    thanks in advance
    best regards
    Tomasz

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: change cursor icon while program is busy

    Quote Originally Posted by Tomasz View Post
    Ok. Maybe this will be stupid question, but I need to ask - when child process is exiting what is happening with the pointer and all reserved memory for that process?
    You mean the QProcess object? Nothing is happening to it. It's not deleted automatically if that's what you're asking.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: change cursor icon while program is busy

    So I have no idea why my app is crashing if I try to delete my QProcess object:

    Qt Code:
    1. connect(proc, SIGNAL(finished(int)), this, SLOT(appIsLoaded()));
    2. connect(proc, SIGNAL(finished(int)), this, SLOT(deleteLater())); //without it works fine, no errors
    3. proc->start("/myapp", QStringList() << parameter);
    To copy to clipboard, switch view to plain text mode 

    It happens when I run process by start() If I use startDetached() I can delete QProcess object without any error... I've checked if I'm deleting something twice, and I'm not. QProcess object is the only thing I'm deleting.

    thanks in advance
    best regards
    Tomasz

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: change cursor icon while program is busy

    Maybe you are doing it in appIsLoaded()? Anyway, you can reuse the object again if you need to spawn the process again so you don't have to create and delete it every time.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    Tomasz (24th September 2010)

  6. #5
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: change cursor icon while program is busy

    appIsLoaded() only restores cursor nothing more. But I's good idea to reuse that pointer. I'll declare it in header file and use every time I need. Should I clean It or something after every use?

    But I'm still curious about why it crashes...

    thanks in advance
    best regards
    Tomasz

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: change cursor icon while program is busy

    No, you don't have to do anything with it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    Tomasz (24th September 2010)

Similar Threads

  1. Replies: 1
    Last Post: 19th July 2010, 11:43
  2. Constant busy cursor when application is run
    By b1 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 10th January 2010, 21:30
  3. QPushButton icon & dialog cursor
    By hulud in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th November 2009, 15:08
  4. Replies: 2
    Last Post: 12th October 2008, 14:42
  5. change cursor
    By nicky in forum Qt Programming
    Replies: 2
    Last Post: 31st January 2007, 11:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.