Hi, I have
Qt Code:
  1. #ifndef MYCUSTOMFRAME_H
  2. #define MYCUSTOMFRAME_H
  3.  
  4. #include "baseform.h"
  5. #include <qframe.h>
  6. #include <qpainter.h>
  7.  
  8.  
  9. class MyCustomFrame : public QFrame
  10. {
  11. Q_OBJECT
  12.  
  13. protected:
  14. void paintEvent(QPaintEvent* event);
  15. };
  16.  
  17. void MyCustomFrame::paintEvent(QPaintEvent* event)
  18. {
  19. QPainter painter(this);
  20. painter.drawLine(0, 0, 200, 150);
  21. }
  22.  
  23. #endif // MYCUSTOMFRAME_H
To copy to clipboard, switch view to plain text mode 
and it compiles with out errors or warnings.
I have 2 quentions:
1. How do I access it from the body of my program as I was required to remove "#include "mycustomframe.h" from "baseform.cpp"?

2. I have a class "drawingfunctions.h" where I would like to do the painting. If I read you correctly, I need to change the class name from
Qt Code:
  1. class DrawingFunctions : public QWidget
  2. {
  3. Q_OBJECT
  4.  
  5. public:
To copy to clipboard, switch view to plain text mode 
to
Qt Code:
  1. class DrawingFunctions : public QFrame
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. DrawingFunctions( QWidget *parent = 0 );
To copy to clipboard, switch view to plain text mode 
and i think the "parent = 0" is wrong.
And what do I need to change here?
Qt Code:
  1. DrawingFunctions::DrawingFunctions( QWidget *parent ) : QWidget(parent)
To copy to clipboard, switch view to plain text mode 
As you can tell, i have no clear understanding of whats going on. I am able to use QTextEdit widgets on my base QFrame, but not the QPainter.
(These "uncontrolled" events of Qt4 are driving me up a wall.)

I really appreciate your patience with me.