mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 14:33:28 +02:00
Add non-contiguous cart selections in RDListView class.
This commit is contained in:
parent
26c9ff87c0
commit
b2603d2376
@ -19,6 +19,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <vector>
|
||||
|
||||
#include <rdlistview.h>
|
||||
@ -27,6 +28,7 @@
|
||||
RDListView::RDListView(QWidget *parent)
|
||||
: Q3ListView(parent)
|
||||
{
|
||||
list_contiguous=true;
|
||||
list_hard_sort_column=-1;
|
||||
connect(this,
|
||||
SIGNAL(mouseButtonClicked(int,Q3ListViewItem *,const QPoint &,int)),
|
||||
@ -34,6 +36,16 @@ RDListView::RDListView(QWidget *parent)
|
||||
SLOT(mouseButtonClickedData(int,Q3ListViewItem *,const QPoint &,int)));
|
||||
}
|
||||
|
||||
void RDListView::setContiguous(bool state) {
|
||||
list_contiguous=state;
|
||||
}
|
||||
|
||||
|
||||
bool RDListView::contiguous() const
|
||||
{
|
||||
return list_contiguous;
|
||||
}
|
||||
|
||||
|
||||
int RDListView::hardSortColumn() const
|
||||
{
|
||||
@ -93,7 +105,7 @@ void RDListView::mouseButtonClickedData(int button,Q3ListViewItem *item,
|
||||
Q3ListViewItem *l;
|
||||
bool contiguous;
|
||||
|
||||
if((selectionMode()!=Q3ListView::Extended)||(item==NULL)||(button!=1)) {
|
||||
if((list_contiguous==false)||(selectionMode()!=Q3ListView::Extended)||(item==NULL)||(button!=1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,8 @@ class RDListView : public Q3ListView
|
||||
RDListView(QWidget *parent);
|
||||
int hardSortColumn() const;
|
||||
void setHardSortColumn(int col);
|
||||
void setContiguous(bool state);
|
||||
bool contiguous() const;
|
||||
RDListView::SortType columnSortType(int column) const;
|
||||
void setColumnSortType(int column,SortType type);
|
||||
int addColumn(const QString &label,int width=-1);
|
||||
@ -47,6 +49,7 @@ class RDListView : public Q3ListView
|
||||
|
||||
private:
|
||||
int list_hard_sort_column;
|
||||
bool list_contiguous;
|
||||
std::vector<RDListView::SortType> sort_type;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user