Skip to content

Commit

Permalink
Merge pull request #62 from Jonathansumner/Desktop-app
Browse files Browse the repository at this point in the history
Basic painting/ Basic file handling/ Colour picking
  • Loading branch information
AidanRandtoul authored Apr 19, 2022
2 parents abbe715 + d906b1f commit c09f7d6
Show file tree
Hide file tree
Showing 13 changed files with 691 additions and 76 deletions.
9 changes: 6 additions & 3 deletions desktop-app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.21)
project(untitled1)
project(Marple-Tilt-Map-Creator)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
Expand All @@ -15,8 +15,8 @@ find_package(Qt5 COMPONENTS
Widgets
REQUIRED)

add_executable(untitled1 main.cpp window.h window.cpp map.h map.cpp Tab1Content.cpp Tab1Content.h Tab3Content.cpp Tab3Content.h Tab2Content.cpp Tab2Content.h Paint.cpp Paint.h)
target_link_libraries(untitled1
add_executable(Marple-Tilt-Map-Creator main.cpp window.h window.cpp map.h map.cpp Tab1Content.cpp Tab1Content.h Tab3Content.cpp Tab3Content.h Tab2Content.cpp Tab2Content.h Paint.cpp Paint.h paintTab.cpp paintTab.h ImageInfo.cpp ImageInfo.h ColourPick.h ColourPick.cpp)
target_link_libraries(Marple-Tilt-Map-Creator
Qt5::Core
Qt5::Gui
Qt5::Widgets
Expand All @@ -40,6 +40,9 @@ if (WIN32)
COMMAND ${CMAKE_COMMAND} -E copy
"${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins/platforms/")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/maps/")
endif ()
foreach (QT_LIB Core Gui Widgets)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
Expand Down
23 changes: 23 additions & 0 deletions desktop-app/ColourPick.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// Created by Ali on 11/04/2022.
//

#include "ColourPick.h"

ColourPick::ColourPick(QWidget *parent) :
QWidget(parent) {


}

QColor ColourPick::onColour()
{
QColor colour = QColorDialog::getColor(Qt::yellow, this );
if( colour.isValid() )
{
return colour;
}
else{
return Qt::black;
}
}
25 changes: 25 additions & 0 deletions desktop-app/ColourPick.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Created by Ali on 08/04/2022.
//

#ifndef UNTITLED1_COLOURPICK_H
#define UNTITLED1_COLOURPICK_H

#include <QWidget>
#include <QDebug>
#include <QColorDialog>

class ColourPick : public QWidget
{
Q_OBJECT
public:
explicit ColourPick(QWidget *parent);


signals:
public slots:
QColor onColour();

};

#endif //UNTITLED1_COLOURPICK_H
5 changes: 5 additions & 0 deletions desktop-app/ImageInfo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Created by Ali on 04/04/2022.
//

#include "ImageInfo.h"
30 changes: 30 additions & 0 deletions desktop-app/ImageInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// Created by Ali on 04/04/2022.
//

#ifndef UNTITLED1_IMAGEINFO_H
#define UNTITLED1_IMAGEINFO_H


class ImageInfo {
private:
int *pixGrid[64][64];

public:
ImageInfo(){
for(int i; i<64; i++){
for(int j; j<64; j++){
pixGrid[64][64] = 0;
}
}
}
int* readPixGrid(int x, int y){
return pixGrid[x][y];
}
void writePixGrid(int x, int y, int element){
pixGrid[x][y] = &element;
}
};


#endif //UNTITLED1_IMAGEINFO_H
Loading

0 comments on commit c09f7d6

Please sign in to comment.