Results 1 to 3 of 3

Thread: Install Event Filter instead of PlotPanner

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Location
    Bayreuth, Bayern
    Posts
    24
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Install Event Filter instead of PlotPanner

    Hey!
    I had been trying to modify QwtPlotPanner to repaint plot canvas during panning, until I read that this is impossible and I should install an event filter instead, which would catch mouse clicks and repaint the plot using setAxisScale(). I did this, but I the event filter is not called. My code is like the following:
    Qt Code:
    1. Plot::Plot(QWidget *parent):
    2. QwtPlot(parent)
    3. {
    4. ...
    5. createAxes();
    6. createLegend();
    7. installEventFilter(m_eventFilter);
    8. ...
    9. installPlotZoomer();
    10. installPlotPicker();
    11. }
    To copy to clipboard, switch view to plain text mode 
    where event filter is the following short calss:
    Qt Code:
    1. class MyEventFilter : public QObject
    2. {
    3. protected:
    4. bool eventFilter(QObject *, QEvent *) {
    5. std::cout << "MyEventFilter::eventFilter()" << std::endl;
    6. return true;
    7. }
    8. };
    To copy to clipboard, switch view to plain text mode 
    MyEventFilter is not called. Any ideas why not?

    Thank you in advance!
    Last edited by missoni; 11th May 2012 at 09:04.

Similar Threads

  1. Event filter: very confused about how they work
    By papillon in forum Qt Programming
    Replies: 8
    Last Post: 20th November 2011, 00:46
  2. Event filter question
    By d_stranz in forum Qt Programming
    Replies: 7
    Last Post: 7th July 2011, 23:08
  3. problem with event filter compile for S60
    By jimiq in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 6th July 2010, 19:48
  4. Event Filter & No Focus problem
    By AlexanderPopov in forum Newbie
    Replies: 0
    Last Post: 22nd December 2009, 20:15
  5. Q3Table event filter problem
    By batileon in forum Qt Programming
    Replies: 2
    Last Post: 27th August 2008, 10:40

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.