Viergewinnt (four-in-a-row) implementation in c++ and QT
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

renderarea.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* VierGewinnt - A simple 4-in-a-row network game
  2. *
  3. * Copyright (c) 2008 by Sebastian Lohff, seba@seba-geek.de
  4. * http://www.seba-geek.de
  5. *
  6. * This file is part of VierGewinnt.
  7. *
  8. * VierGewinnt is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * VierGewinnt is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with VierGewinnt. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef __RENDERAREA_H
  22. #define __RENDERAREA_H
  23. #include <QWidget>
  24. #include <QPen>
  25. #include <QMouseEvent>
  26. #include "viergewinnt.h"
  27. class RenderArea : public QWidget {
  28. Q_OBJECT
  29. public:
  30. RenderArea(QWidget *parent=0);
  31. void setFeldInfo(int _x, int _y, VierGewinntWidget::Stein **_feld);
  32. QSize minimumSizeHint() const;
  33. QSize sizeHint() const;
  34. signals:
  35. void addStein(int row);
  36. protected:
  37. void paintEvent(QPaintEvent *event);
  38. void mouseReleaseEvent(QMouseEvent *event);
  39. private:
  40. int fx;
  41. int fy;
  42. float mfact;
  43. VierGewinntWidget::Stein **feld;
  44. QPen xpen;
  45. QPen ypen;
  46. };
  47. #endif