Описание класса Q3ButtonGroupThe Q3ButtonGroup widget organizes QAbstractButton widgets in a group. Далее... #include <Q3ButtonGroup> Данный класс является частью библиотеки поддержки Qt 3. Он предоставлен для поддержки ранее написанного кода. Мы настоятельно не рекомендуем использовать этот класс в новом коде. Для получения дополнительной информации смотрите Портирование на Qt 4. Унаследован от: Q3GroupBox. От него наследуются: Q3HButtonGroup и Q3VButtonGroup. Свойства
Открытые функции
Сигналы
Переопределённые защищённые функции
Дополнительные унаследованные члены
Подробное описаниеThe Q3ButtonGroup widget organizes QAbstractButton widgets in a group. A button group widget makes it easier to deal with groups of buttons. Each button in a button group has a unique identifier. The button group emits a clicked() signal with this identifier when a button in the group is clicked. This makes a button group particularly useful when you have several similar buttons and want to connect all their clicked() signals to a single slot. An exclusive button group switches off all toggle buttons except the one that was clicked. A button group is, by default, non-exclusive. Note that all radio buttons that are inserted into a button group are mutually exclusive even if the button group is non-exclusive. (Смотрите setRadioButtonExclusive().) There are two ways of using a button group:
A button can be removed from the group with remove(). A pointer to a button with a given id can be obtained using find(). The id of a button is available using id(). A button can be set on with setButton(). The number of buttons in the group is returned by count(). Смотрите также QPushButton, QCheckBox и QRadioButton. Описание свойствexclusive : boolThis property holds whether the button group is exclusive. If this property is true, then the buttons in the group are toggled, and to untoggle a button you must click on another button in the group. Значение по умолчанию равно false. Функции доступа:
radioButtonExclusive : boolThis property holds whether the radio buttons in the group are exclusive. If this property is true (the default), the radio buttons in the group are treated exclusively. Функции доступа:
selectedId : intThis property holds the id of the selected toggle button. If no toggle button is selected, id() returns -1. If setButton() is called on an exclusive group, the button with the given id will be set to on and all the others will be set to off. Функции доступа:
Смотрите также selected(). Описание функций-членовQ3ButtonGroup::Q3ButtonGroup ( QWidget * parent = 0, const char * name = 0 )Constructs a button group with no title. The parent and name arguments are passed to the QWidget constructor. Q3ButtonGroup::Q3ButtonGroup ( const QString & title, QWidget * parent = 0, const char * name = 0 )Constructs a button group with the title title. The parent and name arguments are passed to the QWidget constructor. Q3ButtonGroup::Q3ButtonGroup ( int strips, Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0 )Constructs a button group with no title. Child widgets will be arranged in strips rows or columns (depending on orientation). The parent and name arguments are passed to the QWidget constructor. Q3ButtonGroup::Q3ButtonGroup ( int strips, Qt::Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 )Constructs a button group with title title. Child widgets will be arranged in strips rows or columns (depending on orientation). The parent and name arguments are passed to the QWidget constructor. Q3ButtonGroup::~Q3ButtonGroup ()Деструктор. void Q3ButtonGroup::clicked ( int id ) [signal]This signal is emitted when a button in the group is clicked. The id argument is the button's identifier. Смотрите также insert(). int Q3ButtonGroup::count () constReturns the number of buttons in the group. bool Q3ButtonGroup::event ( QEvent * e ) [virtual protected]Переопределено от QObject::event(). QAbstractButton * Q3ButtonGroup::find ( int id ) constReturns the button with the specified identifier id, or 0 if the button was not found. int Q3ButtonGroup::id ( QAbstractButton * button ) constReturns the id of button, or -1 if button is not a member of this group. Смотрите также selectedId(). int Q3ButtonGroup::insert ( QAbstractButton * button, int id = -1 )Inserts the button with the identifier id into the button group. Returns the button identifier. Buttons are normally inserted into a button group automatically by passing the button group as the parent when the button is constructed. So it is not necessary to manually insert buttons that have this button group as their parent widget. An exception is when you want custom identifiers instead of the default 0, 1, 2, etc., or if you want the buttons to have some other parent. The button is assigned the identifier id or an automatically generated identifier. It works as follows: If id >= 0, this identifier is assigned. If id == -1 (default), the identifier is equal to the number of buttons in the group. If id is any other negative integer, for instance -2, a unique identifier (negative integer <= -2) is generated. No button has an id of -1. Смотрите также find(), remove() и setExclusive(). void Q3ButtonGroup::pressed ( int id ) [signal]This signal is emitted when a button in the group is pressed. The id argument is the button's identifier. Смотрите также insert(). void Q3ButtonGroup::released ( int id ) [signal]This signal is emitted when a button in the group is released. The id argument is the button's identifier. Смотрите также insert(). void Q3ButtonGroup::remove ( QAbstractButton * button )Removes the button from the button group. Смотрите также insert(). QAbstractButton * Q3ButtonGroup::selected () constReturns the selected toggle button if exactly one is selected; otherwise returns 0. Смотрите также selectedId(). |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |