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. 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. _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 = for i in range ( 5 )] def rowCount ( self, parent ): return len ( self. QAbstractTableModel ): def _init_ ( self ): QtCore. From PySide2 import QtGui, QtCore, QtWidgets import hou class Model ( QtCore. I want to make a menu button, like the application menu of ubuntu, can pop up a drop-down box when clicked, I chose to use the mainwindow to achieve, but my current menuba display on the top layer is ugly, how can I prevent it from showing?. How to make the child form not inherit the background of the parent form, the same, Or in the EditStyle Sheet, you need to enter the following code: We know that the child form will inherit the properties of the parent form, that is, the background of the parent form will also be present in the child form. So how do we do in the widget, we place a frame in the widget, and then set the background of the frame through the stylesheet, and all the components in the back form are placed in this frame. You will find that in the same way, the background has not changed, but only the background image of its subform has changed. If it is in mainwindow and dialog, right-click change stylesheet and select background-image or border-image in addresource, and then select the image in the resource file (the former is displayed in pixels) Picture, the latter can automatically zoom the picture according to the window size), as shown below:īut not in widgets. There are still some things to pay attention to when using stylesheet to set the background image. Use stylesheet to set the background of the form The development environment used by the author is: qt creator 201005, qt4.7.ġ. I am In the latter way, several common usages are introduced below. In QT Create, when setting background, color, transparency and other styles for buttons or windows and other parts, you need to use stylesheet, which can be written directly in the code, or you can set it by right-clicking the change stylesheet in the UI designer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |