Hi
I am new to QT4 and are currently testing how to use the different widgets. I am used to win32 programming and therefore the QListWidget is getting on my nerves. The problem is that when using the windowsxpstyle I only select the item instead of the row when clicking an item. This is not the windowsxp way even though it is using the windowsxp style. I remember from win32 programming that listboxes usually allowed selecting a row and not only the item.
I changed the style to plastique and cleanlooks and then it worked as expected. I tried setting the SelectionBehavior to QAbstractItemView::SelectRows and that did not work.
What I want is to get a look that is as similar to regular win32 apps as possible.
The code:
#include <QApplication>
#include <QListWidget>
int main(int argc, char *argv[])
{
//list.setSelectionBehavior(QAbstractItemView::SelectRows);
list.addItem("Hello!");
list.addItem("World!");
list.resize(200, 400);
list.show();
return app.exec();
}
#include <QApplication>
#include <QListWidget>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QListWidget list;
//list.setSelectionBehavior(QAbstractItemView::SelectRows);
list.addItem("Hello!");
list.addItem("World!");
list.resize(200, 400);
list.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Any ideas on how to get the list to behave as intended on windows?
Bookmarks