How to Get the Children of Tool Bar ?



  • i am trying to get the name of the Tool Button that is in the Tool Bar to connect the Signals

    i have tried this, but it will not give the name of Control Can anyone tell, how to do that

    qDebug() << "My Static Tool Bar accessibleName"<<toolBar->accessibleName()
    qDebug() << "My Static Tool Bar accessibleDescription "<<toolBar->accessibleDescription() ;
    qDebug() << "My Static Tool Bar childAt "<<toolBar->childAt(20,600) ;
    qDebug() << "My Static Tool Bar children" << toolBar->children() ;

    Thanks in Advance.



  • Hi,

    I don't know if there's a way to access internal created ToolButton widgets on the toolbar. Anyway, I suggest to enumerate the actions related to the toolbar, and to connect signals there.

    T.



  • see if this helps:
    @
    QList<QToolButton *> buttonlist
    = myToolBar->findChildren<QToolButton *>();
    QListIterator<QToolButton *> i(buttonlist);
    while (i.hasNext())
    qDebug() << i.next();
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.