[Interest] Can't get menu with QWidgetAction to close after click! (Mac OS 10.6.8, Qt 4.8.3)

Alex Malyushytskyy alexmalvtk at gmail.com
Wed Oct 10 02:29:17 CEST 2012


By the way try to call   QAction->trigger();
in _onPushButton(bool b)

If MAC implementation depends on this signal it definitely should
solve the problem.
By default QWidgetAction does not call it:

"Note that it is up to the widget to activate the action, for example
by reimplementing mouse event handlers and calling
QAction::trigger()."

Alex



On Tue, Oct 9, 2012 at 5:23 PM, Alex Malyushytskyy <alexmalvtk at gmail.com> wrote:
> On Windows, QT 4.7 it works as as expected.
> I guess problem is specific to MAC
>
> Alex
>
>
> On Tue, Oct 9, 2012 at 3:39 PM, Jim Prouty <jim at wavemetrics.com> wrote:
>>
>> On Oct 9, 2012, at 12:31 PM, Stephen Chu wrote:
>>
>>> Are you sure you want a push button or a text entry field in the menu
>>> from the menu bar?
>>>
>>> It's, hmm, very different way of building an UI. Especially on a Mac.
>>>
>>
>> That's only a test program; the real application has a color swatch in the widget that gets clicked.
>>
>> But the issue is the same (and this sample code is simpler): after interacting with the QWidgetAction inserted into a menu, how can I get the menu to go away?
>>
>> Clicking in a normal action (menu item) dismisses the menu after emitting triggered().
>>
>> I'd like the same behavior for my QWidgetAction, but it just sits there like a bump on a log whether it contains a button or a color swatch.
>>
>> --Jim
>>
>> ========================================================================
>>
>> Jim "How does it work?" Prouty
>>
>> Voice: (503) 620-3001, FAX: (503) 620-6754
>> Makers of IGOR Pro, scientific data analysis and graphing for Mac and PC
>> http://www.wavemetrics.com
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list