• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

ksquares

  • sources
  • kde-4.14
  • kdegames
  • ksquares
  • src
gameboardview.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2006 by Matthew Williams <matt@milliams.com> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  ***************************************************************************/
9 
10 #ifndef GAMEBOARDVIEW_H
11 #define GAMEBOARDVIEW_H
12 
13 #include <QGraphicsView>
14 
15 #include "gameboardscene.h"
16 
25 class GameBoardView : public QGraphicsView
26 {
27  Q_OBJECT
28 
29  public:
35  explicit GameBoardView(QWidget* parent = 0);
39  QSize minimumSizeHint() const {if(scene()==0) return QSize(); else return qobject_cast<GameBoardScene*>(scene())->minimumSizeHint();}
40  public slots:
42  void setBoardSize();
43  protected:
45  void resizeEvent(QResizeEvent* event) {if (scene() != 0) fitInView(scene()->sceneRect(), Qt::KeepAspectRatio); QGraphicsView::resizeEvent(event);}
46 };
47 
48 #endif // GAMEBOARDVIEW_H
QResizeEvent
QWidget
GameBoardScene
Scene for displaying the game board.
Definition: gameboardscene.h:27
GameBoardView::GameBoardView
GameBoardView(QWidget *parent=0)
Constructor.
Definition: gameboardview.cpp:12
QGraphicsView::sceneRect
QRectF sceneRect() const
QGraphicsView::scene
QGraphicsScene * scene() const
QGraphicsView::event
virtual bool event(QEvent *event)
QSize
GameBoardView::setBoardSize
void setBoardSize()
Automatically resizes the board according to the users preferences. Deprecated for a bit...
Definition: gameboardview.cpp:16
GameBoardView::resizeEvent
void resizeEvent(QResizeEvent *event)
Overloaded to resize board.
Definition: gameboardview.h:45
GameBoardView::minimumSizeHint
QSize minimumSizeHint() const
Asks the scene through ( qobject_cast(scene()) ) for the smallest size it should be...
Definition: gameboardview.h:39
QObject::parent
QObject * parent() const
QGraphicsView
gameboardscene.h
GameBoardView
Actual game board widget.
Definition: gameboardview.h:25
QGraphicsView::fitInView
void fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRatioMode)
QGraphicsView::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ksquares

Skip menu "ksquares"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal