Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Don't want small triangle in QToolButton::setMenu(QMenu *)

    General and Desktop
    2
    2
    1290
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      azyx12 last edited by

      Hi,
      The following is my code:
      //////////////////////////////////
      QMenu *menu = new QMenu();
      QAction *testAction = new QAction("test menu item", this);
      menu->addAction(testAction);

      toolButton->setMenu(menu);
      toolButton->setPopupMode(QToolButton::InstantPopup);
      /////////////////////////////////////

      I don't like on the right bottom of the tool button, there is a small triangle there.
      Is there any way that I can get rid of this small triangle, i.e., the tool button looks the same as normal ones, but when you click on it, it has a pop-up menu.

      Any help is appreciated.

      Chao

      1 Reply Last reply Reply Quote 0
      • C
        ChrisW67 last edited by

        You can style it using the ::menu-indicator subcontrol in a style sheet.

        See the linked example under QToolButton and also QPushButton
        http://qt-project.org/doc/qt-5.0/qtwidgets/stylesheet-reference.html

        1 Reply Last reply Reply Quote 0
        • First post
          Last post