Qt-interest Archive, March 2007
Re: QListView - selection - whole line?
Message 1 in thread
Hmm, every time I have used the QListView/Widget, the default behavior has been to highlight the whole line... Do you have code you can share so we can see how you are creating and setting the attributes of the widget?
----- Original Message ----
From: Peter Prade <prade@xxxxxxxxxxx>
To: qt-interest@xxxxxxxxxxxxx
Sent: Friday, March 9, 2007 10:43:29 AM
Subject: QListView - selection - whole line?
Hi list,
is there any way to have the selection of a QListView/QListWidget
highlight the whole line instead of just the part that contains text?
i tried setSelectionBehavior(QAbstractItemView::SelectRows);
but this didn't help.
Cheers,
Peter
--
[ signature omitted ]
Message 2 in thread
i used designer to place a listwidget in a fresh Qt application.
i've not changed any of the settings.
i filled it with the following code:
ui.setupUi(this);
QStringList items;
items << "Hello" << "World" << "!" << "";
ui.listWidget->addItems(items);
Worst case are empty items, you don't get any visible selection for those at all.
I'm using qt 4.2.2 on Windows XP.
are you sure you're not talking about table widgets?
Cheers,
Peter
-----Ursprüngliche Nachricht-----
Von: susan@xxxxxxxxxxxx [mailto:susan@xxxxxxxxxxxx]
Gesendet: Freitag, 9. März 2007 17:35
An: qt-interest@xxxxxxxxxxxxx
Betreff: Re: QListView - selection - whole line?
Hmm, every time I have used the QListView/Widget, the default behavior has been to highlight the whole line... Do you have code you can share so we can see how you are creating and setting the attributes of the widget?
----- Original Message ----
From: Peter Prade <prade@xxxxxxxxxxx>
To: qt-interest@xxxxxxxxxxxxx
Sent: Friday, March 9, 2007 10:43:29 AM
Subject: QListView - selection - whole line?
Hi list,
is there any way to have the selection of a QListView/QListWidget
highlight the whole line instead of just the part that contains text?
i tried setSelectionBehavior(QAbstractItemView::SelectRows);
but this didn't help.
Cheers,
Peter
--
[ signature omitted ]