summaryrefslogtreecommitdiff
path: root/src/sudokuwidget.h
blob: b32d7944e5ea7d614c5e43ef7d62951ead752787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

#ifndef __INCLUDED_SUDOKUSOLVER_SUDOKUWIDGET__
#define __INCLUDED_SUDOKUSOLVER_SUDOKUWIDGET__

#include <QtWidgets>
#include <QWidget>

#include "sudoku.h"

class QLineEdit;

class SudokuWidget : public QWidget
{
	Q_OBJECT
	
public:
	SudokuWidget();
	
	/**
	 * @brief set widgets value from sudoku values
	 * */
	void set_values(const Sudoku & values);
	
	/**
	 * @brief set sudoku values from widget values
	 * */
	void get_values(Sudoku & values);
	
	/**
         * @brief return the default size hint for this widget
         * */
	virtual QSize sizeHint() const;
	
	inline const bool showHintUnique() const
	{
		return m_showHintUnique;
	}
	
	void setShowHintUnique(const bool hintunique = true);
	
	
protected:	
        /**
         * @brief handle paint events
         * */
        virtual void paintEvent(QPaintEvent *event);
	
	/**
	 * @brief handle resize events
	 * */
	virtual void resizeEvent(QResizeEvent *event);
	
private:
	QLineEdit	* sudokuwidget_value[9][9];
	bool		m_showHintUnique;

private slots:
	void verify();
	
	void verify(const QString & text);
};

#endif // __INCLUDED_SUDOKUSOLVER_SUDOKUWIDGET__