Important: Please read the Qt Code of Conduct -

Show Icon and Text for QToolButton with defaultAction

  • I have QToolButton with ToolButtonStyle ToolButtontTextBesideIcon, that has a default action with setDefaultAction(). My QAction has icon (using setIcon()) and text using (setText()), but It show's ony the icon. So how can I show both icon and text ?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt are out using ?
    On what platform ?
    With which compiler ?
    Can you provide a minimal sample example so that other people can test it ?

  • Moderators

    Works fine for me.... Example code below:

        auto toolButton = new QToolButton(toolBar);
        auto act = new QAction();
        act->setText("some text");

Log in to reply