[Paraview-developers] Fwd: Need help on pqObjectPanel and accept slot
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Tue Dec 13 12:21:49 EST 2011
If you remove the line "this->setProperty("MyCommandList",
editor()->toPlainText());" does it still get called twice? If not what
is this->setProperty() doing? It may be marking the panel dirty again
and the hence the slot if being called twice.
Try to fix your code so that setProperty() doesn't call setModified().
Utkarsh
On Tue, Dec 13, 2011 at 8:57 AM, Pandu tech <pandu4tech at gmail.com> wrote:
>
>
> yes I am calling.. this is my code of overloaded accept slot:
>
> void customPanel::accept()
> {
> this->setProperty("MyCommandList", editor()->toPlainText());
> pqObjectPanel::accept();
> }
>
> and customPanel is derived public from pqObjectPanel.
>
> Regards,
> Pandu.
>
>
>
> On Mon, Dec 12, 2011 at 4:46 PM, Utkarsh Ayachit
> <utkarsh.ayachit at kitware.com> wrote:
>>
>> Are you calling this->Superclass::accept() in your overload of the
>> accept() slot?
>>
>> Utkarsh
>>
>> On Mon, Dec 12, 2011 at 11:32 AM, Pandu tech <pandu4tech at gmail.com> wrote:
>> > Hi All,
>> >
>> > In Paraview, my class inherited from pqObjectPanel and I reimplemented
>> > accept slot and it is being called twice.
>> >
>> > setModified is called when text is changed that updates the Apply button
>> > but
>> > clicking the apply button calls the panel accept function twice
>> >
>> > code: file : pqObjectInspectorWidget.cxx
>> >
>> > if (this->ShowOnAccept && modified_state == pqProxy::UNINITIALIZED)
>> > {
>> > proxies_to_show.insert(refProxy);
>> > }
>> > if (modified_state != pqProxy::UNMODIFIED)
>> > {
>> > panel->accept(); // PANEL FIRST UPDATED HERE
>> > }
>> > }
>> >
>> > if (this->CurrentPanel)
>> > {
>> > pqProxy* refProxy = this->CurrentPanel->referenceProxy();
>> > int modified_state = refProxy->modifiedState();
>> > if (this->ShowOnAccept && modified_state == pqProxy::UNINITIALIZED)
>> > {
>> > proxies_to_show.insert(refProxy);
>> > }
>> > this->CurrentPanel->accept(); // AND THEN AGAIN HERE
>> > }
>> >
>> > Need ur suggestions and help in fixing this..
>> >
>> > Regards..
>> >
>> > _______________________________________________
>> > Paraview-developers mailing list
>> > Paraview-developers at paraview.org
>> > http://public.kitware.com/mailman/listinfo/paraview-developers
>> >
>
>
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
More information about the Paraview-developers
mailing list