Results 1 to 2 of 2

Thread: Reload the ScaleDraw with invalidateCache()

  1. #1
    Join Date
    Oct 2010
    Posts
    58
    Thanks
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Reload the ScaleDraw with invalidateCache()

    Hi,
    I am porting a qwt program of mine to linux and I'm having a problem reloading the scaleDraw of my bottom x axis.

    I have an option where the user can input their own format for the time on the x axis (YYYY or MM etc). When the user presses Enter, my function setUserFormat is called:


    Qt Code:
    1. class XaxisDates: public QwtScaleDraw{
    2. ....
    3. ....
    4.  
    5. void setUsersFormat(QString newFormat){
    6. usersFormat = newFormat;
    7. myDefault = false;
    8. this->invalidateCache();
    9. }
    10. }
    To copy to clipboard, switch view to plain text mode 

    the invalidateCache() method causes my x axis scale draw to reload right away with the new format. This works as it should on Windows, but on Linux the change does not happen immediately. It will change if I reload the plot, but I want it to change immediately like it does on Windows. Any ideas why this does not work on Linux?

    (ubuntu 10.04, Qwt 6.0.1)


    Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Reload the ScaleDraw with invalidateCache()

    Without a paint event nothing gets repainted - on no system.

    Add a replot or update/repaint for the corresponding scale widget.

    Uwe

Similar Threads

  1. how do you reload a listView?
    By implor in forum Newbie
    Replies: 5
    Last Post: 16th May 2010, 22:21
  2. Reload widget contents
    By tiredtyrant in forum Qt Programming
    Replies: 13
    Last Post: 10th March 2010, 19:39
  3. Reload a Qt Plugin
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 30th December 2009, 15:36
  4. QPlainTextEdit reload text
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2009, 14:24
  5. Reload a QTableWidget
    By SailinShoes in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2008, 11:40

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.