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. Can't hide cursor on QTextBrowser
Forum Updated to NodeBB v4.3 + New Features

Can't hide cursor on QTextBrowser

Scheduled Pinned Locked Moved General and Desktop
cursorqtextbrowserpython
3 Posts 2 Posters 2.4k Views 2 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.
  • J Offline
    J Offline
    JMorlet
    wrote on 27 May 2015, 14:59 last edited by JMorlet
    #1

    I've get the same problem in python and c++. I can't hide cursor hover a QTextBrowser. Here a simple python example :

    import sys
    
    from PyQt5.QtWidgets import QApplication, QVBoxLayout, QHBoxLayout, QTextBrowser, QPushButton, QWidget
    from PyQt5.Qt import QSpacerItem, QSizePolicy, QUrl
    from PyQt5.QtCore import Qt
    
    
    class Test(QWidget):
        
        def __init__(self):
            super().__init__()
            self.initUi()
            
        
        def initUi(self):
            v = QVBoxLayout()
            tb = QTextBrowser()
            v.addWidget(tb)
            h = QHBoxLayout()
            btn = QPushButton("close")
            btn.clicked.connect(sys.exit)
            h.addSpacerItem(QSpacerItem(10, 10, QSizePolicy.MinimumExpanding, QSizePolicy.Minimum))
            h.addWidget(btn)
            v.addLayout(h)
            self.setLayout(v) 
            
    
    if __name__ == '__main__':
        
        app = QApplication(sys.argv)
    
        w = Test()
        w.show()
        w.setCursor(Qt.BlankCursor)
        
        sys.exit(app.exec_())
    

    What's wrong ? (i try to force a setCursor(Qt.BlankCursor) on the textBrowser with the same result.)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 27 May 2015, 22:32 last edited by
      #2

      Hi and welcome to devnet,

      You have to set in on your QTextEdit's view port

      tb.viewPort().setCursor(Qt.BlankCursor) if my PyQtFoo is not to rusty

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

      J 1 Reply Last reply 28 May 2015, 07:24
      0
      • S SGaist
        27 May 2015, 22:32

        Hi and welcome to devnet,

        You have to set in on your QTextEdit's view port

        tb.viewPort().setCursor(Qt.BlankCursor) if my PyQtFoo is not to rusty

        J Offline
        J Offline
        JMorlet
        wrote on 28 May 2015, 07:24 last edited by
        #3

        @SGaist Thank you !! It's ok now. I missed viewport...

        1 Reply Last reply
        0

        2/3

        27 May 2015, 22:32

        • Login

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