Results 1 to 5 of 5

Thread: Reimplementig paint event

  1. #1
    Join Date
    Sep 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Reimplementig paint event

    Dear everybody,

    I have the following situation:

    class myClass : public QWidget
    {
    ...
    protected void paintEvent (QPaintEvent *);
    }

    MainWindow::MainWindow (...)
    {
    ...
    QTabWidget * lTabWidget = new QTabWidget ();
    myClass * lMyClass = new myClass;
    ltabWidget->addTab (lMyClass, "First tab");
    lMyClass = new myClass;
    ltabWidget->addTab (lMyClass, "Second tab");
    ...
    }

    Well, Qt draws the tabs but never launch my re-implemented
    paint event of myClass (which I need !).

    Could you explain why and suggest me a way to get the paint
    event running ?

    Best Regards

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

    Default Re: Reimplementig paint event

    We'd have to see the code for the event handler and probably a bit of code around 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.


  3. #3
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Reimplementig paint event

    EDITED: Sorry, my bad.
    Last edited by jano_alex_es; 13th November 2009 at 11:10.

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

    Default Re: Reimplementig paint event

    Don't confuse the man. He is reimplementing paintEvent for a widget, not paint for a graphics item. His declaration is correct and it's in protected section which is also correct.
    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. #5
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Reimplementig paint event

    ups, sorry!, I missunderstood the problem. I edit the message in order to avoid confusions.

Similar Threads

  1. QGraphicsTextItem and paint event
    By prashant in forum Qt Programming
    Replies: 0
    Last Post: 6th November 2009, 07:52
  2. Drag the paint event
    By jsmith in forum Qt Programming
    Replies: 2
    Last Post: 22nd July 2009, 14:51
  3. Replies: 4
    Last Post: 19th February 2009, 11:10
  4. Replies: 1
    Last Post: 9th June 2008, 20:41
  5. Qt text edit paint event
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2007, 18:13

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.