void ProcessingPipeline::upClicked( int id ) { if( !isVeryTopElement( id ) ) { int actualID = findId( currentProcessingStepOrder, id ); int oneButtonUpID = actualID - 1; std::swap( currentProcessingStepOrder[ actualID ], currentProcessingStepOrder[ oneButtonUpID ] ); actualID = getActualID( actualID ); oneButtonUpID = getActualID( oneButtonUpID ); // swap the down button positions QPushButton * clickedButtonDown = processingPipelineConfigWidget->getDownButtonById( actualID ); QRect tempPosDown = clickedButtonDown->geometry(); QPushButton * toSwapWithButtonDown = processingPipelineConfigWidget->getDownButtonById( oneButtonUpID ); clickedButtonDown->setGeometry( toSwapWithButtonDown->geometry() ); toSwapWithButtonDown->setGeometry( tempPosDown ); // swap the up button position QPushButton * clickedButtonUp = processingPipelineConfigWidget->getUpButtonByID( actualID ); QRect tempPosUp = clickedButtonUp->geometry(); QPushButton * toSwapWithButtonUp = processingPipelineConfigWidget->getUpButtonByID( oneButtonUpID ); clickedButtonUp->setGeometry( toSwapWithButtonUp->geometry() ); toSwapWithButtonUp->setGeometry( tempPosUp ); // swap labels QLabel * clickedLabel = processingPipelineConfigWidget->getLabelByID( actualID ); QRect tempPosLabel = clickedLabel->geometry(); QLabel * toSwapWithLabel = processingPipelineConfigWidget->getLabelByID( oneButtonUpID ); clickedLabel->setGeometry( toSwapWithLabel->geometry() ); toSwapWithLabel->setGeometry( tempPosLabel ); // config button QPushButton * clickedButtonConfig = processingPipelineConfigWidget->getConfigButtonByID( actualID ); QRect tempPosConfig = clickedButtonConfig->geometry(); QPushButton * toSwapWithButtonConfig = processingPipelineConfigWidget->getConfigButtonByID( oneButtonUpID ); clickedButtonConfig->setGeometry( toSwapWithButtonConfig->geometry() ); toSwapWithButtonConfig->setGeometry( tempPosConfig ); // checkbox QCheckBox * clickedCheckBox = processingPipelineConfigWidget->getCheckBoxByID( actualID ); QRect tempPosCheckbox = clickedCheckBox->geometry(); QCheckBox * toSwapWithCheckbox = processingPipelineConfigWidget->getCheckBoxByID( oneButtonUpID ); clickedCheckBox->setGeometry( toSwapWithCheckbox->geometry() ); toSwapWithCheckbox->setGeometry( tempPosCheckbox ); } }