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 to hide arrow of setMenu ?

How to hide arrow of setMenu ?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 6.9k 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.
  • S Offline
    S Offline
    sonichy
    wrote on 11 Aug 2017, 00:59 last edited by sonichy 8 Nov 2017, 13:07
    #1

    alt text
    QMenu *menu=new QMenu;
    open=new QAction("打开本地网页",menu);
    about=new QAction("关于",menu);
    menu->addAction(open);
    menu->addAction(about);
    ui->pushButtonMenu->setMenu(menu);

    https://github.com/sonichy

    J 1 Reply Last reply 11 Aug 2017, 01:13
    0
    • S sonichy
      11 Aug 2017, 00:59

      alt text
      QMenu *menu=new QMenu;
      open=new QAction("打开本地网页",menu);
      about=new QAction("关于",menu);
      menu->addAction(open);
      menu->addAction(about);
      ui->pushButtonMenu->setMenu(menu);

      J Offline
      J Offline
      joeQ
      wrote on 11 Aug 2017, 01:13 last edited by joeQ 8 Nov 2017, 01:59
      #2

      @sonichy Hi, friend, welcome.

      did you use the QToolButton::setMenu or QPushButton::setMenu ?

      If you used QPushButton::setMenu. you can try below style code snippet. or you can search qt key words Qt Style Sheets Reference to read QToolButton or QPushButton, and Customizing the QPushButton's Menu Indicator Sub-Control

      QPushButton::menu-indicator {
            image: url(myindicator.png);
            subcontrol-position: right center;
            subcontrol-origin: padding;
            left: -2px;
        }
      

      Try to modify it , maybe help you.

      If you used QToolButton, They has the same ways. Just to read Qt Help manual.

      Reference

      Qt Style Sheets Reference
      Customizing the QPushButton's Menu Indicator Sub-Control
      Customizing QToolButton

      Just do it!

      S 1 Reply Last reply 12 Aug 2017, 03:19
      2
      • J joeQ
        11 Aug 2017, 01:13

        @sonichy Hi, friend, welcome.

        did you use the QToolButton::setMenu or QPushButton::setMenu ?

        If you used QPushButton::setMenu. you can try below style code snippet. or you can search qt key words Qt Style Sheets Reference to read QToolButton or QPushButton, and Customizing the QPushButton's Menu Indicator Sub-Control

        QPushButton::menu-indicator {
              image: url(myindicator.png);
              subcontrol-position: right center;
              subcontrol-origin: padding;
              left: -2px;
          }
        

        Try to modify it , maybe help you.

        If you used QToolButton, They has the same ways. Just to read Qt Help manual.

        Reference

        Qt Style Sheets Reference
        Customizing the QPushButton's Menu Indicator Sub-Control
        Customizing QToolButton

        S Offline
        S Offline
        sonichy
        wrote on 12 Aug 2017, 03:19 last edited by
        #3

        @joeQ
        QPushButton::menu-indicator{width:0px;}
        Solve the problem !

        https://github.com/sonichy

        1 Reply Last reply
        0

        1/3

        11 Aug 2017, 00:59

        • 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