Conflict solved: mainwindow.cpp and calculate.cpp
[speedfreak] / Client / custombutton.cpp
index 3907267..6045bbc 100644 (file)
@@ -1,26 +1,26 @@
 /*
  * Custom button class for customized button.
  *
- * @author      Jukka Kurttila <jktla@suomi24.fi>
- * @copyright   (c) 2010 Speed Freak team
- * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @author     Jukka Kurttila   <jktla@suomi24.fi>
+ * @author     Toni Jussila     <toni.jussila@fudeco.com>
+ * @copyright  (c) 2010 Speed Freak team
+ * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  */
 
 #include "custombutton.h"
-
 #include <QPainter>
 #include <QIcon>
 
 /**
-  *Constructor of this class.
+  * Constructor of this class.
   */
 CustomButton::CustomButton(QWidget *parent, QIcon *icon) : QWidget(parent)
 {
     bPressed = false;
-    //Get size of the icon
+    // Get size of the icon
     QList<QSize> list = icon->availableSizes(QIcon::Normal,QIcon::On);
 
-    //If icon is empty, do not create pixmaps and leave
+    // If icon is empty, do not create pixmaps and leave
     if(list.isEmpty())
         return;
     QSize size = list.first();
@@ -30,8 +30,9 @@ CustomButton::CustomButton(QWidget *parent, QIcon *icon) : QWidget(parent)
         pict2 = new QPixmap(icon->pixmap(size.width(),size.height(),QIcon::Normal,QIcon::Off));
     }
 }
+
 /**
-  *Destructor of this class.
+  * Destructor of this class.
   */
 CustomButton::~CustomButton()
 {
@@ -41,6 +42,9 @@ CustomButton::~CustomButton()
         delete pict2;
 }
 
+/**
+  *
+  */
 void CustomButton::paintEvent(QPaintEvent *)
 {
     QPainter painter(this);
@@ -50,30 +54,48 @@ void CustomButton::paintEvent(QPaintEvent *)
     else
         painter.drawPixmap(0,0,*pict1);
 
-    //Debug print
-    //painter.drawText(50,50,"y: "+QString::number(mY));
+    // Debug print
+    // painter.drawText(50,50,"y: "+QString::number(mY));
 }
+
+/**
+  * Mouse press event.
+  *
+  * @param QMouseEvent me
+  */
 void CustomButton::mousePressEvent(QMouseEvent* me)
 {
     bPressed = true;
     repaint();
 }
+
+/**
+  * Mouse release event.
+  *
+  * @param QMouseEvent me
+  */
 void CustomButton::mouseReleaseEvent(QMouseEvent* me)
 {
     mX = me->x();
     mY = me->y();
-    //Emit open dialog signal if mouse is still over button
+    // Emit open dialog signal if mouse is still over button
     if( mY < this->height() && mY > 0 && mX < this->width() && mX > 0 )
         emit OpenDialog();
 
     bPressed = false;
     repaint();
 }
+
+/**
+  * Mouse move event.
+  *
+  * @param QMouseEvent me
+  */
 void CustomButton::mouseMoveEvent(QMouseEvent* me)
 {
     mX = me->x();
     mY = me->y();
-    //Is mouse moved outside button?
+    // Is mouse moved outside button?
     if( mY > this->height() || mY < 0 || mX > this->width() || mX < 0 )
         bPressed = false;
     else