![Another world in conflict game](https://loka.nahovitsyn.com/242.jpg)
![qt dialog background color ui qt dialog background color ui](https://media.geeksforgeeks.org/wp-content/uploads/20201010202419/output.png)
setItemDelegate ( mydelegate ) hbox = QtWidgets. setModel ( tableModel ) mydelegate = MyDelegate ( self ) tableView. _init_ ( self, parent ) tableModel = Model () tableView = QtWidgets. QWidget ): def _init_ ( self, parent = None ): QtWidgets. row (), 75 ) class TableView ( QtWidgets. tableList ) def columnCount ( self, parent ): return 1 def data ( self, index, role ): if ( role = QtCore. tableList = def rowCount ( self, parent ): return len ( self. QAbstractTableModel ): def _init_ ( self ): QtCore. _init_ ( self, parent ) class Model ( QtCore. QItemDelegate ): def _init_ ( self, parent = None ): QtWidgets. Import importlib from PySide2 import QtGui, QtCore, QtWidgets class MyDelegate ( QtWidgets. setLayout ( hbox ) # comment / uncomment this line to see colors self. QColor ( c ))) # Draw the background rectangle painter. blue )) else : # Get the color c = index. State_Selected : # If the item is selected, always draw background blue painter. _init_ ( self, parent ) def paint ( self, painter, option, index ): painter. Thanks again for your helpįrom PySide2 import QtGui, QtCore, QtWidgets import hou # solution here: # class MyDelegate ( QtWidgets.
#Qt dialog background color ui how to#
And yet, it is not aligned the same way, I don't knnow how to get the border/margin/padding value… Anyway, I’ll go with that for now, hoping someone will stumble on this thread and know a better way. For instance, I have to retrieve all display information to have the text drawn correctly.
#Qt dialog background color ui code#
So your idea really help me a lot, thank you very much I am not sure whether this is the best solution though, since this adds some code complexity which is not necessary in Maya (I did not test any other app for the moment). Hi, Thanks for your reply Your solution works fine in the view, but I could not make it work with the model However, while trying to figure it out, I serendipitously found a solution with a QItemDelegate! And digging further, I was helped by those two sources: [ I added the code below. show () In Houdini, with line #34 In Houdini, without line #34 In Maya setLayout ( hbox ) # comment / uncomment this line to see colors # tParent(hou.ui.mainQtWindow(), QtCore.Qt.Window) dialog = TableView () dialog. setModel ( tableModel ) hbox = QtWidgets.
![qt dialog background color ui qt dialog background color ui](https://3.bp.blogspot.com/_gOKMpkNWO64/S35s5dMp2wI/AAAAAAAABoo/ejchjPv7ii8/s320/Carnival+2010+406.b.jpg)
row (), 75 )) class TableView ( QtWidgets. tableList = for i in range ( 5 )] def rowCount ( self, parent ): return len ( self. From PySide2 import QtGui, QtCore, QtWidgets import hou class Model ( QtCore.
![Another world in conflict game](https://loka.nahovitsyn.com/242.jpg)