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. How Do i remove down arrow when setting menu on pushbutton?
Forum Update on Monday, May 27th 2025

How Do i remove down arrow when setting menu on pushbutton?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 2.8k 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.
  • M Offline
    M Offline
    mit_cruze
    wrote on 10 Nov 2016, 06:56 last edited by
    #1
    QMenu *menu=new QMenu();
        QAction *act1=new QAction();
        QAction *act2=new QAction();
        act1->setText("1");
        act2->setText("2");
        menu->addAction(act1);
        menu->addAction(act2);
       
        ui->pushButton->setAutoFillBackground(1);
        ui->pushButton->setIcon(QIcon("/home/einfochips/BEL_VMS_CLIENT/images/user.png"));
        ui->pushButton->setMenu(menu);
    

    I get down arrow in pushbutton. I want to remove that arrow HOw Can I ?
    I s that another method ?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Devopia53
      wrote on 10 Nov 2016, 07:50 last edited by
      #2

      Re: How Do i remove down arrow when setting menu on pushbutton?

      Hi.

      Just something like this:

      pushButton->setStyleSheet("::menu-indicator{ image: none; }");
      

      But you will need to adjust the alignment for button text.

      1 Reply Last reply
      6
      • M Offline
        M Offline
        mit_cruze
        wrote on 10 Nov 2016, 08:06 last edited by
        #3

        Thanks It worked!!

        1 Reply Last reply
        1

        1/3

        10 Nov 2016, 06:56

        • Login

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