You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
492 lines
13 KiB
492 lines
13 KiB
13 years ago
|
// This is the SIP interface definition for TQListView, TQListViewItem,
|
||
|
// TQCheckListItem and TQListViewItemIterator.
|
||
13 years ago
|
//
|
||
|
// Copyright (c) 2007
|
||
|
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
|
||
|
//
|
||
13 years ago
|
// This file is part of PyTQt.
|
||
13 years ago
|
//
|
||
13 years ago
|
// This copy of PyTQt is free software; you can redistribute it and/or modify it
|
||
13 years ago
|
// under the terms of the GNU General Public License as published by the Free
|
||
|
// Software Foundation; either version 2, or (at your option) any later
|
||
|
// version.
|
||
|
//
|
||
13 years ago
|
// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
|
||
13 years ago
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
|
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
|
// details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU General Public License along with
|
||
13 years ago
|
// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
|
||
13 years ago
|
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||
|
|
||
|
|
||
|
%ExportedDoc
|
||
13 years ago
|
<Sect2><Title>TQListView</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQListView</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
<Para>
|
||
13 years ago
|
Note that to remove a child <Literal>TQListViewItem</Literal> you must first
|
||
13 years ago
|
call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>.
|
||
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQListViewItem</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQListViewItem</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
<Para>
|
||
13 years ago
|
Note that to remove a child <Literal>TQListViewItem</Literal> you must first
|
||
13 years ago
|
call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>.
|
||
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQCheckListItem</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQCheckListItem</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQListViewItemIterator (TQt v2+)</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQListViewItemIterator</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
%End
|
||
|
|
||
|
|
||
13 years ago
|
class TQListViewItem : TQt
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqlistview.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQListViewItem(TQListView * /TransferThis/);
|
||
|
TQListViewItem(TQListViewItem * /TransferThis/);
|
||
|
TQListViewItem(TQListView * /TransferThis/,TQListViewItem *);
|
||
|
TQListViewItem(TQListViewItem * /TransferThis/,TQListViewItem *);
|
||
|
|
||
|
TQListViewItem(TQListView * /TransferThis/,
|
||
|
TQString,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null);
|
||
|
|
||
|
TQListViewItem(TQListViewItem * /TransferThis/,
|
||
|
TQString,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null);
|
||
|
|
||
|
TQListViewItem(TQListView * /TransferThis/,TQListViewItem *,
|
||
|
TQString,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null);
|
||
|
|
||
|
TQListViewItem(TQListViewItem * /TransferThis/,TQListViewItem *,
|
||
|
TQString,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null,
|
||
|
TQString = TQString::null,TQString = TQString::null);
|
||
|
|
||
|
virtual void insertItem(TQListViewItem * /Transfer/);
|
||
|
virtual void takeItem(TQListViewItem * /TransferBack/);
|
||
13 years ago
|
|
||
|
int height() const;
|
||
|
virtual void invalidateHeight();
|
||
|
int totalHeight() const;
|
||
13 years ago
|
virtual int width(const TQFontMetrics &,const TQListView *,int) const;
|
||
13 years ago
|
void widthChanged(int = -1) const;
|
||
|
int depth() const;
|
||
|
|
||
13 years ago
|
virtual void setText(int,const TQString &);
|
||
|
virtual TQString text(int) const;
|
||
13 years ago
|
|
||
13 years ago
|
virtual void setPixmap(int,const TQPixmap &);
|
||
|
virtual const TQPixmap *pixmap(int) const;
|
||
13 years ago
|
|
||
13 years ago
|
virtual TQString key(int,bool) const;
|
||
|
virtual int compare(TQListViewItem *,int,bool) const;
|
||
13 years ago
|
virtual void sortChildItems(int,bool);
|
||
|
|
||
|
int childCount() const;
|
||
|
|
||
|
bool isOpen() const;
|
||
|
virtual void setOpen(bool);
|
||
|
virtual void setup();
|
||
|
|
||
|
virtual void setSelected(bool);
|
||
|
bool isSelected() const;
|
||
|
|
||
13 years ago
|
virtual void paintCell(TQPainter *,const TQColorGroup &,int,int,int);
|
||
|
virtual void paintBranches(TQPainter *,const TQColorGroup &,int,int,int);
|
||
|
virtual void paintFocus(TQPainter *,const TQColorGroup &,const TQRect &);
|
||
13 years ago
|
|
||
13 years ago
|
TQListViewItem *firstChild() const;
|
||
|
TQListViewItem *nextSibling() const;
|
||
|
TQListViewItem *parent() const;
|
||
13 years ago
|
|
||
13 years ago
|
TQListViewItem *itemAbove();
|
||
|
TQListViewItem *itemBelow();
|
||
13 years ago
|
|
||
|
int itemPos() const;
|
||
|
|
||
13 years ago
|
TQListView *listView() const;
|
||
13 years ago
|
|
||
|
virtual void setSelectable(bool);
|
||
|
bool isSelectable() const;
|
||
|
|
||
|
virtual void setExpandable(bool);
|
||
|
bool isExpandable();
|
||
|
|
||
|
void repaint() const;
|
||
|
|
||
|
virtual void sort();
|
||
13 years ago
|
void moveItem(TQListViewItem *);
|
||
13 years ago
|
|
||
|
virtual void setDragEnabled(bool);
|
||
|
virtual void setDropEnabled(bool);
|
||
|
bool dragEnabled() const;
|
||
|
bool dropEnabled() const;
|
||
13 years ago
|
virtual bool acceptDrop(const TQMimeSource *) const;
|
||
13 years ago
|
|
||
|
void setVisible(bool);
|
||
|
bool isVisible() const;
|
||
|
|
||
|
virtual void setRenameEnabled(int,bool);
|
||
|
bool renameEnabled(int) const;
|
||
|
virtual void startRename(int);
|
||
|
|
||
|
virtual void setEnabled(bool);
|
||
|
bool isEnabled() const;
|
||
|
|
||
|
virtual int rtti() const;
|
||
|
|
||
|
virtual void setMultiLinesEnabled(bool);
|
||
|
bool multiLinesEnabled() const;
|
||
|
|
||
|
protected:
|
||
|
virtual void enforceSortOrder() const;
|
||
|
virtual void setHeight(int);
|
||
|
virtual void activate();
|
||
|
|
||
13 years ago
|
bool activatedPos(TQPoint &);
|
||
|
virtual void dropped(TQDropEvent *);
|
||
13 years ago
|
virtual void dragEntered();
|
||
|
virtual void dragLeft();
|
||
|
virtual void okRename(int);
|
||
|
virtual void cancelRename(int);
|
||
|
|
||
|
void ignoreDoubleClick();
|
||
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQListView : TQScrollView
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqlistview.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQListView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0);
|
||
13 years ago
|
|
||
|
int treeStepSize() const;
|
||
|
virtual void setTreeStepSize(int);
|
||
|
|
||
13 years ago
|
virtual void insertItem(TQListViewItem * /Transfer/);
|
||
|
virtual void takeItem(TQListViewItem * /TransferBack/);
|
||
13 years ago
|
|
||
13 years ago
|
TQHeader *header() const;
|
||
13 years ago
|
|
||
13 years ago
|
virtual int addColumn(const TQString &,int = -1);
|
||
|
virtual int addColumn(const TQIconSet &,const TQString &,int = -1);
|
||
13 years ago
|
void removeColumn(int);
|
||
13 years ago
|
virtual void setColumnText(int,const TQString &);
|
||
|
virtual void setColumnText(int,const TQIconSet &,const TQString &);
|
||
|
TQString columnText(int) const;
|
||
13 years ago
|
virtual void setColumnWidth(int,int);
|
||
|
int columnWidth(int) const;
|
||
|
|
||
|
enum WidthMode
|
||
|
{
|
||
|
Manual,
|
||
|
Maximum
|
||
|
};
|
||
|
|
||
|
virtual void setColumnWidthMode(int,WidthMode);
|
||
|
WidthMode columnWidthMode(int) const;
|
||
|
int columns() const;
|
||
|
|
||
|
virtual void setColumnAlignment(int,int);
|
||
|
int columnAlignment(int) const;
|
||
|
|
||
|
void show();
|
||
|
|
||
13 years ago
|
TQListViewItem *itemAt(const TQPoint &) const;
|
||
|
TQRect itemRect(const TQListViewItem *) const;
|
||
|
int itemPos(const TQListViewItem *);
|
||
13 years ago
|
|
||
13 years ago
|
void ensureItemVisible(const TQListViewItem *);
|
||
13 years ago
|
|
||
13 years ago
|
void repaintItem(const TQListViewItem *) const;
|
||
13 years ago
|
|
||
|
virtual void setMultiSelection(bool);
|
||
|
bool isMultiSelection() const;
|
||
|
|
||
|
enum SelectionMode {
|
||
|
Single,
|
||
|
Multi,
|
||
|
Extended,
|
||
|
NoSelection
|
||
|
};
|
||
|
|
||
|
void setSelectionMode(SelectionMode);
|
||
|
SelectionMode selectionMode() const;
|
||
|
|
||
|
virtual void clearSelection();
|
||
13 years ago
|
virtual void setSelected(TQListViewItem *,bool);
|
||
|
void setSelectionAnchor(TQListViewItem *);
|
||
|
bool isSelected(TQListViewItem *) const;
|
||
|
TQListViewItem *selectedItem() const;
|
||
|
virtual void setOpen(TQListViewItem *,bool);
|
||
|
bool isOpen(TQListViewItem *) const;
|
||
13 years ago
|
|
||
13 years ago
|
virtual void setCurrentItem(TQListViewItem *);
|
||
|
TQListViewItem *currentItem() const;
|
||
13 years ago
|
|
||
13 years ago
|
TQListViewItem *firstChild() const;
|
||
|
TQListViewItem *lastItem() const;
|
||
13 years ago
|
|
||
|
int childCount() const;
|
||
|
|
||
|
virtual void setAllColumnsShowFocus(bool);
|
||
|
bool allColumnsShowFocus() const;
|
||
|
|
||
|
virtual void setItemMargin(int);
|
||
|
int itemMargin() const;
|
||
|
|
||
|
virtual void setRootIsDecorated(bool);
|
||
|
bool rootIsDecorated() const;
|
||
|
|
||
|
virtual void setSorting(int,bool = 1);
|
||
|
int sortColumn() const;
|
||
|
void setSortColumn(int);
|
||
|
SortOrder sortOrder() const;
|
||
|
void setSortOrder(SortOrder);
|
||
|
virtual void sort();
|
||
|
|
||
13 years ago
|
virtual void setFont(const TQFont &);
|
||
|
virtual void setPalette(const TQPalette &);
|
||
13 years ago
|
|
||
13 years ago
|
bool eventFilter(TQObject *,TQEvent *);
|
||
13 years ago
|
|
||
13 years ago
|
TQSize sizeHint() const;
|
||
|
TQSize minimumSizeHint() const;
|
||
13 years ago
|
|
||
|
void setShowSortIndicator(bool);
|
||
|
bool showSortIndicator() const;
|
||
|
virtual void setShowToolTips(bool);
|
||
|
bool showToolTips() const;
|
||
|
|
||
|
enum ResizeMode {
|
||
|
NoColumn,
|
||
|
AllColumns,
|
||
|
LastColumn
|
||
|
};
|
||
|
|
||
|
virtual void setResizeMode(ResizeMode);
|
||
|
ResizeMode resizeMode() const;
|
||
|
|
||
13 years ago
|
TQListViewItem *findItem(const TQString &,int,
|
||
13 years ago
|
ComparisonFlags = ExactMatch | CaseSensitive) const;
|
||
|
|
||
|
enum RenameAction {
|
||
|
Accept,
|
||
|
Reject
|
||
|
};
|
||
|
|
||
|
virtual void setDefaultRenameAction(RenameAction);
|
||
|
RenameAction defaultRenameAction() const;
|
||
|
bool isRenaming() const;
|
||
|
|
||
|
void hideColumn(int);
|
||
|
|
||
|
public slots:
|
||
|
virtual void clear();
|
||
|
void invertSelection();
|
||
|
void selectAll(bool);
|
||
|
void setContentsPos(int,int);
|
||
|
void triggerUpdate();
|
||
|
void adjustColumn(int);
|
||
|
|
||
|
signals:
|
||
|
void selectionChanged();
|
||
13 years ago
|
void selectionChanged(TQListViewItem *);
|
||
|
void currentChanged(TQListViewItem *);
|
||
|
void clicked(TQListViewItem *);
|
||
|
void clicked(TQListViewItem *,const TQPoint &,int);
|
||
|
void pressed(TQListViewItem *);
|
||
|
void pressed(TQListViewItem *,const TQPoint &,int);
|
||
13 years ago
|
|
||
13 years ago
|
void doubleClicked(TQListViewItem *);
|
||
|
void doubleClicked(TQListViewItem *,const TQPoint &,int);
|
||
|
void returnPressed(TQListViewItem *);
|
||
|
void spacePressed(TQListViewItem *);
|
||
|
void rightButtonClicked(TQListViewItem *,const TQPoint &,int);
|
||
|
void rightButtonPressed(TQListViewItem *,const TQPoint &,int);
|
||
|
void mouseButtonPressed(int,TQListViewItem *,const TQPoint &,int);
|
||
|
void mouseButtonClicked(int,TQListViewItem *,const TQPoint &,int);
|
||
13 years ago
|
|
||
13 years ago
|
void contextMenuRequested(TQListViewItem *,const TQPoint &,int);
|
||
13 years ago
|
|
||
13 years ago
|
void onItem(TQListViewItem *);
|
||
13 years ago
|
void onViewport();
|
||
|
|
||
13 years ago
|
void expanded(TQListViewItem *);
|
||
|
void collapsed(TQListViewItem *);
|
||
|
void dropped(TQDropEvent *);
|
||
|
void itemRenamed(TQListViewItem *,int,const TQString &);
|
||
|
void itemRenamed(TQListViewItem *,int);
|
||
13 years ago
|
|
||
|
protected:
|
||
13 years ago
|
void contentsMousePressEvent(TQMouseEvent *);
|
||
|
void contentsMouseReleaseEvent(TQMouseEvent *);
|
||
|
void contentsMouseMoveEvent(TQMouseEvent *);
|
||
|
void contentsMouseDoubleClickEvent(TQMouseEvent *);
|
||
|
void contentsContextMenuEvent(TQContextMenuEvent *);
|
||
|
void contentsDragEnterEvent(TQDragEnterEvent *);
|
||
|
void contentsDragMoveEvent(TQDragMoveEvent *);
|
||
|
void contentsDragLeaveEvent(TQDragLeaveEvent *);
|
||
|
void contentsDropEvent(TQDropEvent *);
|
||
|
virtual TQDragObject *dragObject();
|
||
13 years ago
|
virtual void startDrag();
|
||
|
|
||
13 years ago
|
void focusInEvent(TQFocusEvent *);
|
||
|
void focusOutEvent(TQFocusEvent *);
|
||
13 years ago
|
|
||
13 years ago
|
void keyPressEvent(TQKeyEvent *);
|
||
13 years ago
|
|
||
13 years ago
|
void resizeEvent(TQResizeEvent *);
|
||
|
void viewportResizeEvent(TQResizeEvent *);
|
||
13 years ago
|
|
||
13 years ago
|
void showEvent(TQShowEvent *);
|
||
13 years ago
|
|
||
13 years ago
|
void drawContentsOffset(TQPainter *,int,int,int,int,int,int);
|
||
13 years ago
|
|
||
13 years ago
|
virtual void paintEmptyArea(TQPainter *,const TQRect &);
|
||
|
void styleChange(TQStyle &);
|
||
13 years ago
|
void windowActivationChange(bool);
|
||
|
|
||
|
protected slots:
|
||
|
void updateContents();
|
||
|
void doAutoScroll();
|
||
|
|
||
|
private:
|
||
13 years ago
|
TQListView(const TQWidget &);
|
||
13 years ago
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQCheckListItem : TQListViewItem
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqlistview.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
|
enum Type {
|
||
|
RadioButton,
|
||
|
CheckBox,
|
||
|
Controller,
|
||
|
RadioButtonController,
|
||
|
CheckBoxController,
|
||
|
};
|
||
|
|
||
|
enum ToggleState {
|
||
|
Off,
|
||
|
NoChange,
|
||
|
On
|
||
|
};
|
||
|
|
||
13 years ago
|
TQCheckListItem(TQCheckListItem * /TransferThis/,const TQString &,
|
||
13 years ago
|
Type = RadioButtonController);
|
||
13 years ago
|
TQCheckListItem(TQCheckListItem * /TransferThis/,TQListViewItem *,
|
||
|
const TQString &,Type = RadioButtonController);
|
||
|
TQCheckListItem(TQListViewItem * /TransferThis/,const TQString &,
|
||
13 years ago
|
Type = RadioButtonController);
|
||
13 years ago
|
TQCheckListItem(TQListViewItem * /TransferThis/,TQListViewItem *,
|
||
|
const TQString &,Type = RadioButtonController);
|
||
|
TQCheckListItem(TQListView * /TransferThis/,const TQString &,
|
||
13 years ago
|
Type = RadioButtonController);
|
||
13 years ago
|
TQCheckListItem(TQListView * /TransferThis/,TQListViewItem *,
|
||
|
const TQString &,Type = RadioButtonController);
|
||
|
TQCheckListItem(TQListViewItem * /TransferThis/,const TQString &,
|
||
|
const TQPixmap &);
|
||
|
TQCheckListItem(TQListView * /TransferThis/,const TQString &,
|
||
|
const TQPixmap &);
|
||
13 years ago
|
|
||
13 years ago
|
void paintCell(TQPainter *,const TQColorGroup &,int,int,int);
|
||
|
virtual void paintFocus(TQPainter *,const TQColorGroup &,const TQRect &);
|
||
|
int width(const TQFontMetrics &,const TQListView *,int) const;
|
||
13 years ago
|
void setup();
|
||
|
|
||
|
virtual void setOn(bool);
|
||
|
bool isOn() const;
|
||
|
Type type() const;
|
||
13 years ago
|
TQString text() const;
|
||
|
TQString text(int) const;
|
||
13 years ago
|
|
||
|
void setTristate(bool);
|
||
|
bool isTristate() const;
|
||
|
ToggleState state() const;
|
||
|
void setState(ToggleState);
|
||
|
|
||
|
int rtti() const;
|
||
|
|
||
|
protected:
|
||
|
void activate();
|
||
|
void turnOffChild();
|
||
|
virtual void stateChange(bool);
|
||
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQListViewItemIterator
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqlistview.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
|
enum IteratorFlag {
|
||
|
Visible,
|
||
|
Invisible,
|
||
|
Selected,
|
||
|
Unselected,
|
||
|
Selectable,
|
||
|
NotSelectable,
|
||
|
DragEnabled,
|
||
|
DragDisabled,
|
||
|
DropEnabled,
|
||
|
DropDisabled,
|
||
|
Expandable,
|
||
|
NotExpandable,
|
||
|
Checked,
|
||
|
NotChecked
|
||
|
};
|
||
|
|
||
13 years ago
|
TQListViewItemIterator();
|
||
|
TQListViewItemIterator(TQListViewItem *);
|
||
|
TQListViewItemIterator(TQListViewItem *,int);
|
||
13 years ago
|
|
||
13 years ago
|
TQListViewItemIterator(const TQListViewItemIterator &);
|
||
|
TQListViewItemIterator(TQListView *);
|
||
|
TQListViewItemIterator(TQListView *,int);
|
||
13 years ago
|
|
||
13 years ago
|
TQListViewItemIterator &operator+=(int);
|
||
|
TQListViewItemIterator &operator-=(int);
|
||
13 years ago
|
|
||
13 years ago
|
TQListViewItem *current() const;
|
||
13 years ago
|
};
|