PDA

View Full Version : Questions on Pie chart example



rakkar
7th September 2009, 03:15
From http://doc.trolltech.com/4.3/itemviews-chart.html

I'd like to design a window in QT Designer rather than designing the window all in code. But I can't figure out

1. How do I set the splitter? I don't see any splitter widget in QT designer
2. I can place the table view, but not the pie chart, since the former exists as an option in QT designer while the latter does not. Is there a way I can get that pie chart to be a widget I can drag in QT designer?

Thanks

rakkar
7th September 2009, 03:19
Also, the sort function doesn't do anything.



tableView.setSortingEnabled(true);
tableView.sortByColumn(valueColumn,Qt::DescendingO rder);


When I traced it down, it went to



void QAbstractItemModel::sort(int column, Qt::SortOrder order)
{
Q_UNUSED(column);
Q_UNUSED(order);
// do nothing
}


I guess that means displaying the data sorted would actually sort the SQL table? I don't want to change the table, I just want to display the data sorted.

Besides that, I'm using QSqlQueryModel because I want the user to be able to type in arbitrary queries. setQuery is protected with QSqlTableModel