-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Jonathansumner/Desktop-app
Basic painting/ Basic file handling/ Colour picking
- Loading branch information
Showing
13 changed files
with
691 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// | ||
// Created by Ali on 04/04/2022. | ||
// | ||
|
||
#include "ImageInfo.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.