Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Don't want small triangle in QToolButton::setMenu(QMenu *)
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k Views
  • 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 Offline
    A Offline
    azyx12
    wrote on last edited by
    #1

    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
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved