Commit e5f3cc13 authored by Emmanuel Promayon's avatar Emmanuel Promayon

Merge branch 'feature/dont-crash-if-extlib-exceptions' into 'develop'

Feature/dont crash if extlib exceptions

See merge request !90
parents 03800dab 7c219a29
## About you:
## About you
[Present yourself and your project you're working on with CamiTK]
## Overview:
## Overview
[Rewrite here a larger and more detailed restatement of your summary]
## Steps to Reproduce:
## Steps to Reproduce
[Write here the step - by - step process to reproduce the bug, including file to test (you can attach file on gitlab issue report system)]
## Actual VS Expected Result:
## Actual VS Expected Result
[Write here the result of the step - by - step process and explain why it is not what you expected]
## Relevant logs and/or screenshots:
## Relevant logs and/or screenshots
[Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.]
## Interpretation & Possible fixes:
## Interpretation & Possible fixes
[Write here your interpretation of this bug (If you can, link to the line of code that might be responsible for the problem)]
## CamiTK Version:
## CamiTK Version
[Copy/Paste the output of `camitk-config -b` CamiTK Version part ]
......
## About you:
## About you
[Present yourself and your project you're working on with CamiTK]
## Product:
## Product
[Specify which part of framework is concerned]
## Overview:
## Overview
[Rewrite here a larger and more detailed restatement of your summary]
## Relevant logs and/or screenshots:
## Relevant logs and/or screenshots
[Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.]
......
......@@ -26,8 +26,15 @@
## Track
One (or two) of:
/label ~"Track None"
/label ~"Track Code Maintainability"
/label ~"Track Continuous Integration"
/label ~"Track Debugging"
/label ~"Track Knowledge Management"
/label ~"Track Prototyping Experience"
/label ~"Track Technology Integration"
/label ~"Track User Support"
[or if known, add the corresponding track label]
## Misc
......
......@@ -43,9 +43,9 @@ using namespace camitk;
// --------------- constructor -------------------
SobelEdgeDetection::SobelEdgeDetection(ActionExtension* extension) : Action(extension) {
// Setting name, description and input component
setName("Sobel Edge Detecton");
setName("Sobel Edge Detection");
setDescription("<br>A 2D or 3D <b>edge detection using the Sobel operator</b>.<br> \
This filter uses the Sobel operator to calculate the image gradient and then finds the magnitude of this gradient vector. The Sobel gradient magnitude (square-root sum of squares) is an indication of edge strength..<br>");
This filter uses the Sobel operator to calculate the image gradient and then finds the magnitude of this gradient vector. The Sobel gradient magnitude (square-root sum of squares) is an indication of edge strength..<br>");
setComponent("ImageComponent");
// Setting classification family and tags
......@@ -64,8 +64,8 @@ SobelEdgeDetection::~SobelEdgeDetection() {
// --------------- apply -------------------
Action::ApplyStatus SobelEdgeDetection::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -75,7 +75,7 @@ void SobelEdgeDetection::process(ImageComponent* comp) {
this->keepOrgVoxelType = property("Keep original voxel type?").toBool();
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_edges");
// consider frame policy on new image created
......@@ -134,14 +134,14 @@ vtkSmartPointer<vtkImageData> SobelEdgeDetection::itkProcess(vtkSmartPointer<vtk
// From original type to double type
castFilterIn->SetInput(vtkToItkFilter->GetOutput());
castFilterIn->AddObserver(itk::ProgressEvent(), observer );
castFilterIn->AddObserver(itk::ProgressEvent(), observer);
castFilterIn->Update();
observer->Reset();
// Apply Sobel Edge Detection Filter
sobelFilter->SetInput(castFilterIn->GetOutput());
sobelFilter->AddObserver(itk::ProgressEvent(), observer );
sobelFilter->AddObserver(itk::ProgressEvent(), observer);
sobelFilter->Update();
observer->Reset();
......@@ -152,7 +152,7 @@ vtkSmartPointer<vtkImageData> SobelEdgeDetection::itkProcess(vtkSmartPointer<vtk
castFilterOut->Update();
observer->Reset();
itkToVtkFilter2->SetInput(castFilterOut->GetOutput());
itkToVtkFilter2->AddObserver(itk::ProgressEvent(), observer );
itkToVtkFilter2->AddObserver(itk::ProgressEvent(), observer);
// --------------------- Actually execute all filters parts --------------------
itkToVtkFilter2->Update();
observer->Reset();
......@@ -162,7 +162,7 @@ vtkSmartPointer<vtkImageData> SobelEdgeDetection::itkProcess(vtkSmartPointer<vtk
else {
// From ITK to VTK
itkToVtkFilter->SetInput(sobelFilter->GetOutput());
itkToVtkFilter->AddObserver(itk::ProgressEvent(), observer );
itkToVtkFilter->AddObserver(itk::ProgressEvent(), observer);
// --------------------- Actually execute all filters parts --------------------
itkToVtkFilter->Update();
observer->Reset();
......
......@@ -16,7 +16,6 @@
<camitk:parameters>
<camitk:parameter name="File Name" value="input-1.mha" type="QString"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:outputs>
<camitk:component name="input-1.mha" type="ImageComponent"/>
</camitk:outputs>
......@@ -37,7 +36,6 @@
<camitk:parameter name="Inside value" value="0" type="int"/>
<camitk:parameter name="Outside value" value="255" type="int"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="input-1.mha" type="ImageComponent"/>
</camitk:inputs>
......@@ -89,7 +87,6 @@
<camitk:parameter name="Image scalar type" value="0" type="int"/>
<camitk:parameter name="Type of operation" value="0" type="int"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="output-1.mha" type="ImageComponent"/>
</camitk:inputs>
......@@ -176,7 +173,6 @@
<camitk:parameter name="Low threshold" value="1" type="int"/>
<camitk:parameter name="High threshold" value="1" type="int"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="output-3.mha" type="ImageComponent"/>
</camitk:inputs>
......@@ -222,7 +218,6 @@
<camitk:parameter name="Image scalar type" value="0" type="int"/>
<camitk:parameter name="Type of operation" value="1" type="int"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="output-4.mha" type="ImageComponent"/>
</camitk:inputs>
......@@ -268,7 +263,6 @@
<camitk:parameter name="Image scalar type" value="0" type="int"/>
<camitk:parameter name="Type of operation" value="3" type="int"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="output-5.mha" type="ImageComponent"/>
</camitk:inputs>
......@@ -413,7 +407,6 @@
<camitk:parameter name="Subsampled image height (Y)" value="16" type="int"/>
<camitk:parameter name="Subsampled image depth (Z)" value="16" type="int"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="output-6.mha" type="ImageComponent"/>
</camitk:inputs>
......@@ -458,7 +451,6 @@
<camitk:parameters>
<camitk:parameter name="Tolerance" value="1" type="double"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="output-7.vtk" type="MeshComponent"/>
</camitk:inputs>
......
......@@ -52,7 +52,6 @@ OtsuFilter::OtsuFilter(ActionExtension* extension) : Action(extension) {
this->addTag("Threshold");
this->addTag("Automatic");
this->addTag("Otsu");
this->addTag("Region Growing");
this->computedThresholdProperty = new Property(tr("Computed threshold:"), tr("?"), tr("The computed threshold found by the Otsu filter. \nThis property is read only and only updated after applying the action on a component."), "");
computedThresholdProperty->setReadOnly(true);
......
......@@ -58,7 +58,8 @@ RegionGrowing::RegionGrowing(ActionExtension* extension) : Action(extension) {
this->addTag("Classification");
this->addTag("Growing Region");
this->addTag("Seed Point");
this->addTag("Region Growing");
// Setting the widget containing the parameters
theWidget = NULL;
......
......@@ -23,103 +23,103 @@
* $CAMITK_LICENCE_END$
****************************************************************************/
vtkSmartPointer<vtkImageData> RegionGrowing::implementProcess(vtkSmartPointer<vtkImageData> img)
{
vtkSmartPointer<vtkImageData> result = NULL;
if (img == NULL)
return result;
int * dims = img->GetDimensions();
int dim = 0;
if (dims[2] == 0)
dim = 2;
else
dim = 3;
int scalarType = img->GetScalarType();
switch (scalarType)
{
case VTK_CHAR :
if (dim == 2)
result = itkProcess<char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<char, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_CHAR :
if (dim == 2)
result = itkProcess<unsigned char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned char, unsigned char, 3>(img);
break;
case VTK_SIGNED_CHAR :
if (dim == 2)
result = itkProcess<signed char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<signed char, unsigned char, 3>(img);
break;
case VTK_SHORT :
if (dim == 2)
result = itkProcess<short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<short, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_SHORT :
if (dim == 2)
result = itkProcess<unsigned short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned short, unsigned char, 3>(img);
break;
case VTK_INT :
if (dim == 2)
result = itkProcess<int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<int, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_INT :
if (dim == 2)
result = itkProcess<unsigned int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned int, unsigned char, 3>(img);
break;
case VTK_LONG :
if (dim == 2)
result = itkProcess<long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<long, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_LONG :
if (dim == 2)
result = itkProcess<unsigned long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned long, unsigned char, 3>(img);
break;
case VTK_FLOAT :
if (dim == 2)
result = itkProcess<float, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<float, unsigned char, 3>(img);
break;
case VTK_DOUBLE :
if (dim == 2)
result = itkProcess<double, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<double, unsigned char, 3>(img);
break;
default :
break;
}
return result;
}
vtkSmartPointer<vtkImageData> RegionGrowing::implementProcess(vtkSmartPointer<vtkImageData> img) {
vtkSmartPointer<vtkImageData> result = NULL;
if (img == NULL)
return result;
int* dims = img->GetDimensions();
int dim = 0;
if (dims[2] == 0)
dim = 2;
else
dim = 3;
int scalarType = img->GetScalarType();
switch (scalarType) {
case VTK_CHAR :
if (dim == 2)
result = itkProcess<char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<char, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_CHAR :
if (dim == 2)
result = itkProcess<unsigned char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned char, unsigned char, 3>(img);
break;
case VTK_SIGNED_CHAR :
if (dim == 2)
result = itkProcess<signed char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<signed char, unsigned char, 3>(img);
break;
case VTK_SHORT :
if (dim == 2)
result = itkProcess<short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<short, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_SHORT :
if (dim == 2)
result = itkProcess<unsigned short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned short, unsigned char, 3>(img);
break;
case VTK_INT :
if (dim == 2)
result = itkProcess<int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<int, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_INT :
if (dim == 2)
result = itkProcess<unsigned int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned int, unsigned char, 3>(img);
break;
case VTK_LONG :
if (dim == 2)
result = itkProcess<long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<long, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_LONG :
if (dim == 2)
result = itkProcess<unsigned long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned long, unsigned char, 3>(img);
break;
case VTK_FLOAT :
if (dim == 2)
result = itkProcess<float, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<float, unsigned char, 3>(img);
break;
case VTK_DOUBLE :
if (dim == 2)
result = itkProcess<double, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<double, unsigned char, 3>(img);
break;
default :
break;
}
return result;
}
......@@ -59,7 +59,7 @@ OpenFile::OpenFile (ActionExtension* extension) : Action (extension) {
getQAction()->setShortcutContext(Qt::ApplicationShortcut);
// the unique property is the filename
Property* fileNameProperty = new Property(tr("File name"), "", tr("The name of the file to open."), "");
Property* fileNameProperty = new Property(tr("File Name"), "", tr("The name of the file to open."), "");
addParameter(fileNameProperty);
// lazy instanciation
......
......@@ -119,7 +119,6 @@ void FrameEditor::init() {
connect(ui.translatePushButton, SIGNAL(clicked()), this, SLOT(translate()));
connect(ui.setTranslationPushButton, SIGNAL(clicked()), this, SLOT(setTranslation()));
// connect(ui.transformationTableWidget, SIGNAL(cellChanged(int, int)), this, SLOT(transformationChanged()));
for (int j = 0; j < 4; j++) {
for (int i = 0; i < 4; i++) {
connect(transfromMatrixElements[j][i], SIGNAL(returnPressed()), this, SLOT(transformationChanged()));
......@@ -159,7 +158,12 @@ QWidget* FrameEditor::getWidget() {
// --------------- initializeDialogWithCurrentComponent -------------------
void FrameEditor::initializeDialogWithCurrentComponent() {
// ui.displayFrameCheckBox->setChecked(false);
// update checkbox
ui.displayFrameCheckBox->blockSignals(true);
bool isFrameDisplayed = currentComponent->getFrameVisibility(InteractiveViewer::get3DViewer());
ui.displayFrameCheckBox->setChecked(isFrameDisplayed);
ui.displayFrameCheckBox->blockSignals(false);
// Update the Parent Frame
bool parentFrameSignalState = ui.parentFrameComboBox->blockSignals(true);
ui.parentFrameComboBox->clear();
......
......@@ -15,14 +15,8 @@
<camitk:action>
<camitk:name>Open File</camitk:name>
<camitk:parameters>
<!--
Bug? There are two lines for this parameter, the first is written with an empty name value:
<camitk:parameter name="File name" value="" type="QString"/>
This should not appear.
-->
<camitk:parameter name="File Name" value="input-1.mha" type="QString"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:outputs>
<camitk:component name="image" type="ImageComponent"/>
</camitk:outputs>
......@@ -46,7 +40,6 @@
<camitk:parameter name="Subsampled image height (Y)" value="32" type="int"/>
<camitk:parameter name="Subsampled image depth (Z)" value="32" type="int"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="image" type="ImageComponent"/>
</camitk:inputs>
......
......@@ -47,6 +47,8 @@
*/
class ActionState : public QState {
Q_OBJECT
public:
/**
*/
......
......@@ -129,7 +129,7 @@ void ActionStateMachine::autoNext() {
setProperty("Message Box Level", InterfaceLogger::NONE);
// machine.configuration() returns all the current state, the first on is the active state
ActionState* currentState = dynamic_cast<ActionState*>(machine.configuration().toList().first());
ActionState* currentState = qobject_cast<ActionState*>(machine.configuration().toList().first());
// loop until no more state is available
while (currentState!=nullptr && currentState->transitions().size()>0) {
......@@ -138,7 +138,8 @@ void ActionStateMachine::autoNext() {
bool foundNextState = false;
while (it!=currentState->transitions().end() && !foundNextState) { // && nextState==nullptr) {
// all transition in this state machine are ActionTransition instances...
ActionTransition* currentActionTransition = dynamic_cast<ActionTransition*>(*it);
ActionTransition* currentActionTransition = qobject_cast<ActionTransition*>(*it);
//... in which we can look for the "Next" or "Quit" transition
if (currentActionTransition->isNamed("Next") || currentActionTransition->isNamed("Quit")) {
// activate the transition (simulate a click on the button)
......
......@@ -57,6 +57,7 @@ class ActionState;
*
*/
class ActionTransition : public QSignalTransition {
Q_OBJECT
public:
......
......@@ -180,7 +180,7 @@ void ImpMainWindow::initActions() {
connect(editApplicationSettings, SIGNAL(triggered()), this, SLOT(editSettings()));
// save history as SCXML
saveHistory = new QAction(tr("&Save history"), this);
saveHistory = new QAction(tr("&Save History"), this);
saveHistory->setStatusTip(tr("Save the history of actions processed as an SCXML file."));
saveHistory->setWhatsThis(tr("Save the history of actions processed as an SCXML file."));
connect(saveHistory, SIGNAL(triggered()), this, SLOT(saveHistoryAsSCXML()));
......
......@@ -130,6 +130,7 @@ int main(int argc, char* argv[]) {
if (loadAdditionnalComponentExtension) {
std::cout << "- additional component extension: \"" << o.component() << "\"" << std::endl;
}
std::cout << "Working directory: " << QDir::currentPath().toStdString() << std::endl;
testInit("Starting the camitk default application...");
......
......@@ -115,7 +115,9 @@ endif()
# parallelize ci scripts if possible
include(ProcessorCount)
ProcessorCount(NUMBER_OF_PROC)
if(NOT NUMBER_OF_PROC EQUAL 0)
# remove some to avoid processor overload
MATH(EXPR NUMBER_OF_PROC "${NUMBER_OF_PROC}-2")
if(NUMBER_OF_PROC GREATER 0)
if(COMPILER MATCHES "GCC" OR COMPILER MATCHES "Ninja")
set(CTEST_BUILD_FLAGS -j${NUMBER_OF_PROC})
elseif(COMPILER MATCHES "MSVC.*")
......
......@@ -42,8 +42,8 @@ ci_start_log(FILENAME "${CI_PROJECT_LOG_DIRECTORY}/ci-test.log")
# ------------------------ STEP 2: test ------------------------
ci_log("Step 2. Test all CAMITK_TARGETs... Using ${NUMBER_OF_PROC} tests in parallel")
# set extra time for test (default is 600 s)
set(CTEST_TEST_TIMEOUT 1500)
# set extra time for test to 30 min = 1800 s (default is 10 min = 600 s)
set(CTEST_TEST_TIMEOUT 1800)
# Get the CAMITK_TARGETs listing (automatically created at configuration step)
include("${CTEST_BINARY_DIRECTORY}/Subprojects.cmake")
......
......@@ -12,7 +12,7 @@
#! Usage:
#! \code
#! camitk_add_test(EXECUTABLE_ARGS "arg1 arg2 arg3"
#! PASS_FILE pristineOutput
#! PASS_FILE_OUTPUT pristineOutput
#! PASS_REGULAR_EXPRESSION regexp
#! FAIL_REGULAR_EXPRESSION regexp
#! PROJECT_NAME name
......@@ -21,7 +21,7 @@
#! \endcode
#!
#! \param EXECUTABLE_ARGS (optional) The executable arguments (all in double quotes), typically each test will have different arguments. Can be empty
#! \param PASS_FILE (optional) If specified the test to perform is to compare the output of the command to this file. It the output is the same, then the test is passed, otherwise it is failed.
#! \param PASS_FILE_OUTPUT (optional) If specified the test to perform is to compare the output of the command to this file. It the output is the same, then the test is passed, otherwise it is failed.
#! \param PASS_REGULAR_EXPRESSION (optional) This is equivalent to "PASS_REGULAR_EXPRESSION regexp" property for the test, see http://www.cmake.org/Wiki/CTest:FAQ#My_test_does_not_return_non-zero_on_failure._What_can_I_do.3F
#! \param FAIL_REGULAR_EXPRESSION This is equivalent to "FAIL_REGULAR_EXPRESSION regexp" property for the test, see http://www.cmake.org/Wiki/CTest:FAQ#My_test_does_not_return_non-zero_on_failure._What_can_I_do.3F
#! \param PROJECT_NAME Base name for the test, can be used for ctest -S
......
......@@ -186,7 +186,7 @@ Action::ApplyStatus Action::trigger(QWidget* parent) {
if (targetComponents.size() > 0 || getComponent().isEmpty()) {
if (isEmbedded) {
// if there are no parents to use use the action viewer
if (!parent) {
if (parent == nullptr) {
ActionViewer::getInstance()->embedActionWidget(this);
}
else {
......
......@@ -241,7 +241,7 @@ public slots:
* The parent widget is used if the action is embedded, see class description for more information about the algorithm.
* This method cannot be redefined in inherited class.
*/
ApplyStatus trigger(QWidget* parent = NULL);
ApplyStatus trigger(QWidget* parent = nullptr);
/**
* This method is called when the action has to be applied on the target list (get the target lists using getTargets())
......
......@@ -103,6 +103,9 @@ public:
*/
/// @{
/// reimplemented from QApplication to catch all exception from external libs used in CEP (e.g. from ITK) and avoid crashes...
bool notify(QObject* , QEvent* );
/// get the application name
static QString getName();
......
......@@ -231,7 +231,7 @@ void ActionViewer::updateActionViewer(UpdateReason reason) {
ActionList actionset = Application::getActions(Application::getSelectedComponents(), tagLineEdit->text());
if (!actionset.isEmpty()) {
if (1 == actionset.size()) {
if (actionset.size() == 1) {
action = *(actionset.begin());
nameComboBox->setCurrentIndex(nameComboBox->findText(action->getName()));
updateActionViewer(ActionNameChanged);
......
......@@ -3,24 +3,3 @@ camitk_extension(ACTION_EXTENSION
ENABLE_AUTO_TEST
TEST_FILES Mesh.off BigEndian.hdr BigEndian.img BigEndianCompressed1.hdr BigEndianCompressed1.img biorad.pic brain.mha cthead1.lsm LittleEndian1.hdr LittleEndian1.img LittleEndianCompressed1.hdr LittleEndianCompressed1.img LittleEndianZ1.hdr mini-complex-slow1.nrrd mini-ten-nomask-slow1.nrrd mini-vector-slow1.nrrd ramp1.gipl
)
# Tests fail due to OpenGL crashing when accessed inside a VM
if(WIN32)
set_tests_properties(action-sleepingwhileworking-level1-2
action-sleepingwhileworking-level1-3
action-sleepingwhileworking-level1-4
action-sleepingwhileworking-level1-5
action-sleepingwhileworking-level1-6
action-sleepingwhileworking-level1-7
action-sleepingwhileworking-level1-8
action-sleepingwhileworking-level1-9
action-sleepingwhileworking-level1-10
action-sleepingwhileworking-level1-11
action-sleepingwhileworking-level1-12
action-sleepingwhileworking-level1-13
action-sleepingwhileworking-level1-14
action-sleepingwhileworking-level1-15
action-sleepingwhileworking-level1-16
action-sleepingwhileworking-level1-17
PROPERTIES WILL_FAIL true)
endif()
......@@ -177,8 +177,14 @@ void WorkingWhenSleepingLinear::process(ImageComponent* comp) {
camitk::Application::setProgressBarValue(100 * n / numberOfWindows);
myMedicalImageViewer->refresh();
Application::refresh();
Application::processEvents();
// In order to see the change in the viewers, the initial idea was to call
// Application::processEvents();
// but, as explained in the Qt documentation:
// > In the event that you are running a local loop which calls this function continuously,
// > without an event loop, the DeferredDelete events will not be processed. This can affect
// > the behaviour of widgets, e.g. QToolTip, that rely on DeferredDelete events to function
// > properly. An alternative would be to call sendPostedEvents() from within that local loop.
Application::sendPostedEvents();
}
// set normal zoom
......
......@@ -108,9 +108,14 @@ void WorkingWhenSleepingRandom::process(ImageComponent* comp) {
// Refresh the Viewers ....
myMedicalImageViewer->refresh();
Application::refresh();
Application::processEvents();
}
// In order to see the change in the viewers, the initial idea was to call
// Application::processEvents();
// but, as explained in the Qt documentation:
// > In the event that you are running a local loop which calls this function continuously,
// > without an event loop, the DeferredDelete events will not be processed. This can affect
// > the behaviour of widgets, e.g. QToolTip, that rely on DeferredDelete events to function
// > properly. An alternative would be to call sendPostedEvents() from within that local loop.
Application::sendPostedEvents(); }
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment