View Single Post
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#2
Originally Posted by SirMuttley View Post
If I comment out the "setPickSelector" call the button doesn't do anything when clicked but at least it doesn't crash. This makes me think it has to be something to do with QMaemo5ListPickSelector.

A google for QMaemo5ListPickSelector and pyside brings up only a git commit log.

Is there a chance this just doesn't work yet or am I doing something stupid? This is my first python project in about 4 years and my first time using QT so perhaps it's pebkac.

Any help would be greatly appreciated.
the code seems alright to me, this is exactly how Ive used it in C++ as well for an app
doing exactly the same for the london underground.
Code:
	QStandardItemModel *stationListModel = new QStandardItemModel(0, 1);

	foreach(QString station, stationList)

	{
		QStandardItem *item = new QStandardItem(station);
                // the Maemo 5 design spec recommends this.
		item->setTextAlignment(Qt::AlignCenter); 
		item->setEditable(false); // prevent editing of the item
		stationListModel->appendRow(item);
	}
        QMaemo5ListPickSelector *fromSelector = new QMaemo5ListPickSelector;
	QMaemo5ListPickSelector *toSelector = new QMaemo5ListPickSelector;
	QMaemo5ListPickSelector *viaSelector = new QMaemo5ListPickSelector;
	fromSelector->setModel(stationListModel);
	toSelector->setModel(stationListModel);
	viaSelector->setModel(stationListModel);
	// not setting the current index means that the value is empty.
	fromButton->setPickSelector(fromSelector);
	toButton->setPickSelector(toSelector);
	viaButton->setPickSelector(viaSelector);
If I find something about this Ill post today, dont know much about python but this will be a start for me as well
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”

Last edited by krk969; 2010-03-01 at 12:02.