QListWidget - inconsistency across operating systems?
In native windows API when you select an item from a listbox window the width of the selection highlighting is as wide as the listbox.
In a QListWidget, when you select an item the selection highlighting is only as wide as the text.
Is there anyway I can change the style of a QListWidget to make it look more like a windows listbox?
Here's exactly what I'm talking about
1 Attachment(s)
Inconsistancy across operating systems?
I have a favor to ask of the kind people at this forum. Could you copy, paste and compile the following code and give a screenshot of the result (with a list item selected).
I'm asking because jpn got this when he compiled the below program. My screenshot and his screenshot have noticeable differences. The selection for his screenshot stretches the length of the widget, but only stretchs the length of the text for mine. My best guess is that the reason for this is that one program was compiled on linux and the other on windows.
The code:
Code:
#include <QtGui>
int main(int argc, char** argv) {
Sidebox->setWrapping(false); // <-- _false_
Sidebox->show();
return app.exec();
}
The screenshot:
Re: Inconsistancy across operating systems?
Note:
I tested this on two different computer both running windows (XP Home edition) and the latest (4.2.2 open source edition) version of Qt.
Here's the screencapture from my other computer.
Re: Inconsistancy across operating systems?
You can omit the wrapping and movement properties as they are by default set to false and static.
Re: Inconsistancy across operating systems?
Try running your application with Plastique style: "app -style plastique"
Re: Inconsistancy across operating systems?
Cleanlooks works as well.
Re: QListWidget - inconsistency across operating systems?
Those looks quite nice. I think I may end up just changing the style of the application if there is no way to get listwidget item selections to span the length of the widget in a windows style.
Re: QListWidget - inconsistency across operating systems?
Quote:
Originally Posted by
scwizard
if there is no way to get listwidget item selections to span the length of the widget in a windows style.
At least there is no inconsistency across operating systems --- just the windows style behave a bit differently (on Linux too).
Have you tried the windowsxp style?
Re: QListWidget - inconsistency across operating systems?
Quote:
Originally Posted by
jacek
just the windows style behave a bit differently (on Linux too).
All motif-like styles (motif, cde, windows) behave that way. You can always make a proxy style to correct(*) that behaviour in a style independent way.
---
(*) - change