mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Force contiguous selection in ExtendedTableWidget
This commit is contained in:
@@ -96,28 +96,6 @@ void ExtendedTableWidget::copy()
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether selection is rectangular
|
||||
QItemSelection rect(indices.first(), indices.last());
|
||||
bool correct = true;
|
||||
|
||||
foreach (const QModelIndex& index, indices)
|
||||
if (!rect.contains(index)) {
|
||||
correct = false;
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (const QModelIndex& index, rect.indexes())
|
||||
if (!indices.contains(index)) {
|
||||
correct = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!correct) {
|
||||
QMessageBox::warning(this, QApplication::applicationName(),
|
||||
tr("This function cannot be used with multiple independent selections."));
|
||||
return;
|
||||
}
|
||||
|
||||
m_buffer.clear();
|
||||
|
||||
// If any of the cells contain binary data - we use inner buffer
|
||||
|
||||
@@ -198,6 +198,9 @@
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::CopyAction</enum>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ContiguousSelection</enum>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
|
||||
Reference in New Issue
Block a user