Skip to content
Advertisement

Tag: qt4

Is it possible to paint a QGraphicsItem inside the paint() method?

I’m creating a subclass of QGraphicsItem, and this subclass has different places that the user can click. My idea is for each component clicked to create a subclass of QGraphicsItem with mousePressEvent replaced. The problem is how can I merge this component into a subclass of QGraphicItem. Here’s the code I’m trying, but I do not know how to show

QFileDialog to open multiple files

I am trying to show a dialog box to open multiple files but seems like it is not working. The following is a function defined in my Class: I thought that the keyword was QFileDialog.ExistingFiles. What am I doing wrong here? Answer You need to use getOpenFileNamesAndFilter instead of getOpenFileNameAndFilter (you’re missing the s).

How to disable selection highlighting in a QTableWidget

I have a QTableWidget with a disabled setSelectionMode (QTableWidget::NoSelection) and the QTableWidgetItems I fill in don’t have the Qt::ItemIsEditable flag. Nevertheless, a cell that has been clicked gets some kind of cursor (the black line at the bottom in my case): How can I disable this “cursor”? Answer Does this help? To elaborate a bit: the appearance of the items

Advertisement