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. setCursor(Qt::BlankCursor) not working
Forum Updated to NodeBB v4.3 + New Features

setCursor(Qt::BlankCursor) not working

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 677 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.
  • C Offline
    C Offline
    Cesar Olesk
    wrote on 18 Apr 2024, 11:55 last edited by
    #1

    I'm using raspberry Pi 4, last bullseye implementation, Qt 6.7.0, QtCreator 13.0.0.

    I need hide the cursor inside my QDialog window. I tried setCursor(Qt::blankCursor), but nothing happens.
    Very intersting is when I use setCursor(Qt::waintCursor), it works very well.

    What must be happen?
    Thanks

    1 Reply Last reply
    0
    • C Cesar Olesk
      19 Apr 2024, 11:52

      @SGaist My project is a 3D printing light cure resin controller. In one screen it shows the menu, and on the other it shows a Frameless QDialog with the "layer" of projected light over the resin. So, it is interesting not have mouse pointer on it, to avoid "printing" an icon over the resin...
      The project is too much big to put all here. I will create a QDialog example and will post here.

      Sorry by delay in reply messages, it is very frustrating wait 10minutes to may send another message.

      C Offline
      C Offline
      Cesar Olesk
      wrote on 24 Apr 2024, 11:31 last edited by
      #4

      I saw X11 have some standard cursos missing on lib. So I create a invisible cursor and set it on my dialog and its works very well.

      // 1 + 1 = transparent
      // 0 + 0 = black
      // 1 + 0 = white
      // 0 + 1 = invert (on windows)

      QImage imageBit(32,32, QImage::Format_Mono);
      imageBit.fill(Qt::color0);
      QImage imageMsk(32,32, QImage::Format_Mono);
      imageMsk.fill(Qt::color1);
      QBitmap bitmapBit = QBitmap::fromImage(imageBit);
      QBitmap bitmapMsk = QBitmap::fromImage(imageMsk);
      QCursor cursor = QCursor(bitmapBit, bitmapMsk, 47, 0);
      
      this->setCursor(cursor);
      

      I don't know if this problem is on this distribution of rasberry bullseye 64bits operational system only. But anyway, it is working now

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 18 Apr 2024, 19:20 last edited by
        #2

        Hi,

        You should provide a minimal compilable example that shows what happens.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply 19 Apr 2024, 11:52
        0
        • S SGaist
          18 Apr 2024, 19:20

          Hi,

          You should provide a minimal compilable example that shows what happens.

          C Offline
          C Offline
          Cesar Olesk
          wrote on 19 Apr 2024, 11:52 last edited by
          #3

          @SGaist My project is a 3D printing light cure resin controller. In one screen it shows the menu, and on the other it shows a Frameless QDialog with the "layer" of projected light over the resin. So, it is interesting not have mouse pointer on it, to avoid "printing" an icon over the resin...
          The project is too much big to put all here. I will create a QDialog example and will post here.

          Sorry by delay in reply messages, it is very frustrating wait 10minutes to may send another message.

          C 1 Reply Last reply 24 Apr 2024, 11:31
          0
          • C Cesar Olesk
            19 Apr 2024, 11:52

            @SGaist My project is a 3D printing light cure resin controller. In one screen it shows the menu, and on the other it shows a Frameless QDialog with the "layer" of projected light over the resin. So, it is interesting not have mouse pointer on it, to avoid "printing" an icon over the resin...
            The project is too much big to put all here. I will create a QDialog example and will post here.

            Sorry by delay in reply messages, it is very frustrating wait 10minutes to may send another message.

            C Offline
            C Offline
            Cesar Olesk
            wrote on 24 Apr 2024, 11:31 last edited by
            #4

            I saw X11 have some standard cursos missing on lib. So I create a invisible cursor and set it on my dialog and its works very well.

            // 1 + 1 = transparent
            // 0 + 0 = black
            // 1 + 0 = white
            // 0 + 1 = invert (on windows)

            QImage imageBit(32,32, QImage::Format_Mono);
            imageBit.fill(Qt::color0);
            QImage imageMsk(32,32, QImage::Format_Mono);
            imageMsk.fill(Qt::color1);
            QBitmap bitmapBit = QBitmap::fromImage(imageBit);
            QBitmap bitmapMsk = QBitmap::fromImage(imageMsk);
            QCursor cursor = QCursor(bitmapBit, bitmapMsk, 47, 0);
            
            this->setCursor(cursor);
            

            I don't know if this problem is on this distribution of rasberry bullseye 64bits operational system only. But anyway, it is working now

            1 Reply Last reply
            1
            • C Cesar Olesk has marked this topic as solved on 24 Apr 2024, 11:31

            1/4

            18 Apr 2024, 11:55

            • Login

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