diff options
author | zoniq <zoniq@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-04-17 20:03:06 +0000 |
---|---|---|
committer | zoniq <zoniq@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-04-17 20:03:06 +0000 |
commit | 8fe3312b15885c2fc357698d5804f42f6db30eda (patch) | |
tree | 09101a840b2b5c60ab74b7230e8f7297478c35a4 | |
parent | a242daba46e552573c71376f81234159a51ce174 (diff) | |
download | navit-svn-8fe3312b15885c2fc357698d5804f42f6db30eda.tar.gz |
Add:graphics/Qt:Added comments
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@1017 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | graphics/qt_qpainter/graphics_qt_qpainter.cpp | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/graphics/qt_qpainter/graphics_qt_qpainter.cpp b/graphics/qt_qpainter/graphics_qt_qpainter.cpp index 1d861f61..4a54490c 100644 --- a/graphics/qt_qpainter/graphics_qt_qpainter.cpp +++ b/graphics/qt_qpainter/graphics_qt_qpainter.cpp @@ -11,7 +11,6 @@ #include <glib.h> #include "config.h" #include "point.h" -#include "item.h" #include "graphics.h" #include "color.h" #include "debug.h" @@ -61,7 +60,7 @@ class RenderArea : public QWidget void (*motion_callback)(void *data, struct point *p); void *motion_callback_data; void (*button_callback)(void *data, int press, int button, struct point *p); - void *button_callback_data; + void *button_callback_data; // struct navit * protected: @@ -82,29 +81,36 @@ class RenderArea : public QWidget //# Authors: Martin Schaller (04/2008) //############################################################################################################## RenderArea::RenderArea(QWidget *parent) - : QWidget(parent) - { - pixmap = new QPixmap(800, 600); - - //setEnabled(TRUE); - //QWheelEvent::accept(); - } + : QWidget(parent) +{ + pixmap = new QPixmap(800, 600); +} - QSize RenderArea::sizeHint() const - { - return QSize(800, 600); - } +//############################################################################################################## +//# Description: QWidget:sizeHint +//# Comment: This property holds the recommended size for the widget +//# Authors: Martin Schaller (04/2008) +//############################################################################################################## +QSize RenderArea::sizeHint() const +{ + return QSize(800, 600); +} +//############################################################################################################## +//# Description: QWidget:paintEvent +//# Comment: A paint event is a request to repaint all or part of the widget. +//# Authors: Martin Schaller (04/2008) +//############################################################################################################## void RenderArea::paintEvent(QPaintEvent * event) { - QPainter painter(this); - painter.drawPixmap(0, 0, *pixmap); + QPainter painter(this); + painter.drawPixmap(0, 0, *pixmap); } //############################################################################################################## //# Description: QWidget::resizeEvent() -//# Comment: When resizeEvent() is called, the widget already has its new geometry +//# Comment: When resizeEvent() is called, the widget already has its new geometry. //# Authors: Martin Schaller (04/2008) //############################################################################################################## void RenderArea::resizeEvent(QResizeEvent * event) @@ -130,7 +136,7 @@ void RenderArea::mouseEvent(int pressed, QMouseEvent *event) p.y=event->y(); switch (event->button()) { case Qt::LeftButton: - (this->button_callback)(this->button_callback_data, pressed, 1, &p); + (this->button_callback)(this->button_callback_data, pressed, 1, &p); // calls navit_button() in navit.c break; case Qt::MidButton: (this->button_callback)(this->button_callback_data, pressed, 2, &p); @@ -199,7 +205,12 @@ void RenderArea::wheelEvent(QWheelEvent *event) event->accept(); } -// #################################################################################### +//############################################################################################################## +// General comments: +// ----------------- +// gr = graphics = draw area +// gc = graphics context = pen to paint on the draw area +//############################################################################################################## static int dummy; |