I would like to have QAbstractItemView that will allow multi-selection of items only with ctrl button toggle. I can't use QAbstractItemView::ExtandedSelection because it also allow multiple items selection by dragging the mouse over them.
Multiple Selection table, without selection of mouse dragging
1.1k Views Asked by ebeglary At
1
There are 1 best solutions below
Related Questions in QT
- C++ template using pointer and non pointer arguments in a QVector
- Using QPointer and QObject::connect with C++11
- qt How to style a QToolBar > QToolButton overflow button?
- Qt - Repeatedly write at beginning of file
- C++ Mongodb driver, not working
- deletion and cleanup of worker thread in Qt crashes
- How to drap item from QTableView to QPushButton?
- get image type from qimage
- C++ QT Getting part from QString
- How to connect a destroyed signal of C++ object from QML?
- How to get shader version from QOpenGLShader?
- Size of Qt QRadioButton able to get smaller, but not larger than default
- error WinSock.h has already been included Boost Windows Qt
- How to call a non-class member function with pointers as parameters with QtConcurrent::run?
- What is the difference between MinGW SEH and MinGW SJLJ?
Related Questions in QTABLEVIEW
- Understanding MVC in a QAbstractTableModel
- How to implement nested (banded) columns in tableview?
- Cannot connect (null)::selectionChanged to QTableView
- PyQt / Qt, tableview with custom delegate to use ellipsis for text overflowing cell
- Adding checkBox as vertical header in QtableView
- Make QTableView editable when model is pandas dataframe
- Pandas df in editable QTableView: remove check boxes
- Resize Vertical Header of QTableView in PyQt4?
- How to show several QTableViews(without scrollbar) in QListWidget(or other similar widgets)?
- Is there way to automatically resize content of the last column for QTableView?
- Qt C++ sorting TableView
- PYQT: Horizontal and Vertical Headers
- How to prevent Qt from alpha-blending the selection over icons in QListView?
- How to make QHeaderView editable like data in cells?
- In QDialog, resize window to contain all columns of QTableView
Related Questions in QABSTRACTITEMVIEW
- How to close an editor created by a custom QItemDelegate::createEditor()
- QTreeView Edit UserRole Instead of DisplayRole Upon Double Click
- QAbstractItemView::setIndexWidget as editor
- How to not get changed-signals to be emitted when setting the current-index in QAbstactItemView?
- Qt: Attempt to add Drag and Drop to Editable Tree Model example not working
- Locking selection in QTableView/QTreeView
- Why QAbstractItemView::dragEnterEvent is always accepted?
- How does QAbstractItemView know about my custom roles when emitting dataChanged() with no roles?
- QTableView shows 1d data in exactly one row/column. How to show it two-dimensionally?
- Qt: remove model from view
- QComboBox drop-down item margin
- Item is selected but isn't highlighted
- Programmatically select QModelIndexes in QAbstractItemView
- Qt,QListView Model
- QAbstractItemView selectAll slow
Related Questions in QITEMSELECTIONMODEL
- Locking selection in QTableView/QTreeView
- How to repaint a QTreeView after calling QItemSelectionModel::select?
- Behavior of selectionChanged() on removing first row
- QTableView: Prevent a user from navigating away from a spesific row
- Can't select row of TableView in QML
- PyQt5 QTableView with QItemSelectionModel and setCursor method populated by Pandas DataFrame
- Customize selection behavior for QTreeView
- Multiple Selection table, without selection of mouse dragging
- How do I collect rows from QItemSelection
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I assume you are using a
QTableViewYou can override theQTableViewand then usemouseMoveEventcleverly to ensure that user can't make multiple selections by dragging!If user enters into
mouseMoveEventwith the left mouse button pressed, you can choose to eat the event without passing it to theQTableViewthat will remove the possibility of multiple selection.e.g.
This might work for you, you may also have to be careful in the
mouseMoveEvent, when you do above to mousePressEvent you have to do the same formouseReleaseEventas well.Though this is just a theory , but is should work!