diff options
author | Stijn Buys <ingar@osirion.org> | 2012-06-05 18:07:28 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-06-05 18:07:28 +0000 |
commit | 42cb020233b6635f2d06b7f7b533a0ee4f85f4fa (patch) | |
tree | 0c3b13cb9b715cbf2ad5a705c8f1066dcac78a75 /src |
Initial import,
added automake project files, application framework,
initial sudoku widget
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 19 | ||||
-rw-r--r-- | src/main.cc | 13 | ||||
-rw-r--r-- | src/mainwindow.cc | 10 | ||||
-rw-r--r-- | src/mainwindow.h | 22 | ||||
-rw-r--r-- | src/sudoku.cc | 20 | ||||
-rw-r--r-- | src/sudoku.h | 22 |
6 files changed, 106 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..a67c97d --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,19 @@ +bin_PROGRAMS = sudosolve + +# You have two .cpp files you wrote, editor.cpp and another.cpp +# Remember to include the name of the resource file with the .cpp extension. +sudosolve_SOURCES = \ + main.cc \ + mainwindow.cc \ + sudoku.cc + +# You have one .h file, it's called editor.h. Therefore, here I list +# its mocced name, moc_editor.cpp. +nodist_sudosolve_SOURCES = \ + moc_mainwindow.cc \ + moc_sudoku.cc + +# This rule lets GNU make create any moc_*.cpp from the equivalent *.h +moc_%.cc: %.h + moc $< -o $@ + diff --git a/src/main.cc b/src/main.cc new file mode 100644 index 0000000..91525f7 --- /dev/null +++ b/src/main.cc @@ -0,0 +1,13 @@ + +#include <QApplication> + +#include "mainwindow.h" + +int main(int argc, char **argv) +{ + QApplication application(argc, argv); + MainWindow mainwindow; + + mainwindow.show(); + return application.exec(); +} diff --git a/src/mainwindow.cc b/src/mainwindow.cc new file mode 100644 index 0000000..60d2dcf --- /dev/null +++ b/src/mainwindow.cc @@ -0,0 +1,10 @@ + +#include "mainwindow.h" +#include "sudoku.h" + +MainWindow::MainWindow() +{ + mainwindow_sudoku = new Sudoku(); + + setCentralWidget(mainwindow_sudoku); +} diff --git a/src/mainwindow.h b/src/mainwindow.h new file mode 100644 index 0000000..09f22dd --- /dev/null +++ b/src/mainwindow.h @@ -0,0 +1,22 @@ + +#ifndef __INCLUDED_SUDOSOLVE_MAINWINDOW__ +#define __INCLUDED_SUDOSOLVE_MAINWINDOW__ + +#include <QtGui> +#include <QMainWindow> + +class Sudoku; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +private: + Sudoku *mainwindow_sudoku; + +}; + +#endif // __INCLUDED_SUDOSOLVE_MAINWINDOW__
\ No newline at end of file diff --git a/src/sudoku.cc b/src/sudoku.cc new file mode 100644 index 0000000..f676bb1 --- /dev/null +++ b/src/sudoku.cc @@ -0,0 +1,20 @@ + +#include "sudoku.h" + +#include <QLineEdit> +#include <QGridLayout> + +Sudoku::Sudoku() +{ + QGridLayout *gridlayout = new QGridLayout(); + + for (size_t row = 0; row < 9; row++) { + for (size_t column = 0; column < 9 ; column++) { + sudoku_value[row][column] = new QLineEdit(); + gridlayout->addWidget(sudoku_value[row][column], row, column); + } + + } + + setLayout(gridlayout); +}
\ No newline at end of file diff --git a/src/sudoku.h b/src/sudoku.h new file mode 100644 index 0000000..c9d38e6 --- /dev/null +++ b/src/sudoku.h @@ -0,0 +1,22 @@ + +#ifndef __INCLUDED_SUDOSOLVE_SUDOKU__ +#define __INCLUDED_SUDOSOLVE_SUDOKU__ + +#include <QtGui> +#include <QWidget> + +class QLineEdit; + +class Sudoku : public QWidget +{ + Q_OBJECT + +public: + Sudoku(); + +private: + QLineEdit * sudoku_value[9][9]; + +}; + +#endif // __INCLUDED_SUDOSOLVE_SUDOKU__
\ No newline at end of file |