Results 1 to 20 of 21

Thread: Doubts related with QPainter & QVector

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Doubts related with QPainter & QVector

    At least you forgot to #include <QWidget> in mwidget.h.
    J-P Nurmi

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

    Default Re: Doubts related with QPainter & QVector

    And it's "class", not "Class" Including <QPainter> and <QPaintEvent> in the implementation file will be required as well. And lose the "class" keyword before the constructor declaration.

  3. #3
    Join Date
    Nov 2008
    Location
    Caracas - Venezuela
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3

    Default Re: Doubts related with QPainter & QVector

    Quote Originally Posted by wysota View Post
    And it's "class", not "Class" Including <QPainter> and <QPaintEvent> in the implementation file will be required as well. And lose the "class" keyword before the constructor declaration.
    I wrote class in the .h :S but I had a mistake when I posted... I'm working on this... Thanks.

  4. #4
    Join Date
    Nov 2008
    Location
    Caracas - Venezuela
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3

    Default Re: Doubts related with QPainter & QVector

    I did it... And finally WORKS...


    Now I got a "QVector<QPoints> puntos" that I create fill with the "generar()" function in the "main" .h and .cpp called "aread.h" and "aread.cpp".

    Now I want to pass this QVector to the QPainter to draw. But QPainter is implemented in the promoted file, And It doesn't recognize any label or widget in the "main files (.h) and (.cpp).

    Should I define in the promoted file a class called Mlog? and try to use the "QVector of this one" in the promoted file?

    I defined the QVector as global I guess that was it.
    But I'm still confused between the 2 files.
    and How I could call a slots or widget in the main files in the promoted file...
    Last edited by j0rt4g4; 9th December 2008 at 22:02.

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.