⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qcombobox.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QComboBox 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQComboBox \- Combined button and popup list.SH SYNOPSIS\fC#include <qcombobox.h>\fR.PPInherits QWidget..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQComboBox\fR ( QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "\fBQComboBox\fR ( bool rw, QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "\fB~QComboBox\fR ()".br.ti -1c.BI "int \fBcount\fR () const".br.ti -1c.BI "void \fBinsertStringList\fR ( const QStringList & list, int index = -1 )".br.ti -1c.BI "void \fBinsertStrList\fR ( const QStrList & list, int index = -1 )".br.ti -1c.BI "void \fBinsertStrList\fR ( const QStrList * list, int index = -1 )".br.ti -1c.BI "void \fBinsertStrList\fR ( const char ** strings, int numStrings = -1, int index = -1 )".br.ti -1c.BI "void \fBinsertItem\fR ( const QString & t, int index = -1 )".br.ti -1c.BI "void \fBinsertItem\fR ( const QPixmap & pixmap, int index = -1 )".br.ti -1c.BI "void \fBinsertItem\fR ( const QPixmap & pixmap, const QString & text, int index = -1 )".br.ti -1c.BI "void \fBremoveItem\fR ( int index )".br.ti -1c.BI "int \fBcurrentItem\fR () const".br.ti -1c.BI "virtual void \fBsetCurrentItem\fR ( int index )".br.ti -1c.BI "QString \fBcurrentText\fR () const".br.ti -1c.BI "virtual void \fBsetCurrentText\fR ( const QString & )".br.ti -1c.BI "QString \fBtext\fR ( int index ) const".br.ti -1c.BI "const QPixmap * \fBpixmap\fR ( int index ) const".br.ti -1c.BI "void \fBchangeItem\fR ( const QString & t, int index )".br.ti -1c.BI "void \fBchangeItem\fR ( const QPixmap & im, int index )".br.ti -1c.BI "void \fBchangeItem\fR ( const QPixmap & im, const QString & t, int index )".br.ti -1c.BI "bool autoResize () const  \fI(obsolete)\fR".br.ti -1c.BI "virtual void setAutoResize ( bool )  \fI(obsolete)\fR".br.ti -1c.BI "virtual void \fBsetPalette\fR ( const QPalette & palette )".br.ti -1c.BI "virtual void \fBsetFont\fR ( const QFont & font )".br.ti -1c.BI "virtual void \fBsetSizeLimit\fR ( int )".br.ti -1c.BI "int \fBsizeLimit\fR () const".br.ti -1c.BI "virtual void \fBsetMaxCount\fR ( int )".br.ti -1c.BI "int \fBmaxCount\fR () const".br.ti -1c.BI "enum \fBPolicy\fR { NoInsertion, AtTop, AtCurrent, AtBottom, AfterCurrent, BeforeCurrent }".br.ti -1c.BI "virtual void \fBsetInsertionPolicy\fR ( Policy policy )".br.ti -1c.BI "Policy \fBinsertionPolicy\fR () const".br.ti -1c.BI "virtual void \fBsetValidator\fR ( const QValidator * v )".br.ti -1c.BI "const QValidator * \fBvalidator\fR () const".br.ti -1c.BI "virtual void \fBsetListBox\fR ( QListBox * newListBox )".br.ti -1c.BI "QListBox * \fBlistBox\fR () const".br.ti -1c.BI "virtual void \fBsetLineEdit\fR ( QLineEdit * edit )".br.ti -1c.BI "QLineEdit * \fBlineEdit\fR () const".br.ti -1c.BI "virtual void \fBsetAutoCompletion\fR ( bool )".br.ti -1c.BI "bool \fBautoCompletion\fR () const".br.ti -1c.BI "void \fBsetDuplicatesEnabled\fR ( bool enable )".br.ti -1c.BI "bool \fBduplicatesEnabled\fR () const".br.ti -1c.BI "bool \fBeditable\fR () const".br.ti -1c.BI "void \fBsetEditable\fR ( bool )".br.ti -1c.BI "virtual void \fBpopup\fR ()".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "void \fBclear\fR ()".br.ti -1c.BI "void \fBclearValidator\fR ()".br.ti -1c.BI "void \fBclearEdit\fR ()".br.ti -1c.BI "virtual void \fBsetEditText\fR ( const QString & newText )".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBactivated\fR ( int index )".br.ti -1c.BI "void \fBhighlighted\fR ( int index )".br.ti -1c.BI "void \fBactivated\fR ( const QString & string )".br.ti -1c.BI "void \fBhighlighted\fR ( const QString & string )".br.ti -1c.BI "void \fBtextChanged\fR ( const QString & string )".br.in -1c.SS "Properties".in +1c.ti -1c.BI "bool \fBautoCompletion\fR - whether auto-completion is enabled".br.ti -1c.BI "bool \fBautoMask\fR - whether the combobox is automatically masked  \fI(read " "only" ")\fR".br.ti -1c.BI "bool autoResize - whether auto resize is enabled  \fI(obsolete)\fR".br.ti -1c.BI "int \fBcount\fR - the number of items in the combobox  \fI(read " "only" ")\fR".br.ti -1c.BI "int \fBcurrentItem\fR - the index of the current item in the combobox".br.ti -1c.BI "QString \fBcurrentText\fR - the text of the combobox's current item".br.ti -1c.BI "bool \fBduplicatesEnabled\fR - whether duplicates are allowed".br.ti -1c.BI "bool \fBeditable\fR - whether the combobox is editable".br.ti -1c.BI "Policy \fBinsertionPolicy\fR - the position of the items inserted by the user".br.ti -1c.BI "int \fBmaxCount\fR - the maximum number of items allowed in the combobox".br.ti -1c.BI "int \fBsizeLimit\fR - the maximum on-screen size of the combobox".br.in -1c.SH DESCRIPTIONThe QComboBox widget is a combined button and popup list..PPA combobox is a selection widget which displays the current item and can pop up a list of items. A combobox may be editable in which case the user can enter arbitrary strings..PPComboboxes provide a means of showing the user's current choice out of a list of options in a way that takes up the minimum amount of screen space..PPQComboBox supports three different display styles: Aqua/Motif 1.x, Motif 2.0 and Windows. In Motif 1.x, a combobox was called XmOptionMenu. In Motif 2.0, OSF introduced an improved combobox and named that XmComboBox. QComboBox provides both..PPQComboBox provides two different constructors. The simplest constructor creates an "old-style" combobox in Motif (or Aqua) style:.PP.nf.br        QComboBox *c = new QComboBox( this, "read-only combobox" );.br.fi.PPThe other constructor creates a new-style combobox in Motif style, and can create both read-only and editable comboboxes:.PP.nf.br        QComboBox *c1 = new QComboBox( FALSE, this, "read-only combobox" );.br        QComboBox *c2 = new QComboBox( TRUE, this, "editable combobox" );.br.fi.PPNew-style comboboxes use a list box in both Motif and Windows styles, and both the content size and the on-screen size of the list box can be limited with sizeLimit() and setMaxCount() respectively. Old-style comboboxes use a popup in Aqua and Motif style, and that popup will happily grow larger than the desktop if you put enough data into it..PPThe two constructors create identical-looking comboboxes in Windows style..PPComboboxes can contain pixmaps as well as strings; the insertItem() and changeItem() functions are suitably overloaded. For editable comboboxes, the function clearEdit() is provided, to clear the displayed string without changing the combobox's contents..PPA combobox emits two signals, activated() and highlighted(), when a new item has been activated (selected) or highlighted (made current). Both signals exist in two versions, one with a QString argument and one with an \fCint\fR argument. If the user highlights or activates a pixmap, only the \fCint\fR signals are emitted. Whenever the text of an editable combobox is changed the textChanged() signal is emitted..PPWhen the user enters a new string in an editable combobox, the widget may or may not insert it, and it can insert it in several locations. The default policy is is AtBottom but you can change this using setInsertionPolicy()..PPIt is possible to constrain the input to an editable combobox using QValidator; see setValidator(). By default, any input is accepted..PPIf the combobox is not editable then it has a default focusPolicy() of TabFocus, i.e. it will not grab focus if clicked. This differs from both Windows and Motif. If the combobox is editable then it has a default focusPolicy() of StrongFocus, i.e. it will grab focus if clicked..PPA combobox can be populated using the insert functions, insertStringList() and insertItem() for example. Items can be changed with changeItem(). An item can be removed with removeItem() and all items can be removed with clear(). The text of the current item is returned by currentText(), and the text of a numbered item is returned with text(). The current item can be set with setCurrentItem() or setCurrentText(). The number of items in the combobox is returned by count(); the maximum number of items can be set with setMaxCount(). You can allow editing using setEditable(). For editable comboboxes you can set auto-completion using setAutoCompletion() and whether or not the user can add duplicates is set with setDuplicatesEnabled()..PP.ce 1.B "[Image Omitted]".PP(Motif 1, read-only).br.ce 1.B "[Image Omitted]".PP(Motif 2, editable).br.ce 1.B "[Image Omitted]".PP(Motif 2, read-only).br.ce 1.B "[Image Omitted]".PP(Windows style).PPSee also QLineEdit, QListBox, QSpinBox, QRadioButton, QButtonGroup, GUI Design Handbook: Combo Box, GUI Design Handbook: Drop-Down List Box, and Basic Widgets..SS "Member Type Documentation".SH "QComboBox::Policy"This enum specifies what the QComboBox should do when a new string is entered by the user..TP\fCQComboBox::NoInsertion\fR - the string will not be inserted into the combobox..TP\fCQComboBox::AtTop\fR - insert the string as the first item in the combobox..TP\fCQComboBox::AtCurrent\fR - replace the previously selected item with the string the user has entered..TP\fCQComboBox::AtBottom\fR - insert the string as the last item in the combobox.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -