<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle">
<!--
p
{margin-top:0px;
margin-bottom:0px}
p
{margin-top:0;
margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Just wanted to correct myself. Below code snippet works finally. Earlier I kept it in wrong place, therefore list came empty.
<br>
<br>
Thanks Joachim and Cory for useful suggestions.<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF459"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Paraview-developers [paraview-developers-bounces@paraview.org] on behalf of Prashant V<br>
<b>Sent:</b> Thursday, December 10, 2015 2:40 PM<br>
<b>To:</b> Joachim Pouderoux<br>
<b>Cc:</b> paraview-developers@paraview.org<br>
<b>Subject:</b> Re: [Paraview-developers] Disabling a menu item in Paraview GUI<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi Joachim,<br>
<br>
Now I want to do operations with my menu when user clicks on Apply button. Taking cue from this link (https://cmake.org/pipermail/paraview/2015-July/034476.html)<br>
I tried to connect Apply button signal 'applied()' (defined in pqPropertiesPanel.h) with a slot defined in my menu class. My code snippet is:<br>
<br>
QList<pqPropertiesPanel*> ppanels = pqCoreUtilities::mainWidget()->findChildren<pqPropertiesPanel*>();<br>
foreach (pqPropertiesPanel* ppanel, ppanels)<br>
{<br>
QObject::connect(ppanel, SIGNAL(applied()), myMenuObject, SLOT(onApplyClicked()));<br>
} <br>
<br>
This code doesn't work because QList ppanels remains empty. How should I access pqPropertiesPanel object in my menu class? Thanks.<br>
<br>
Regards,<br>
Prashant<br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF627546" style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Paraview-developers [paraview-developers-bounces@paraview.org] on behalf of Prashant V<br>
<b>Sent:</b> Wednesday, December 09, 2015 1:34 PM<br>
<b>To:</b> Joachim Pouderoux<br>
<b>Cc:</b> paraview-developers@paraview.org<br>
<b>Subject:</b> Re: [Paraview-developers] Disabling a menu item in Paraview GUI<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<p>Thanks Joachim. This works absolutely the way I wanted.</p>
<p> </p>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF486168" style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Joachim Pouderoux [joachim.pouderoux@kitware.com]<br>
<b>Sent:</b> Tuesday, December 08, 2015 8:23 PM<br>
<b>To:</b> Prashant V<br>
<b>Cc:</b> paraview-developers@paraview.org<br>
<b>Subject:</b> Re: [Paraview-developers] Disabling a menu item in Paraview GUI<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Prashant,<br>
<br>
Sure. You could listen for object builder events (see signals section of pqObjectBuilder.h):<br>
<br>
<span style="font-family:monospace,monospace"> QObject::connect(pqApplicationCore::instance()->getObjectBuilder(),<br>
SIGNAL(destroying(pqPipelineSource*)),<br>
this,<br>
SLOT(onSourceRemoved(pqPipelineSource*)));<br>
<br>
</span></div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature">
<div dir="ltr"><b>Joachim Pouderoux</b><br>
<blockquote style="border-left:rgb(204,204,204) 1px solid; margin:0px 0px 0px 0.8ex; padding-left:1ex">
<font size="1"><i>PhD, Technical Expert</i></font><br>
<b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br>
</blockquote>
</div>
</div>
</div>
<br>
<div class="gmail_quote">2015-12-08 15:48 GMT+01:00 Prashant V <span dir="ltr"><<a href="mailto:prashant.v@quest-global.com" target="_blank">prashant.v@quest-global.com</a>></span>:<br>
<blockquote class="gmail_quote" style="border-left:#ccc 1px solid; margin:0px 0px 0px 0.8ex; padding-left:1ex">
<div>
<div style="font-family:Tahoma; direction:ltr; color:#000000; font-size:10pt">Hi Joachim,
<div><br>
</div>
<div>Thanks for sharing this snippet. This is really helpful. I have one more question further.</div>
<div>In my case, how should I access object of my menu when user clicks on 'Delete' button. I don't want to change Paraview source code where 'Delete' callback slot is implemented. </div>
<div><br>
</div>
<div>Regards,</div>
<div>Prashant </div>
<div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Joachim Pouderoux [<a href="mailto:joachim.pouderoux@kitware.com" target="_blank">joachim.pouderoux@kitware.com</a>]<br>
<b>Sent:</b> Tuesday, December 08, 2015 4:36 PM<br>
<b>To:</b> Prashant V<br>
<b>Cc:</b> <a href="mailto:paraview-developers@paraview.org" target="_blank">paraview-developers@paraview.org</a><br>
<b>Subject:</b> Re: [Paraview-developers] Disabling a menu item in Paraview GUI<br>
</font><br>
</div>
<div>
<div class="h5">
<div></div>
<div>
<div dir="ltr">
<div>Prashant,<br>
<br>
I think you could track the number of objects available in the model, something like :<br>
<span style="font-family:monospace,monospace"><br>
pqServerManagerModel* model =<br>
pqApplicationCore::instance()->getServerManagerModel();<br>
pqServer* server = pqApplicationCore::instance()->getActiveServer();<br>
QList<pqPipelineSource*> sources = model->findItems<pqPipelineSource*>(server);<br>
int numberOfPipelineSources = sources.size();<br>
</span></div>
<div><span style="font-family:monospace,monospace"> mymenu->setEnable(numberOfPipelineSources != 0);</span><br>
<br>
</div>
<div>Best,<br>
</div>
<div>Joachim<br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div>
<div dir="ltr"><b>Joachim Pouderoux</b><br>
<blockquote style="border-left:rgb(204,204,204) 1px solid; margin:0px 0px 0px 0.8ex; padding-left:1ex">
<font size="1"><i>PhD, Technical Expert</i></font><br>
<b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br>
</blockquote>
</div>
</div>
</div>
<br>
<div class="gmail_quote">2015-12-08 10:42 GMT+01:00 Prashant V <span dir="ltr"><<a href="mailto:prashant.v@quest-global.com" target="_blank">prashant.v@quest-global.com</a>></span>:<br>
<blockquote class="gmail_quote" style="border-left:#ccc 1px solid; margin:0px 0px 0px 0.8ex; padding-left:1ex">
<div>
<div style="font-family:Tahoma; direction:ltr; color:#000000; font-size:10pt">
<p>Hello,</p>
<p> </p>
<p>I have added a menu item in Paraview GUI. I want to disable this menu item when user deletes all objects from pipeline browser. What I want to achieve is quite similar to enabling/disabling of Filter menu. Can anybody please guide, how this can be done?
Thanks.</p>
<p> </p>
<p>Regards,</p>
<p>Prashant </p>
</div>
---Disclaimer------------------------------ This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message.
Opinions, conclusions and other information in this transmission that do not relate to the official business of QuEST Global and/or its subsidiaries, shall be understood as neither given nor endorsed by it. Any statements made herein that are tantamount to
contractual obligations, promises, claims or commitments shall not be binding on the Company unless followed by written confirmation by an authorized signatory of the Company. -----------------------------------------------------------------------------------
</div>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" target="_blank">
http://markmail.org/search/?q=Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div class="h5">---Disclaimer------------------------------ This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the
original message. Opinions, conclusions and other information in this transmission that do not relate to the official business of QuEST Global and/or its subsidiaries, shall be understood as neither given nor endorsed by it. Any statements made herein that
are tantamount to contractual obligations, promises, claims or commitments shall not be binding on the Company unless followed by written confirmation by an authorized signatory of the Company. -----------------------------------------------------------------------------------
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
---Disclaimer------------------------------ This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message.
Opinions, conclusions and other information in this transmission that do not relate to the official business of QuEST Global and/or its subsidiaries, shall be understood as neither given nor endorsed by it. Any statements made herein that are tantamount to
contractual obligations, promises, claims or commitments shall not be binding on the Company unless followed by written confirmation by an authorized signatory of the Company. -----------------------------------------------------------------------------------
</div>
</div>
</div>
---Disclaimer------------------------------ This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message.
Opinions, conclusions and other information in this transmission that do not relate to the official business of QuEST Global and/or its subsidiaries, shall be understood as neither given nor endorsed by it. Any statements made herein that are tantamount to
contractual obligations, promises, claims or commitments shall not be binding on the Company unless followed by written confirmation by an authorized signatory of the Company. -----------------------------------------------------------------------------------
</div>
</div>
</div>
---Disclaimer------------------------------ This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message.
Opinions, conclusions and other information in this transmission that do not relate to the official business of QuEST Global and/or its subsidiaries, shall be understood as neither given nor endorsed by it. Any statements made herein that are tantamount to
contractual obligations, promises, claims or commitments shall not be binding on the Company unless followed by written confirmation by an authorized signatory of the Company. -----------------------------------------------------------------------------------
</body>
</html>