Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sudoku solver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Silas Dohm
sudoku solver
Commits
35127515
Commit
35127515
authored
3 years ago
by
Silas Dohm
Browse files
Options
Downloads
Patches
Plain Diff
cell class start
parent
6f22f088
No related branches found
No related tags found
1 merge request
!1
Master
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Makefile
+4
-4
4 additions, 4 deletions
Makefile
cell.cpp
+13
-0
13 additions, 0 deletions
cell.cpp
cell.h
+15
-0
15 additions, 0 deletions
cell.h
window.cpp
+39
-29
39 additions, 29 deletions
window.cpp
window.h
+1
-0
1 addition, 0 deletions
window.h
with
72 additions
and
33 deletions
Makefile
+
4
−
4
View file @
35127515
...
...
@@ -57,10 +57,10 @@ RM = /usr/bin/cmake -E rm -f
EQUALS
=
=
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR
=
/home/sls/Documents/dev/
tqt_new_beginning
CMAKE_SOURCE_DIR
=
/home/sls/Documents/dev/
soduoku_solver
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR
=
/home/sls/Documents/dev/
tqt_new_beginning
CMAKE_BINARY_DIR
=
/home/sls/Documents/dev/
soduoku_solver
#=============================================================================
# Targets provided globally by CMake.
...
...
@@ -87,9 +87,9 @@ rebuild_cache/fast: rebuild_cache
# The main all target
all
:
cmake_check_build_system
$(
CMAKE_COMMAND
)
-E
cmake_progress_start /home/sls/Documents/dev/
tqt_new_beginning
/CMakeFiles /home/sls/Documents/dev/
tqt_new_beginning
//CMakeFiles/progress.marks
$(
CMAKE_COMMAND
)
-E
cmake_progress_start /home/sls/Documents/dev/
soduoku_solver
/CMakeFiles /home/sls/Documents/dev/
soduoku_solver
//CMakeFiles/progress.marks
$(
MAKE
)
$(
MAKESILENT
)
-f
CMakeFiles/Makefile2 all
$(
CMAKE_COMMAND
)
-E
cmake_progress_start /home/sls/Documents/dev/
tqt_new_beginning
/CMakeFiles 0
$(
CMAKE_COMMAND
)
-E
cmake_progress_start /home/sls/Documents/dev/
soduoku_solver
/CMakeFiles 0
.PHONY
:
all
# The main clean target
...
...
This diff is collapsed.
Click to expand it.
cell.cpp
0 → 100644
+
13
−
0
View file @
35127515
#include
"cell.h"
#include
<QPushButton>
Cell
::
Cell
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
// Set size of the window
setFixedSize
(
100
,
50
);
// Create and position the button
m_button
=
new
QPushButton
(
"Hello World"
,
this
);
m_button
->
setGeometry
(
10
,
10
,
80
,
30
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
cell.h
0 → 100644
+
15
−
0
View file @
35127515
#ifndef CELL_H
#define CELL_H
#include
<QWidget>
class
QPushButton
;
class
Cell
:
public
QWidget
{
public:
explicit
Cell
(
QWidget
*
parent
=
0
);
private:
QPushButton
*
m_button
;
};
#endif // CELL_H
\ No newline at end of file
This diff is collapsed.
Click to expand it.
window.cpp
+
39
−
29
View file @
35127515
...
...
@@ -2,46 +2,56 @@
#include
<QApplication>
#include
<QStandardPaths>
Window
::
Window
(
QWidget
*
parent
)
:
QWidget
{
parent
}
{
setFixedSize
(
1600
,
900
);
m_counter
=
0
;
// quitbutton
m_buttonQuit
=
new
QPushButton
(
"quit"
,
this
);
m_buttonQuit
->
setGeometry
(
0
,
height
()
-
30
,
width
(),
30
);
// m_buttonQuit = new QPushButton("quit", this);
// m_buttonQuit->setGeometry(0, height() - 30, width(), 30);
for
(
char
x
=
0
;
x
<
9
;
x
++
)
{
for
(
char
y
=
0
;
y
<
1
;
y
++
)
{
grid
[
x
][
y
]
=
new
QPushButton
(
"x"
,
this
);
grid
[
x
][
y
]
->
setGeometry
(
x
*
100
,
y
*
100
,
100
,
100
);
/* code */
}
}
// slider
m_slider
=
new
QSlider
(
this
);
m_slider
->
setOrientation
(
Qt
::
Horizontal
);
m_slider
->
setRange
(
0
,
100
);
m_slider
->
setValue
(
0
);
m_slider
->
setGeometry
(
10
,
20
,
width
()
-
10
,
20
);
//
m_slider = new QSlider(this);
//
m_slider->setOrientation(Qt::Horizontal);
//
m_slider->setRange(0,
100);
//
m_slider->setValue(0);
//
m_slider->setGeometry(10,
20,
width() -
10,
20);
//progressbar
m_progressBar
=
new
QProgressBar
(
this
);
m_progressBar
->
setRange
(
0
,
100
);
m_progressBar
->
setValue
(
0
);
m_progressBar
->
setGeometry
(
10
,
40
,
width
()
-
10
,
20
);
//
//
progressbar
//
m_progressBar = new QProgressBar(this);
//
m_progressBar->setRange(0,
100);
//
m_progressBar->setValue(0);
//
m_progressBar->setGeometry(10,
40,
width() -
10,
20);
//button
m_button
=
new
QPushButton
(
"Hello QT!"
,
this
);
m_button
->
setGeometry
(
0
,
80
,
width
(),
30
);
m_button
->
setCheckable
(
true
);
//
//
button
//
m_button = new QPushButton("Hello QT!",
this);
//
m_button->setGeometry(0,
80,
width(),
30);
//
m_button->setCheckable(true);
//signals and slots :)
connect
(
m_button
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
slotButtonClicked
(
bool
)));
connect
(
m_buttonQuit
,
SIGNAL
(
clicked
()),
QApplication
::
instance
(),
SLOT
(
quit
()));
connect
(
m_slider
,
SIGNAL
(
valueChanged
(
int
)),
m_progressBar
,
SLOT
(
setValue
(
int
)));
connect
(
this
,
SIGNAL
(
counterReached
()),
QApplication
::
instance
(),
SLOT
(
quit
()));
//
//
signals and slots :)
//
connect(m_button,
SIGNAL(clicked(bool)),
this,
SLOT(slotButtonClicked(bool)));
//
connect(m_buttonQuit,
SIGNAL(clicked()),
QApplication::instance(),
SLOT(quit()));
//
connect(m_slider,
SIGNAL(valueChanged(int)),
m_progressBar,
SLOT(setValue(int)));
//
connect(this,
SIGNAL(counterReached()),
QApplication::instance(),
SLOT(quit()));
}
void
Window
::
slotButtonClicked
(
bool
checked
)
{
checked
?
m_button
->
setText
(
"Checked"
)
:
m_button
->
setText
(
"Hello QT!"
);
m_counter
++
;
if
(
m_counter
==
10
){
if
(
m_counter
==
10
)
{
emit
counterReached
();
}
}
This diff is collapsed.
Click to expand it.
window.h
+
1
−
0
View file @
35127515
...
...
@@ -13,6 +13,7 @@ public:
private:
QPushButton
*
m_buttonQuit
;
QPushButton
*
m_button
;
QPushButton
*
grid
[
9
][
9
];
QProgressBar
*
m_progressBar
;
QSlider
*
m_slider
;
int
m_counter
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment