1102 void MainWindow::clearSelection() |
1102 void MainWindow::clearSelection() |
1103 { |
1103 { |
1104 m_selections[m_currentDocument]->clear(); |
1104 m_selections[m_currentDocument]->clear(); |
1105 } |
1105 } |
1106 |
1106 |
|
1107 void MainWindow::select(const QModelIndex &objectIndex) |
|
1108 { |
|
1109 if (objectIndex.isValid() and objectIndex.model() == m_currentDocument) |
|
1110 m_selections[m_currentDocument]->select(objectIndex, QItemSelectionModel::Select); |
|
1111 } |
|
1112 |
|
1113 QItemSelectionModel* MainWindow::currentSelectionModel() |
|
1114 { |
|
1115 return m_selections[m_currentDocument]; |
|
1116 } |
|
1117 |
|
1118 void MainWindow::replaceSelection(const QItemSelection& selection) |
|
1119 { |
|
1120 m_selections[m_currentDocument]->select(selection, QItemSelectionModel::ClearAndSelect); |
|
1121 } |
|
1122 |
1107 // --------------------------------------------------------------------------------------------------------------------- |
1123 // --------------------------------------------------------------------------------------------------------------------- |
1108 // |
1124 // |
1109 ColorToolbarItem::ColorToolbarItem (LDColor color, QToolButton* toolButton) : |
1125 ColorToolbarItem::ColorToolbarItem (LDColor color, QToolButton* toolButton) : |
1110 m_color (color), |
1126 m_color (color), |
1111 m_toolButton (toolButton) {} |
1127 m_toolButton (toolButton) {} |