[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: QextMDI -> KDE ?
From: Matthias Ettrich <ettrich () troll ! no>
Date: 1999-11-11 14:23:26
[Download RAW message or body]
> >When is QWorkSpace ready? Ok, it has been a while since I looked at those
> >particular files ;-)
>
> I think it will be included in the 2.1 release. But Matthias will decide that.
It will be included in 2.1. It's also in the current snapshots, btw. For those
interested, I attach parts of the the reference documentation in development
(the snapshots still have problems with generated documentation, I'm afraid.).
What I personally like with QWorkspace is that it's extremely easy to use. The
entire API consists of two functions and one signal (with one function being a
convenience function).
That reminds on something: I will add an "mdi" example to the Qt examples.
Tomorrows snapshot will include that.
Matthias
--------------------------------------------------
QWorkspace qworkspace.h
The QWorkspace widget provides a workspace that can contain
decorated windows as opposed to frameless child widgets. QWorkspace
makes it easy to implement a multidocument interface (MDI).
An MDI application has one main window that has a menubar. The
central widget of this main window is a workspace. The workspace
itself contains zero, one or several document windows, each of which
displays a document.
The menubar and the toolbars act as a roadmap to the
application. You get to keep the same map all the time, even if you
open three different documents in three different child windows and
switch around among them.
The workspace itself is an ordinary Qt widget. It has a standard
constructor that takes a parent widget and an object name. Document
windows, so-called MDI windows, are also ordinary Qt widgets. They
may even be main windows itself, in case your application design
requires specific toolbars or statusbars for them. The only special
thing about them is that you create them with the workspace as
parent widget. The rest of the magic happens behind the scenes. All
you have to do is call QWidget::show() or QWidget::showMaximized()
(as you would do with normal toplevel windows) and the document
window appears as MDI window inside the workspace.
In addition to show, QWidget::hide(), QWidget::showMaximized(),
QWidget::showNormal(), QWidget::showMinimized() also work as
expected for the document windows.
A document window becomes active when it gets the focus. This can be
achieved by calling QWidget::setFocus(). The workspace emits a
signal clientActivated() when it detects the activation change. The
active client itself can be obtained with activeClient().
The convenience function clientList() returns a list of all document
windows. This is especially useful to create a popup menu "&Windows"
on the fly.
If the user clicks on the frame of an MDI window, this window
becomes active, i.e. it gets the focus. For that reason, all direct
children of a QWorkspace have to be focus enabled. If your MDI
window does not handle focus itself, use QWidget::setFocusProxy() to
install a focus-enabled child widget as focus proxy.
In general, modern GUI applications should be document-centric
rather then application-centric. A single document interface (SDI)
guarantees a bijective mapping between open documents and open
windows on the screen. This makes the model very easy to understand
and therefore the natural choice for applications targeted on
inexperienced users. Typical examples are modern
wordprocessors. Although most wordprocessors were MDI applications
in the past, user interface studies showed that many users never
really understood the model.
If an application is supposed to be used mostly by experienced
users, a multiple document interface may neverthless make sense. A
typical example is an integrated development environment (IDE). With
an IDE, a document is a project. The project itself consists of an
arbitrary number of subdocuments, mainly code files but also other
data. MDI offers a good possibility to group these subdocuments
together in one main window. The menubar and the toolbars form a
stable working context for the users to grasp and it is
crystal-clear which subdocuments belong together. Furthermore, the
user effort for window management tasks such as positioning,
stacking and sizing is significantly reduced.
An alternative to MDI with QWorkspace is a multipane structure. This
can be achived by tiling the main window into separate panes with a
\l QSplitter.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic