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 place cursor at the beginning of a cell of QTableWIdget

How to place cursor at the beginning of a cell of QTableWIdget

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 591 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    How to place cursor at the beginning of a cell of QTableWIdget without changing the cursor contents

    I am using following pyQt code

    def show(self, node = None, index = None, subWindow = None,
    width = None, height = None):
    if width and height:
    self.resize(width, height)
    self.parent.setTitle(self.titleText)
    self.reset(node, index, subWindow)
    self.table.update()
    super(self.class, self).show()
    if width and height:
    self.resize(width, height)
    print#("\n I am here in table widget")
    self.table.selectRow(0)
    #self.table.cellWidget(0,1).setFocusPolicy(0)
    self.table.cellWidget(0,1).setFocus()

    The line self.table.cellWidget(0,1).setFocus() displays cursor but it empties the text in cellWiget .

    My requirement is just set the Focus to cell widget of QtableWidget

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Why do you need a cell widget for ?

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

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Qt Enthusiast
        wrote on last edited by
        #3

        That is legacy code . What is way to do that

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          That's not the answer to my question.

          Again: why is that code using cell widgets ? What for ?

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

          1 Reply Last reply
          0

          • Login

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