diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-10-29 14:01:42 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-10-30 10:06:08 +0200 |
commit | 84c156d3e2fcceeab608f401fbc638f2d01219b3 (patch) | |
tree | 74de2de1635c60645f4864d08f6afb941948aea8 /examples/itemmodel/main.cpp | |
parent | 233d5c02638903e96687d580ada7188f0e6a9756 (diff) |
Selection overhaul
Selection modes are now proper flags, so you can easily mix and match
item, row, and column modes as you wish. Slice flag means automatic
slicing control - if user wishes to control slicing himself, he should
not set this mode flag.
Clicking an item on graph now emits clicked signal from renderer to
controller on all graphs instead of setting the selected item.
Controller will set the selected item based on this information.
Task-number: QTRD-2366
Task-number: QTRD-2491
Change-Id: I6251c42e22ea676613fbd36685e33574e6eb9a1a
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/itemmodel/main.cpp')
-rw-r--r-- | examples/itemmodel/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/itemmodel/main.cpp b/examples/itemmodel/main.cpp index fac6b442..5964992d 100644 --- a/examples/itemmodel/main.cpp +++ b/examples/itemmodel/main.cpp @@ -90,7 +90,7 @@ GraphDataGenerator::GraphDataGenerator(Q3DBars *bargraph, QTableWidget *tableWid m_tableWidget->setColumnCount(m_columnCount); // Set selection mode to full - m_graph->setSelectionMode(QDataVis::SelectionModeItemRowAndColumn); + m_graph->setSelectionMode(QDataVis::SelectionItemRowAndColumn); // Hide axis labels by explicitly setting one empty string as label list m_graph->rowAxis()->setCategoryLabels(QStringList(QString())); @@ -101,7 +101,7 @@ GraphDataGenerator::GraphDataGenerator(Q3DBars *bargraph, QTableWidget *tableWid //! [6] // Set selection mode to slice row - m_graph->setSelectionMode(QDataVis::SelectionModeSliceRow); + m_graph->setSelectionMode(QDataVis::SelectionItemAndRow | QDataVis::SelectionSlice); // Set font m_graph->setFont(QFont("Impact", 20)); @@ -222,7 +222,7 @@ void GraphDataGenerator::selectedFromTable(int currentRow, int currentColumn, { Q_UNUSED(previousRow) Q_UNUSED(previousColumn) - m_graph->setSelectedBarPos(QPoint(currentRow, currentColumn)); + m_graph->setSelectedBar(QPoint(currentRow, currentColumn)); } //! [14] @@ -273,7 +273,7 @@ int main(int argc, char **argv) //! [3] GraphDataGenerator generator(graph, tableWidget); - QObject::connect(graph, &Q3DBars::selectedBarPosChanged, &generator, + QObject::connect(graph, &Q3DBars::selectedBarChanged, &generator, &GraphDataGenerator::selectFromTable); QObject::connect(tableWidget, &QTableWidget::currentCellChanged, &generator, &GraphDataGenerator::selectedFromTable); |