Results 1 to 5 of 5

Thread: Change Cursor view and Stop User actions on doing long process

  1. #1
    Join Date
    Jul 2012
    Posts
    40
    Qt products
    Qt4 Qt/Embedded

    Default Change Cursor view and Stop User actions on doing long process

    Hi,
    I have screen which holds many widgets like line-edit's and combo-box in it and takes the input values from the user,after filling the screen at bottom i have a push-button by clicking on this the respective slot gets activated.In that slot i am posting all the filled details to web service using QnetworkAccessManger and reading the response successfully.But my problem is while posting the data to service and reading the response from service takes some time,during this time i want the cursor to go in wait symbol and user actions on gui should be blocked/stopped .I already tried with the below commands which are
    1) setCursor(Qt::WaitCursor);
    postingtoServiceMethod();
    QCoreApplication:rocessEvents(); // QApplication:rocessEvents();
    setCursor(Qt::ArrowCursor);

    2) QApplication::setOverrideCursor(QCursor(Qt::WaitCu rsor));
    postingtoServiceMethod();
    QApplication::restoreOverrideCursor();

    By following above two methods never in my application the cursor goes into wait symbol stage nor gui gets blocked..?The main thing i need is on the first click of that button the gui should be blocked or should not take any user actions i.e there shouldn't be access to any mouse movement....

  2. #2
    Join Date
    Feb 2013
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Change Cursor view and Stop User actions on doing long process

    Hi,

    can´t u just use a Modal-QDIALOG with a progressbar -> dont allow closing qdialog until ur Taks is finished -> when task finished, just close the dialog...
    No user input can be made during the dialog is executed (dlg.exec()) -> modal to app or parent whatever u want...

    Just an idea....

    greets

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

    Default Re: Change Cursor view and Stop User actions on doing long process

    Set the enabled property of your UI window to false. When you receive response or a timeout occurs, set it back to true.
    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.


  4. #4
    Join Date
    Jul 2012
    Posts
    40
    Qt products
    Qt4 Qt/Embedded

    Default Re: Change Cursor view and Stop User actions on doing long process

    @Anenja : Thanks for the idea....
    @wysota :thanks a lot....it has been worked....Is their any book or pdf available which covers most of qt concepts???

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

    Default Re: Change Cursor view and Stop User actions on doing long process

    Quote Originally Posted by sai_3289 View Post
    Is their any book or pdf available which covers most of qt concepts???
    For Qt4 I find Foundations of Qt Development by Johan Thelin the best and Qt GUI Programming with Qt4 is also fine. For Qt5 I don't think any books that cover Qt in depth have been released yet.
    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.


Similar Threads

  1. Logging Qt User Actions
    By Frank J. Lhota in forum Qt Programming
    Replies: 14
    Last Post: 30th May 2014, 22:36
  2. Replies: 1
    Last Post: 13th January 2012, 08:09
  3. Long operation -> Refresh user interface
    By pl01 in forum Qt Programming
    Replies: 2
    Last Post: 31st January 2011, 11:23
  4. how to abort a function taking to long to process
    By john_god in forum General Programming
    Replies: 5
    Last Post: 30th April 2009, 02:06
  5. Replies: 2
    Last Post: 27th November 2008, 11:16

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.