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

Widget MouseHoverEvent Disable

Scheduled Pinned Locked Moved Unsolved General and Desktop
29 Posts 3 Posters 4.5k 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
    alonewolfsemmmy
    wrote on 30 Dec 2020, 10:59 last edited by
    #10

    Okay How Can I you said please help me for example code:
    ui->pusbutton ? thenk you

    J 1 Reply Last reply 30 Dec 2020, 11:03
    0
    • A alonewolfsemmmy
      30 Dec 2020, 10:59

      Okay How Can I you said please help me for example code:
      ui->pusbutton ? thenk you

      J Offline
      J Offline
      JonB
      wrote on 30 Dec 2020, 11:03 last edited by
      #11

      @alonewolfsemmmy
      Example code for what? And we expect you to write the code and ask questions, not just ask others to write it for you.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alonewolfsemmmy
        wrote on 30 Dec 2020, 11:09 last edited by
        #12

        No button to disabled so remove the hovering effect How Can I
        I don't know how to turn off the button hovering effect
        Please help me My friend I need your help

        J 1 Reply Last reply 30 Dec 2020, 11:13
        0
        • A alonewolfsemmmy
          30 Dec 2020, 11:09

          No button to disabled so remove the hovering effect How Can I
          I don't know how to turn off the button hovering effect
          Please help me My friend I need your help

          J Offline
          J Offline
          JonB
          wrote on 30 Dec 2020, 11:13 last edited by
          #13

          @alonewolfsemmmy
          No, you need to do some reading of the documentation, try some things, and write questions which people can understand, even if English is not your native language.

          1 Reply Last reply
          2
          • M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 30 Dec 2020, 11:15 last edited by
            #14

            Hi
            This function
            https://doc.qt.io/qt-5/qwidget.html#enabled-prop

            1 Reply Last reply
            1
            • A Offline
              A Offline
              alonewolfsemmmy
              wrote on 30 Dec 2020, 11:20 last edited by
              #15

              @mrjj please I didn't you said Please tell me example thank you my friend

              M 1 Reply Last reply 30 Dec 2020, 11:22
              0
              • A alonewolfsemmmy
                30 Dec 2020, 11:20

                @mrjj please I didn't you said Please tell me example thank you my friend

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 30 Dec 2020, 11:22 last edited by
                #16

                hi
                Its very helpful to be able to use the docs.
                anyway, try
                ui->buttoname->setEnabled(false);

                the button should show a bit grey and no hover effect.

                1 Reply Last reply
                1
                • A Offline
                  A Offline
                  alonewolfsemmmy
                  wrote on 30 Dec 2020, 11:30 last edited by
                  #17

                  @mrjj
                  You said didn't work I want to widget on mousehover disable effect widget
                  All Right Have you advice CRC-32/MPEG-2 calculate function because When I move on widget form Crc 32 calculate error What Can I fixed

                  M 1 Reply Last reply 30 Dec 2020, 11:38
                  0
                  • A alonewolfsemmmy
                    30 Dec 2020, 11:30

                    @mrjj
                    You said didn't work I want to widget on mousehover disable effect widget
                    All Right Have you advice CRC-32/MPEG-2 calculate function because When I move on widget form Crc 32 calculate error What Can I fixed

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 30 Dec 2020, 11:38 last edited by
                    #18

                    @alonewolfsemmmy
                    Hi
                    That is hard to guess on as why would a hover eefct break the CRC calculation in first place ?

                    Did you watch your cpu usage ? is it at 100% ?

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      alonewolfsemmmy
                      wrote on 30 Dec 2020, 11:47 last edited by
                      #19

                      Okay my brother I will try you said cpu usage

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        alonewolfsemmmy
                        wrote on 30 Dec 2020, 11:58 last edited by
                        #20

                        cpuUsage.JPG

                        @mrjj my brother
                        SerialPort 5 megabit buadrate cpu Usage

                        M 1 Reply Last reply 30 Dec 2020, 12:00
                        0
                        • A alonewolfsemmmy
                          30 Dec 2020, 11:58

                          cpuUsage.JPG

                          @mrjj my brother
                          SerialPort 5 megabit buadrate cpu Usage

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 30 Dec 2020, 12:00 last edited by
                          #21

                          @alonewolfsemmmy

                          Ok so its not using 100% cpu so its not due to the hover disturbs it.

                          Does it happen every time if you hover something?

                          Do you use StyleSheets in your app ?

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            alonewolfsemmmy
                            wrote on 30 Dec 2020, 12:10 last edited by
                            #22

                            @mrjj said in yes it happen every time if you hover something

                            I dont use stylesheets in my App

                            M 1 Reply Last reply 30 Dec 2020, 12:15
                            0
                            • A alonewolfsemmmy
                              30 Dec 2020, 12:10

                              @mrjj said in yes it happen every time if you hover something

                              I dont use stylesheets in my App

                              M Offline
                              M Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on 30 Dec 2020, 12:15 last edited by
                              #23

                              @alonewolfsemmmy

                              Ok so its not due to the stylesheet which can be heavy.

                              And what happened when you disabled the button ?
                              It went grey looking and no hover effect ?

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                alonewolfsemmmy
                                wrote on 30 Dec 2020, 12:21 last edited by
                                #24

                                @mrj MyBrother

                                When I disabled the button nothing has changed

                                M 1 Reply Last reply 30 Dec 2020, 13:47
                                0
                                • A alonewolfsemmmy
                                  30 Dec 2020, 12:21

                                  @mrj MyBrother

                                  When I disabled the button nothing has changed

                                  M Offline
                                  M Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on 30 Dec 2020, 13:47 last edited by
                                  #25

                                  @alonewolfsemmmy
                                  Not even the button ?
                                  It should be disabled unless something in code turns it on again.

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    alonewolfsemmmy
                                    wrote on 30 Dec 2020, 13:55 last edited by
                                    #26

                                    Okay My brother So how can I disable the mouse thank you

                                    M 1 Reply Last reply 30 Dec 2020, 14:01
                                    0
                                    • A alonewolfsemmmy
                                      30 Dec 2020, 13:55

                                      Okay My brother So how can I disable the mouse thank you

                                      M Offline
                                      M Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on 30 Dec 2020, 14:01 last edited by
                                      #27

                                      @alonewolfsemmmy ยจ

                                      Hi
                                      you cannot disable the mouse as its belongs to the OS.

                                      However you can hide it for your app

                                      QCursor cursor(Qt::BlankCursor);
                                      QApplication::setOverrideCursor(cursor);
                                      QApplication::changeOverrideCursor(cursor);

                                      1 Reply Last reply
                                      1
                                      • A Offline
                                        A Offline
                                        alonewolfsemmmy
                                        wrote on 30 Dec 2020, 14:19 last edited by
                                        #28

                                        My Brother I want to hide mouse event Please help me thank you

                                        M 1 Reply Last reply 30 Dec 2020, 14:23
                                        0
                                        • A alonewolfsemmmy
                                          30 Dec 2020, 14:19

                                          My Brother I want to hide mouse event Please help me thank you

                                          M Offline
                                          M Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on 30 Dec 2020, 14:23 last edited by
                                          #29

                                          @alonewolfsemmmy
                                          Well you can take an event using an event filter
                                          https://doc.qt.io/qt-5/eventsandfilters.html

                                          #include <QObject>
                                          #include <QMouseEvent>
                                          #include <QDebug>
                                          #include <QCursor>
                                          
                                          class myEventFilter: public QObject {
                                            Q_OBJECT
                                          public:
                                            myEventFilter() {}
                                            ~myEventFilter() {
                                            }
                                          protected:
                                            bool eventFilter(QObject* object, QEvent* event) {
                                              if(event->type() == QEvent::MouseMove) { // or what ever event you want
                                                return true;
                                              } else
                                                return false;
                                            }
                                          };
                                          
                                          and to use it
                                          ui->thebutton->installEventFilter(new myEventFilter()); 
                                          
                                          1 Reply Last reply
                                          0

                                          19/29

                                          30 Dec 2020, 11:47

                                          • Login

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