Skip to content
Snippets Groups Projects
Commit 47f1f67b authored by Robert M. O'Bara's avatar Robert M. O'Bara
Browse files

ENH: Fixed issues related to Qt5

1. There seems ot be a bug w/r to QT5's signal and slots concerning when passing a reference to const JSON data -  pqPresetDialog's apply preset signal should pass JSON data when a preset is selected.  If the signal is connected to a slot that takes in no argumenets the signal is properly connected.  However, if you connect the signal to a slot that taked in the reference to the JSON object, the connect method says there is no such slot.

Workaround - changed the slot signature to take in no arguements.

2. In Qt5 , Frames no longer have a setShown method but instead now use setVisible.
parent 37167450
No related branches found
No related tags found
No related merge requests found
......@@ -298,7 +298,7 @@ void smtkAssignColorsView::createWidget()
SLOT(show()));
QObject::connect( // When the user has chosen a preference, remember and apply it.
this->Internals->PaletteChooser, SIGNAL(applyPreset(const Json::Value&)), this,
SLOT(setDefaultPaletteAndApply(const Json::Value&)));
SLOT(setDefaultPaletteAndApply()));
// Signals and slots related to single-color mode:
QObject::connect( // When asked, apply the colormap specified by the user preference.
......@@ -433,10 +433,11 @@ void smtkAssignColorsView::applyDefaultColor()
this->requestOperation(op);
}
void smtkAssignColorsView::setDefaultPaletteAndApply(const Json::Value& preset)
void smtkAssignColorsView::setDefaultPaletteAndApply()
{
const Json::Value& preset = this->Internals->PaletteChooser->currentPreset();
std::string name(preset["Name"].asString().c_str());
//std::cout << "Change default palette to \"" << name << "\"\n";
//std::cerr << "Change default palette to \"" << name << "\"" << std::endl;
pqSettings* settings = pqApplicationCore::instance()->settings();
settings->setValue("ModelBuilder/Operators/AssignColors/defaultPalette", name.c_str());
this->Internals->PaletteChooser->hide();
......
......@@ -54,9 +54,9 @@ protected slots:
virtual void chooseDefaultColorAndApply();
virtual void applyDefaultColor();
virtual void setDefaultPaletteAndApply(const Json::Value& preset);
virtual void applyDefaultPalette();
virtual void removeColors();
virtual void setDefaultPaletteAndApply();
// This slot is used to indicate that the underlying attribute
// for the operation should be checked for validity
......
......@@ -50,7 +50,7 @@
<sender>VisibilityControl</sender>
<signal>toggled(bool)</signal>
<receiver>BodyFrame</receiver>
<slot>setShown(bool)</slot>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>56</x>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment