Browse Source

QColorDialog modifications

Der QColorDialog hat jetzt einen Titel und nutzt den systemunabhängigen Standard-ColorPicker
master
Lars Mewes 3 years ago
parent
commit
8187d7c3b7
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      CircleOfFifths.cpp

+ 9
- 1
CircleOfFifths.cpp View File

}; };


void CircleOfFifths::mousePressEvent(QGraphicsSceneMouseEvent *event){ void CircleOfFifths::mousePressEvent(QGraphicsSceneMouseEvent *event){
QString title = "Bitte Farbe wählen für Ton ";
if(event->button() == Qt::LeftButton){ if(event->button() == Qt::LeftButton){
for(int i=0; i<12; i++){ for(int i=0; i<12; i++){
if(circleElements[i]->sceneBoundingRect().contains(event->scenePos())){ if(circleElements[i]->sceneBoundingRect().contains(event->scenePos())){
circleElements[i]->getTone()->setColor(QColorDialog::getColor(circleElements[i]->getTone()->getColor()));
circleElements[i]->getTone()->setColor(
QColorDialog::getColor(
circleElements[i]->getTone()->getColor(),
nullptr,
title.append(circleElements[i]->getTone()->getName()),
QColorDialog::DontUseNativeDialog
)
);
} }
}} }}
}; };

Loading…
Cancel
Save