qlistview

A ListView of checkboxes in PyQt

Hello, I want to display a QListView where each item is a checkbox with some label. The checkboxes should be visible at all times. One way I can think of is using a custom delegate and QAbstractListModel. Are there simpler ways? Can you provide the simplest snippet that does this? Thanks in advance ...

QListView/QListWidget with custom items

I'm writing my first Qt application with PyQt and am having some trouble creating a custom list view. I'd like the list to contain arbitrary widgets (one custom widget in particular). How would I go about this? It seems that the alternative would be to create a table or grid view wrapped in a scrollbar. However, I'd like to be able t...

obtaining text from a QListView

Hey, I have a pointer to a third party QListView object, wich is simply displaying rows of text. What is the best way of getting a hold of that string of text? thanks, Dave ...

Python PyQT4 - Adding an unknown number of QComboBox widgets to QGridLayout

Hi all, I want to retrieve a list of people's names from a queue and, for each person, place a checkbox with their name to a QGridLayout using the addWidget() function. I can successfully place the items in a QListView, but they just write over the top of each other rather than creating a new row. Does anyone have any thoughts on how I ...

Setting focus on QLineEdit while showing the QListView view

In Qt, there is a QCompleter class which provides auto-complete funtionanity. I want to use QListView to finish the same thing. In the following code, When the QListView shows, QLineEdit will lose focus. How could I keep QLineEdit's focus? 1) mdict.h: #include <QtGui/QWidget> class QLineEdit; class QListView; class QModelIndex; class...

How to make item view render rich (html) text in Qt

Suppose my model has items with the following string for Qt::DisplayRole <span>blah-blah <b>some text</b> other blah</span> I want QTreeView (actually, any item view) to render it like a rich text. Instead, item views render it like a pure text by default. How to achieve the desired rendering? Actually, this is a search results mod...

Is there a way to display icons in QListView without text?

Using a QListView, and QStandardItemModel, is it possible to display icons in the list view without displaying the associated text? QStandardItem is defined as so: QStandardItem ( const QIcon & icon, const QString & text ) So it seems to require a text string of some sort - I only want the icon displayed. If I use the following co...

QListView how to add column ?

How can I add columns to QListView control. Found a method addColumn while seardhing, but in my Qt Creator 1.2.1 based on Qt 4.5.2(32 bit) QListView doesn't have such method at all !!! So how would I add columns ? Say I have 3 columns then what is the code to add a row ? ...

Python Qlistview output dir

Hi all i wish make little gui with pyqt4 that show the output of "dir c:\windows\" line by line I'm looking for QlistView but i don't understand how do it. Can anyone help me? ...

Qt QListView - context menus?

I'm trying to add a context (right click) menu to a Qt QListView. I see in Qt 3.3 there is "contextMenuRequested" (which I could use) - http://doc.trolltech.com/3.3/qlistview.html#contextMenuRequested. However, I can't see such a method in Qt4. Does anyone know how to add a context menu to a QListView? ...

How to set QListView Opacity ,setWindowOpacity dosn't work

Hi im trying to set opacity to QListView , that sits on QDialog i mange to set the QDialog transperant with setting the :Qt::WA_TranslucentBackground = true but the QList doesn't become transparent with i set the setWindowOpacity to 1 or 0 ...

clicked() signal for QListView in PyQt4

I have a working QListView, but from the documentation, I can't figure out how to get a signal to fire with the index of the newly selected item. Any ideas? ...

How to make item view render rich (html) text in PyQt?

I'm trying to translate code from this thread in python: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * __data__ = [ "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", "Ut enim ad minim veniam, quis nostrud exercitation ull...

Remove a list of selected items in the QListView

Hi. How can I remove a list of selected items in the QListView in QT 4.6. Something like this does not work, the iterator becomes invalid: QModelIndexList indexes = ui.listview_files->selectionModel()->selectedIndexes(); foreach(QModelIndex index, indexes) { model->removeRow(index.row()); } removeRows also not suitable, it...

Qt: How to layout records in a grid? QListView or QGridLayout?

Still learning the fundamental concepts... I want to layout items that come from a database in a grid. Each item will have a custom view with a preview picture, attributes and controls. The grid can change size, i.e. 3, 4, 5 columns (large-small previews). Is this best done by adding (looping through the table) custom widgets to a grid...

QListWidget that resizes instead of scrolls

How do you change the behavior of a QListWidget so that it resizes its height instead of choosing a (seemingly arbitrary) height and adding scrollbars? See screenshot: The QListView's should fill up as much space horizontally as they can (creating as many "columns," if you will.) Then they wrap and make as many rows as necessary to fi...

How do you add items to the QT QListView

I am creating a mysql reading program and I need to use a QListView with colunms and rows, but I can't work out how. ...

Size of element depending on size of the QListView

Hello. I developing a program that draws in elements of the list (QListView). How do I set the size of an element depending on the size of the QListView? I write implementation of the sizeHint in the delegate, but where to get the size of the instance QListView I don't know. ...

How to loop QListView item selection

Hi All, How can I make QListView item selection loop from bottom item to top (by pressing navigation key, down) and from top item to bottom (by pressing navigation key, up)? Is there a flag to be defined or some other way? My listview is in IconMode I wanted the selection to go to next row's 1st item when I've reached the end of a row. ...