Results 1 to 7 of 7

Thread: QPainter Event help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: QPainter Event help

    @wysota I think he means that when a button is clicked that graph which is otherwise moving on the time axist stops to advance hence "freeze", and I imagine, once "released" the graph should continue from its current position (as if it continued to move in the background).

    @OP
    One way might be that when you want to "freeze" you can simply set a flag, and check that flag in Timer_Single_ECG_1_Timeout ().
    Like this:
    Qt Code:
    1. void GraphArea_Single_ECG_1::Timer_Single_ECG_1_Timeout ()
    2. {
    3. if(!m_bFreeze){ //m_bFreeze is a bool which gets true when you pressed a button for freeze or some other way to trigger freeze.
    4. if( !Array_ECG_1_Data.isEmpty())
    5. {
    6. Single_ECG_1_Current_Graph_data = Array_ECG_1_Data.takeFirst() + 100;
    7. }
    8.  
    9. X_Position++;
    10. if(X_Position > Graph_Width)
    11. X_Position=0;
    12. }
    13.  
    14. this->update();
    15. }
    To copy to clipboard, switch view to plain text mode 
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. The following user says thank you to high_flyer for this useful post:

    vivekyuvan (29th August 2017)

Similar Threads

  1. Replies: 2
    Last Post: 26th December 2012, 01:03
  2. QPainter immediate drawing outside paint event
    By sfcheng77 in forum Qt Programming
    Replies: 1
    Last Post: 23rd February 2011, 06:39
  3. Replies: 1
    Last Post: 5th October 2010, 17:08
  4. Replies: 5
    Last Post: 7th September 2009, 20:57
  5. Replies: 3
    Last Post: 30th April 2006, 19:22

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
  •  
Qt is a trademark of The Qt Company.