31 #include <QTreeWidget>
37 #define FIXME_TOOLTIP 0
41 class QY2ListViewToolTip;
111 QTreeWidgetItem * item,
113 const QPoint & pos );
119 QTreeWidgetItem * item,
121 const QPoint & pos );
137 virtual QString
toolTip( QTreeWidgetItem * item,
int column );
167 virtual bool eventFilter( QObject * obj, QEvent * event );
215 QTreeWidgetItem * _mousePressedItem;
216 int _mousePressedCol;
217 Qt::MouseButton _mousePressedButton;
219 std::vector<int> _savedColumnWidth;
220 bool _sortByInsertionSequence;
223 QY2ListViewToolTip * _toolTip;
224 bool _mouseButton1PressedInHeader;
225 bool _finalSizeChangeExpected;
241 const QString & text = QString() );
248 const QString & text = QString() );
275 virtual bool operator< (
const QTreeWidgetItem & other )
const;
294 bool compare(
const QString& text1,
const QString& text2)
const;
307 virtual QString
toolTip(
int column ) {
return QString(); }
319 QColor _backgroundColor;
335 const QString & text );
342 const QString & text );
376 { _textColor = col; }
383 { _backgroundColor = col; }
391 virtual QString
toolTip(
int column ) {
return QString(); }
410 class QY2ListViewToolTip :
public QToolTip
418 : QToolTip( parent->viewport() )
419 , _listView( parent ) {}
424 virtual ~QY2ListViewToolTip() {}
434 virtual void maybeTip(
const QPoint & p );
QY2CheckListItem(QY2ListView *parentListView, const QString &text)
Constructor for toplevel items.
virtual void updateStatus()
Update this item's status.
void setTextColor(const QColor &col)
Set the text foreground color for all columns.
void setBackgroundColor(const QColor &col)
Set the text background color for all columns.
virtual void updateData()
Update this item's data completely.
int serial() const
Return this item's serial number.
virtual ~QY2CheckListItem()
Destructor.
virtual QString toolTip(int column)
Returns a tool tip text for a specific column of this item.
Enhanced QTreeWidgetItem.
QY2ListViewItem(QY2ListView *parentListView, const QString &text=QString())
Constructor for toplevel items.
virtual QString smartSortKey(int column) const
The text of the table cell or the sort-key if available.
virtual bool operator<(const QTreeWidgetItem &other) const
Comparison function used for sorting the list.
bool sortByInsertionSequence() const
Returns 'true' if the sort order should always be the item insertion order, 'false' if the user can c...
bool compare(const QString &text1, const QString &text2) const
Compare two string locate-aware.
virtual void updateStatus()
Update this item's status.
virtual void updateData()
Update this item's data completely.
virtual QString toolTip(int column)
Returns a tool tip text for a specific column of this item.
virtual ~QY2ListViewItem()
Destructor.
int serial() const
Return this item's serial number.
virtual bool eventFilter(QObject *obj, QEvent *event)
Event filter - inherited from QWidget.
QY2ListView(QWidget *parent)
Constructor.
void treeCollapsed(QTreeWidgetItem *listViewItem)
Internal notification that a tree item has been collapsed.
void restoreColumnWidths()
Restore the column widths to what was saved previously with saveColumnWidths().
virtual void clear()
Reimplemented from Q3ListView: Adjust header sizes after clearing contents.
void updateItemData()
Update the status display of all list entries: Call QY2ListViewItem::updateData() for each item.
virtual QString toolTip(QTreeWidgetItem *item, int column)
Returns a tool tip text for a specific column of a list item.
void updateItemStates()
Update the status display of all list entries: Call QY2ListViewItem::updateStatus() for each item.
void treeExpanded(QTreeWidgetItem *listViewItem)
Internal notification that a tree item has been expanded.
virtual ~QY2ListView()
Destructor.
virtual void setSortByInsertionSequence(bool sortByInsertionSequence)
Enforce sorting by item insertion order (true) or let user change sorting by clicking on a column hea...
virtual void mouseDoubleClickEvent(QMouseEvent *)
Handle mouse clicks.
void columnWidthChanged(int col, int oldSize, int newSize)
Internal: Handle manual column resize.
void saveColumnWidths()
Save the current column widths.
virtual QSize minimumSizeHint() const
Returns the minimum size required for this widget.
bool sortByInsertionSequence() const
Returns 'true' if the sort order should always be the item insertion order, 'false' if the user can c...
virtual void mousePressEvent(QMouseEvent *e)
Handle mouse clicks.
void columnDoubleClicked(int button, QTreeWidgetItem *item, int col, const QPoint &pos)
Emitted for mouse double clicks on an item.
virtual void mouseReleaseEvent(QMouseEvent *)
Handle mouse clicks.
int nextSerial()
Returns the next free serial number for items that want to be ordered in insertion sequence.
void columnClicked(int button, QTreeWidgetItem *item, int col, const QPoint &pos)
Emitted for mouse clicks on an item.
virtual void selectSomething()
Select a list entry (if there is any).