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 Updated to NodeBB v4.3 + New Features

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.
  • mit_cruzeM Offline
    mit_cruzeM Offline
    mit_cruze
    wrote on 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 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
      • mit_cruzeM Offline
        mit_cruzeM Offline
        mit_cruze
        wrote on last edited by
        #3

        Thanks It worked!!

        1 Reply Last reply
        1

        • Login

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