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. Change trinagle in the menu button
Forum Updated to NodeBB v4.3 + New Features

Change trinagle in the menu button

Scheduled Pinned Locked Moved General and Desktop
20 Posts 6 Posters 9.8k Views 1 Watching
  • 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
    andre
    wrote on last edited by
    #9

    Yeah, sorry, that's what I mend.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BlackJack
      wrote on last edited by
      #10

      Hello
      I have a similar problem.
      You need to replace the standard icon, on the other

      I created a new class inherited from QProxyStyle and redefined method standardIconImplementation, but for some reason I will not have changed...

      @class CustomStyle :
      public QProxyStyle
      {
      Q_OBJECT
      public:
      CustomStyle();

      protected slots:
      QIcon standardIconImplementation(StandardPixmap standardIcon,
      const QStyleOption *option,
      const QWidget *widget) const;
      };
      @
      and the implementation itself
      @QIcon CustomStyle::standardIconImplementation(StandardPixmap standardIcon,
      const QStyleOption *option,
      const QWidget *widget) const
      {
      switch(standardIcon)
      {
      case QStyle::SP_TitleBarMenuButton:
      return QIcon(":/image/circle_middle.png");
      case QStyle::SP_ArrowDown:
      return QIcon(":/image/circle_middle.png");
      case QStyle::SP_CommandLink:
      return QIcon(":/image/circle_middle.png");
      }
      return QProxyStyle::standardIconImplementation(standardIcon, option, widget);

      }
      @

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BlackJack
        wrote on last edited by
        #11

        that no one will help me not? :(

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #12

          Is your method actually called? Are you sure your proxy style is used as the style for the application?

          1 Reply Last reply
          0
          • B Offline
            B Offline
            BlackJack
            wrote on last edited by
            #13

            Yes it is connected and is the default style
            @#include "customstyle.h"
            #include "widget.h"

            int main(int argc, char *argv[])
            {
            QApplication a(argc, argv);

            a.setStyle(new CustomStyle());
            
            Widget w;   w.show();
            
            return a.exec();
            

            }@

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #14

              Are you sure as in: you inserted some debug statement in your QProxyStyle-derived class and you actually get the debug output?

              1 Reply Last reply
              0
              • B Offline
                B Offline
                BlackJack
                wrote on last edited by
                #15

                In the debugger, there is some reason only one event where:

                standardIcon = QStyle:: SP_CommandLink (56)

                and nothing else happens, comes only once in the function

                @QIcon CustomStyle::standardIconImplementation(StandardPixmap standardIcon,
                const QStyleOption *option,
                const QWidget *widget) const@

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  BlackJack
                  wrote on last edited by
                  #16

                  it turns out that what that is processed by rendering elements of the application, but not items that are on the main widget, the widget belongs at the application
                  If any ideas?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andre
                    wrote on last edited by
                    #17

                    I have no idea what you mean by your last question. Sorry. Please try to reformulate.

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      BlackJack
                      wrote on last edited by
                      #18

                      have any idea why the realties do not want to handle the painting elements widgit ?

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        BlackJack
                        wrote on last edited by
                        #19

                        sorry, it's probably my bad english (

                        I will try to reformulate.

                        When run the program in the debugger and do a breakpoint in my overriding function

                        @
                        QIcon CustomStyle::standardIconImplementation(StandardPixmap standardIcon,
                        const QStyleOption *option,
                        const QWidget *widget) const--
                        @

                        function comes in only 2 times though Widgit is all sorts of different elements of the table, buttons, and just from the drop-down lists on PushButton with which the problem's

                        1 Reply Last reply
                        0
                        • B Offline
                          B Offline
                          BlackJack
                          wrote on last edited by
                          #20

                          problem can be solved much more than I ask all thought to remove the triangle can be with the aid of styles

                          @
                          QPushButton:: menu-indicator {
                          image: "";
                          }
                          @

                          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