[Qt-interest] Connecting ToolButtons directly to actions in qt4 designer

Kishore Jonnalagadda kitts.mailinglists at gmail.com
Mon Oct 10 20:12:25 CEST 2011


On Sunday 09 Oct 2011 2:39:01 PM J-P Nurmi wrote:
> On Thu, Oct 6, 2011 at 11:34 AM, Nathan Hüsken <nathan.huesken at posteo.de> 
wrote:
> > Hi,
> > 
> > When I have a toolbar, I can add actions to it in qt4 designer.
> > This creates buttons, which trigger the actions and which also are
> > enabled or disabled depending on the actions being enabled or disabled.
> > 
> > Can I archive the same with a normal toolbutton not placed in a toolbar?
> > Sure, I can connect the trigger() to the action, but can I also make it
> > such that the button is automatic enabled and disabled depending on the
> > action being enabled or disabled?
> > 
> > That would be very convenient.
> 
> See QToolButton::setDefaultAction().

I think he was talking of doing that within designer which is think is sadly 
not possible.

There are limitations in designer. Somethings are not possible (my favorite is 
of settings icons from standardPixmap()) and somethings are less efficient. Like 
for example, QMainWindow always creates a central widget even if i dont want 
it to and if i want to have a qtablewidget as one of the pages in a 
QTabWidget, it always creates QWidget as the page widget in which it then 
layouts the table instead of using the table directly as the page widget.

Some of those are just the price to pay for convenience. :)
-- 
Cheers!
Kishore



More information about the Qt-interest-old mailing list