Removing dotted border without setting NoFocus in Windows PyQt

前端 未结 5 1661
猫巷女王i
猫巷女王i 2021-02-04 02:18

There are a few questions on SO about this, all of which seem to say that the only way to remove the dotted border is to set the focusPolicy on widget/item in question to NoFocu

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 02:39

    Set outline: 0 of the desired object. Refer following example which sets it for a QTableView.

    QTableView
    {
        outline: 0;
    }
    

    Works for QAbstractItemView inherited classes. (QTreeWidget, QTableWidget etc). Surprisingly this CSS property is not mentioned in the QT Documentation. See QT Style Sheet Reference Documenation.

提交回复
热议问题