QGManager Class Reference


The QGManager class provides one-dimensional geometry management. More...

#include <qgmanagr.h>

Inherits QObject.

List of all member functions.

Public Members

Protected Members


Detailed Description

The QGManager class provides one-dimensional geometry management.

This class is intended for those who write geometry managers and graphical designers. It is not for the faint of heart. The QBoxLayout and QGridLayout classes are available for normal application programming.

Each dimension (horizontal and vertical) is handled independently. Widgets are organized in chains, which can be parallel or serial.

In a serial chain, elements are added one after another. Available space is divided among the elements according to stretch and max-/minsize.

In parallel chains, elements are added on top of each other. All elements are given the full length of the chain, and are placed at the same position.

See also: QBoxLayout and QGridLayout.


Member Function Documentation

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

Creates a new QGManager which manages parent's children.

QGManager::~QGManager ()

Destroys the QGManager, deleting all add()ed chains.

bool QGManager::activate ()

Starts geometry management.

bool QGManager::add ( QChain *destination, QChain *source, int stretch = 0)

Adds the chain source to the chain destination.

bool QGManager::addBranch ( QChain *destination, QChain *branch, int fromIndex, int toIndex)

Adds branch to destination as a branch going from fromIndex to toIndex. A branch is a chain that is anchored at two locations in a serial chain. The branch does not influence the main chain; if the branch's minimum size is greater than the minimum distance between the anchors, things will look ugly.

The branch goes from the beginning of the item at fromIndex to the end of the item at toIndex. Note: remember to count spacing when calculating indices.

Warning: This feature is new and not comprehensively tested.

bool QGManager::addSpacing ( QChain *d, int minSize, int stretch = 0, int maxSize = unlimited)

Adds the spacing w to the chain d. If d is a serial chain, this means screen space between widgets. If d is parallel, this influences the maximum and minimum size.

bool QGManager::addWidget ( QChain *d, QWidget *w, int stretch = 0)

Adds the widget w to the chain d.

bool QGManager::eventFilter ( QObject *o, QEvent *e) [virtual protected]

Grabs all resize events for my parent, and does child widget resizing.

Reimplemented from QObject.

void QGManager::freeze ( int w = 0, int h = 0)

Fixes the size of the main widget and distributes the available space to the child widgets. The size is adjusted to a valid value. Thus freeze(0,0) (the default) will fix the widget to its minimum size.

QWidget * QGManager::mainWidget ()

Returns the main widget of the manager.

QChain * QGManager::newParChain ( Direction d)

Creates a new QChain which is parallel.

QChain * QGManager::newSerChain ( Direction d)

Creates a new QChain which is serial.

void QGManager::setBorder ( int b)

Sets the border around the edge of the widget. b is the number of pixels between the edge of the widget and the area controlled by the manager.

void QGManager::setMenuBar ( QWidget *w)

Makes the geometry manager take account of the menu bar w. All child widgets are placed below the bottom edge of the menu bar.

void QGManager::setStretch ( QChain *c, int s)

Sets the stretch factor on c to s. This stretch factor is overridden by add(), so there's no point in calling this function before you add() the chain.

See also: add().

QChain * QGManager::xChain ()

Returns the main horizontal chain of the manager. All horizontal chains should be inserted into this chain or one of its descendants, otherwise they will be ignored.

QChain * QGManager::yChain ()

Returns the main vertical chain of the manager. All vertical chains should be inserted into this chain or one of its descendants, otherwise they will be ignored.


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

It was generated from the following files:


Generated at 17:29, 1997/04/07 for Qt version 1.2 by the webmaster at Troll Tech