[Interest] Persistent Editor keep focus when opening new window

Joshua Grauman jnfo-c at grauman.com
Sun Feb 24 18:27:20 CET 2013


Great idea. Thanks so much for the help.

Josh

> On 02/23/2013 07:43 PM, Joshua Grauman wrote:
>> Bill,
>>
>> Thanks so much, that looked like it should do the trick. But
>> onfortunately, when my new window pops up (even with those flags, I tried
>> both Qt::Dialog and Qt::Popup), the delegate still looses focus and thus
>> is deleted... Thanks so much though. If it matters, I'm using Qt5.0.1 on
>> Linux.
>>
>
> Me, 4.7.1 on Linux.
>
> ...and I verified the solution I posted was what I
> had to do to solve the problem in my case.
>
>      I reversed the Qt::Dialog/Qt::Popup flags and the
>      problem re-emerged; The original editor window closed
>      when I opened the secondary window.
>
> Perhaps you could override ::event on the primary window
> and block the event which is telling it to close?
>
> Bill
>
>> Josh
>>
>>> On 02/23/2013 04:40 PM, Joshua Grauman wrote:
>>>> Hello all,
>>>>
>>>> I have a QTableWidget that uses a custom delegate. When I double click on
>>>> a cell, the editor comes up fine. But then I want to be able to pull up a
>>>> helper widget/window to enter data into the persistent editor. The problem
>>>> is, when I show the new widget/window, the QTableWidget looses focus and
>>>> the persistent editor is destroyed. Does anyone have any idea of how to
>>>> bring up a new widget/window while still editing the persistent editor
>>>> delegate? Thanks.
>>>>
>>>
>>> Josh:
>>>
>>> I had the same problem, but don't remember which, of the hundreds
>>> of lines of code I have had to write to trick Qt into giving me the
>>> behavior I want, was added to fix this problem.
>>>
>>> I think it was this (on the custom editor window) :
>>>
>>>     Qt::WindowFlags flags = windowFlags();
>>>     flags |= Qt::Dialog;
>>>     // flags |= Qt::Popup;
>>>     setWindowFlags(flags);
>>>     setWindowModality(Qt::ApplicationModal);
>>>
>>> Bill
>>>
>>>> Josh
>>>> _______________________________________________
>>>> Interest mailing list
>>>> Interest at qt-project.org
>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>>
>>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list