Skip to content
Snippets Groups Projects
Commit 35127515 authored by Silas Dohm's avatar Silas Dohm
Browse files

cell class start

parent 6f22f088
No related branches found
No related tags found
1 merge request!1Master
......@@ -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
......
cell.cpp 0 → 100644
#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
cell.h 0 → 100644
#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
......@@ -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();
}
}
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment