mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-17 22:00:29 +02:00
Fixed all warnings. the rest is just some false warnings from cppcheck
This commit is contained in:
@@ -856,7 +856,9 @@ void IntelliPhotoGui::UpdateGui(){
|
|||||||
dimCanvas->setText(string);
|
dimCanvas->setText(string);
|
||||||
|
|
||||||
if(paintingArea->layerBundle.size() != 0) {
|
if(paintingArea->layerBundle.size() != 0) {
|
||||||
string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast<unsigned long long>(paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast<unsigned long long>(paintingArea->getNumberOfActiveLayer())].height);
|
string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast<size_t>
|
||||||
|
(paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast<size_t>
|
||||||
|
(paintingArea->getNumberOfActiveLayer())].height);
|
||||||
dimActive->setText(string);
|
dimActive->setText(string);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -233,11 +233,11 @@ void PaintingArea::createFloodFillTool(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int PaintingArea::getWidthOfActive(){
|
int PaintingArea::getWidthOfActive(){
|
||||||
return this->layerBundle[static_cast<unsigned long long>(activeLayer)].width;
|
return this->layerBundle[static_cast<size_t>(activeLayer)].width;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PaintingArea::getHeightOfActive(){
|
int PaintingArea::getHeightOfActive(){
|
||||||
return this->layerBundle[static_cast<unsigned long long>(activeLayer)].height;
|
return this->layerBundle[static_cast<size_t>(activeLayer)].height;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PaintingArea::getMaxWidth(){
|
int PaintingArea::getMaxWidth(){
|
||||||
@@ -249,11 +249,11 @@ int PaintingArea::getMaxHeight(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
IntelliImage::ImageType PaintingArea::getTypeOfImageRealLayer(){
|
IntelliImage::ImageType PaintingArea::getTypeOfImageRealLayer(){
|
||||||
return this->layerBundle[static_cast<unsigned long long>(activeLayer)].image->getTypeOfImage();
|
return this->layerBundle[static_cast<size_t>(activeLayer)].image->getTypeOfImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
|
std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
|
||||||
return this->layerBundle[static_cast<unsigned long long>(activeLayer)].image->getPolygonData();
|
return this->layerBundle[static_cast<size_t>(activeLayer)].image->getPolygonData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a mouse button is pressed check if it was the
|
// If a mouse button is pressed check if it was the
|
||||||
@@ -265,8 +265,8 @@ void PaintingArea::mousePressEvent(QMouseEvent*event){
|
|||||||
}
|
}
|
||||||
if(Tool == nullptr)
|
if(Tool == nullptr)
|
||||||
return;
|
return;
|
||||||
int x = event->x() - layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset;
|
||||||
int y = event->y() - layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
|
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset;
|
||||||
if(event->button() == Qt::LeftButton) {
|
if(event->button() == Qt::LeftButton) {
|
||||||
Tool->onMouseLeftPressed(x, y);
|
Tool->onMouseLeftPressed(x, y);
|
||||||
}else if(event->button() == Qt::RightButton) {
|
}else if(event->button() == Qt::RightButton) {
|
||||||
@@ -284,8 +284,8 @@ void PaintingArea::mouseMoveEvent(QMouseEvent*event){
|
|||||||
}
|
}
|
||||||
if(Tool == nullptr)
|
if(Tool == nullptr)
|
||||||
return;
|
return;
|
||||||
int x = event->x() - layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset;
|
||||||
int y = event->y() - layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
|
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset;
|
||||||
Tool->onMouseMoved(x, y);
|
Tool->onMouseMoved(x, y);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -296,8 +296,8 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
|
|||||||
return;
|
return;
|
||||||
if(Tool == nullptr)
|
if(Tool == nullptr)
|
||||||
return;
|
return;
|
||||||
int x = event->x() - layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset;
|
||||||
int y = event->y() - layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
|
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset;
|
||||||
if(event->button() == Qt::LeftButton) {
|
if(event->button() == Qt::LeftButton) {
|
||||||
Tool->onMouseLeftReleased(x, y);
|
Tool->onMouseLeftReleased(x, y);
|
||||||
}else if(event->button() == Qt::RightButton) {
|
}else if(event->button() == Qt::RightButton) {
|
||||||
@@ -341,7 +341,7 @@ void PaintingArea::selectLayerUp(){
|
|||||||
void PaintingArea::selectLayerDown(){
|
void PaintingArea::selectLayerDown(){
|
||||||
updateTools();
|
updateTools();
|
||||||
if(activeLayer>0) {
|
if(activeLayer>0) {
|
||||||
std::swap(layerBundle[static_cast<unsigned long long>(activeLayer)], layerBundle[static_cast<unsigned long long>(activeLayer - 1)]);
|
std::swap(layerBundle[static_cast<size_t>(activeLayer)], layerBundle[static_cast<size_t>(activeLayer - 1)]);
|
||||||
activeLayer--;
|
activeLayer--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -385,11 +385,11 @@ bool PaintingArea::createTempTopLayer(int idx){
|
|||||||
if(idx>=0) {
|
if(idx>=0) {
|
||||||
LayerObject newLayer;
|
LayerObject newLayer;
|
||||||
newLayer.alpha = 255;
|
newLayer.alpha = 255;
|
||||||
newLayer.height = layerBundle[static_cast<unsigned long long>(idx)].height;
|
newLayer.height = layerBundle[static_cast<size_t>(idx)].height;
|
||||||
newLayer.width = layerBundle[static_cast<unsigned long long>(idx)].width;
|
newLayer.width = layerBundle[static_cast<size_t>(idx)].width;
|
||||||
newLayer.heightOffset = layerBundle[static_cast<unsigned long long>(idx)].heightOffset;
|
newLayer.heightOffset = layerBundle[static_cast<size_t>(idx)].heightOffset;
|
||||||
newLayer.widthOffset = layerBundle[static_cast<unsigned long long>(idx)].widthOffset;
|
newLayer.widthOffset = layerBundle[static_cast<size_t>(idx)].widthOffset;
|
||||||
newLayer.image = layerBundle[static_cast<unsigned long long>(idx)].image->getDeepCopy();
|
newLayer.image = layerBundle[static_cast<size_t>(idx)].image->getDeepCopy();
|
||||||
layerBundle.insert(layerBundle.begin() + idx + 1,newLayer);
|
layerBundle.insert(layerBundle.begin() + idx + 1,newLayer);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user