QButtonGroup Class Reference


The QButtonGroup widget organizes QButton widgets in a group. (details) (complete member list)

#include <qbttngrp.h>

Inherits QGroupBox.

Public Members

Signals

Protected Slots


Detailed Description

The QButtonGroup widget organizes QButton widgets in a group.

A button group widget makes it easier to deal with groups of buttons. A button in a button group can be associated with a unique identifer. The button group emits a clicked() signal with this identifier when the button is clicked.

A button group which contains radio buttons (QRadioButton) will switch off all radio buttons except the one that was clicked.

There are two standard ways of using a button group:

  1. A button group can be a normal parent widget for a set of buttons. Because QButtonGroup inherits QGroupBox, it can display a frame and a title. The buttons get identifiers 0, 1, 2 etc. in the order they are inserted.
  2. A button group can be an invisible widget and the contained buttons have some other parent widget. A button must be manually inserted using the insert() function with an identifer.

Member Function Documentation

QButtonGroup::QButtonGroup (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.

QButtonGroup::QButtonGroup (const char *title, QWidget *parent=0, const char *name=0)

Constructs a button group with a title.

The parent and name arguments are passed to the QWidget constructor.

QButtonGroup::~QButtonGroup ()

Destroys the button group and its child widgets.

void QButtonGroup::buttonClicked ()

.

int QButtonGroup::insert (QButton *button, int id=-1)

Inserts a button with the identifier id into the button group.

If id is -1, then the button will get an identifier (number of buttons in the group). Inserting several buttons with id = -1 will assign the identifers 0, 1, 2, etc.

void QButtonGroup::remove (QButton *button)

Removes a button from the button group.


This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.

It was generated from the following files:


Generated at 16:17, 1995/06/30 by the webmaster at Troll Tech