• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Widgets Library
 

KDevelop Widgets Library

  • lib
  • widgets
qcomboview.h
Go to the documentation of this file.
1 /**********************************************************************
2 **
3 **
4 ** Definition of QComboView class
5 **
6 ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
7 ** Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
8 **
9 ** This file may be distributed and/or modified under the terms of the
10 ** GNU General Public License version 2 as published by the Free Software
11 ** Foundation and appearing in the file LICENSE.GPL included in the
12 ** packaging of this file.
13 **
14 **********************************************************************/
15 
16 #ifndef TQCOMBOVIEW_H
17 #define TQCOMBOVIEW_H
18 
19 #include "tqwidget.h"
20 
21 #ifndef TQT_NO_COMBOBOX
22 
28 class TQStrList;
29 class TQStringList;
30 class TQLineEdit;
31 class TQValidator;
32 class TQListView;
33 class TQListViewItem;
34 class QComboViewData;
35 
41 class TQ_EXPORT QComboView : public TQWidget
42 {
43  Q_OBJECT
44 
45  TQ_ENUMS( Policy )
46  TQ_PROPERTY( bool editable READ editable WRITE setEditable )
47 // TQ_PROPERTY( int count READ count )
48  TQ_PROPERTY( TQString currentText READ currentText WRITE setCurrentText DESIGNABLE false )
49 // TQ_PROPERTY( TQListView *currentItem READ currentItem WRITE setCurrentItem )
50  TQ_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false )
51  TQ_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit )
52 // TQ_PROPERTY( int maxCount READ maxCount WRITE setMaxCount )
53  TQ_PROPERTY( Policy insertionPolicy READ insertionPolicy WRITE setInsertionPolicy )
54  TQ_PROPERTY( bool autoCompletion READ autoCompletion WRITE setAutoCompletion )
55  TQ_PROPERTY( bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled )
56  TQ_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true )
57 
58 public:
59 // QComboView( TQWidget* parent=0, const char* name=0 );
60  QComboView( bool rw, TQWidget* parent=0, const char* name=0 );
61  ~QComboView();
62 
63  int childCount() const;
64 
65  TQListViewItem *currentItem() const;
66  virtual void setCurrentItem( TQListViewItem * );
67  virtual void setCurrentActiveItem( TQListViewItem * );
68 
69  bool autoResize() const;
70  virtual void setAutoResize( bool );
71  TQSize sizeHint() const;
72 
73  void setPalette( const TQPalette & );
74  void setFont( const TQFont & );
75  void setEnabled( bool );
76 
77  virtual void setSizeLimit( int );
78  int sizeLimit() const;
79 
80 /* virtual void setMaxCount( int );
81  int maxCount() const;*/
82 
83  enum Policy { NoInsertion, AtTop, AtCurrent, AtBottom,
84  AfterCurrent, BeforeCurrent };
85 
86  virtual void setInsertionPolicy( Policy policy );
87  Policy insertionPolicy() const;
88 
89  virtual void setValidator( const TQValidator * );
90  const TQValidator * validator() const;
91 
92  virtual void setListView( TQListView * );
93  TQListView * listView() const;
94 
95  virtual void setLineEdit( TQLineEdit *edit );
96  TQLineEdit* lineEdit() const;
97 
98  virtual void setAutoCompletion( bool );
99  bool autoCompletion() const;
100 
101  bool eventFilter( TQObject *object, TQEvent *event );
102 
103  void setDuplicatesEnabled( bool enable );
104  bool duplicatesEnabled() const;
105 
106  bool editable() const;
107  void setEditable( bool );
108 
109  virtual void popup();
110 
111  TQString currentText() const;
112  void setCurrentText( const TQString& );
113 
114 public slots:
115  virtual void clear();
116  void clearValidator();
117  void clearEdit();
118  virtual void setEditText( const TQString &);
119 
120 signals:
121  void activated( TQListViewItem * item );
122  void highlighted( TQListViewItem * item );
123  void activated( const TQString &);
124  void highlighted( const TQString &);
125  void textChanged( const TQString &);
126  void focusGranted();
127  void focusLost();
128 
129 private slots:
130  void internalActivate( TQListViewItem * );
131  void internalHighlight( TQListViewItem * );
132  void internalClickTimeout();
133  void returnPressed();
134  void checkState(TQListViewItem*);
135 
136 protected:
137  void paintEvent( TQPaintEvent * );
138  void resizeEvent( TQResizeEvent * );
139  void mousePressEvent( TQMouseEvent * );
140  void mouseMoveEvent( TQMouseEvent * );
141  void mouseReleaseEvent( TQMouseEvent * );
142  void mouseDoubleClickEvent( TQMouseEvent * );
143  void keyPressEvent( TQKeyEvent *e );
144  void focusInEvent( TQFocusEvent *e );
145  void focusOutEvent( TQFocusEvent *e );
146  void wheelEvent( TQWheelEvent *e );
147  void styleChange( TQStyle& );
148 
149  void updateMask();
150 
151 private:
152  virtual void setUpListView();
153  void setUpLineEdit();
154  void popDownListView();
155  void reIndex();
156  void currentChanged();
157  TQListViewItem *completionIndex( const TQString &, TQListViewItem * ) const;
158 
159  QComboViewData *d;
160 
161 private: // Disabled copy constructor and operator=
162 #if defined(TQ_DISABLE_COPY)
163  QComboView( const QComboView & );
164  QComboView &operator=( const QComboView & );
165 #endif
166 };
167 
168 
169 #endif // TQT_NO_COMBOBOX
170 
171 #endif // TQCOMBOVIEW_H
QComboView
QComboView - a combo with a TQListView as a popup widget.
Definition: qcomboview.h:41

KDevelop Widgets Library

Skip menu "KDevelop Widgets Library"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDevelop Widgets Library

Skip menu "KDevelop Widgets Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Widgets Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.