-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunit03.tex
More file actions
72 lines (63 loc) · 3.34 KB
/
unit03.tex
File metadata and controls
72 lines (63 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
\documentclass[notes.tex]{subfiles}
\begin{document}
\setcounter{chapter}{2}
\chapter{Multiple Documents and Layouts}
\section{Multiple Document Interface (MDI)}
Applications that provide one document per main window are said to be SDI (single-document interface) applications. A multiple-document interface (MDI) consists of a main window containing a menu bar, toolbar, and a central \verb|QWorkspace| widget. The central workspace displays and manages several child windows.
To implement an MDI, use an instance of \verb|QMdiArea|. This widget provides an area where child windows (\concept{subwindows}) are displayed. It arranges subwindows in a \concept{cascade} or \concept{tile} pattern. The subwindows are instances of \verb|QMdiSubWindow|. They are rendered within a frame that has a title, and buttons to show, hide and maximise it.
\begin{sidenote}{QMdiArea Methods}
\begin{itemize}[nosep]
\item \verb|subWindowList()|
\item \verb|windowOrder()|
\begin{itemize}[nosep]
\item \verb|CreationOrder| (Default)
\item \verb|StackingOrder|
\item \verb|ActivationHistoryOrder|
\end{itemize}
\item \verb|activateNextSubWindow()|
\item \verb|activatePreviousSubWindow()|
\item \verb|cacadeSubWindows()|
\item \verb|tileSubWindows()|
\item \verb|closeAllSubWindows()|
\item \verb|setViewMode()|
\begin{itemize}[nosep]
\item \verb|SubWindow View|: (Default) Displays subwindows with window frames. Represented by $0$.
\item \verb|Tabbed View|: Displays subwindows with tabs in a tab bar. Represented by $1$.
\end{itemize}
\end{itemize}
\end{sidenote}
\section{Layouts}
\begin{definition}{Layout}
Used to arrange and manage the widgets that make up a user interface within its container.
\end{definition}
Each widget has a recommended size defined in its \verb|sizeHint| property. When windows are resized, widgets in a layout are resized to meet their size hint.
To avoid excessive spreading of widgets when the window size is increased, use \concept{spacers}.
\subsection{Horizontal Layout}
Lays widgets next to each other in a row.
\begin{definition}{Group Box}
Used to represent information that is related in some way. An instance of \verb|QGroupBox|. Appears in a frame with a title.
Child widgets within a Group Box can be aligned and enabled or disabled collectively with a CheckBox.
\begin{sidenote}{QGroupBox Properties}
\begin{description}
\item[checkable] Display a checkbox in Group Box's title. Child widgets enabled only when checkbox is checked. By default, GroupBoxes are not checkable.
\item[flat] Space consumed by GroupBox is reduced.
\end{description}
\end{sidenote}
\begin{sidenote}{QGroupBox Methods}
\vspace*{-0.5cm}
\begin{multicols}{3}
\begin{itemize}[nosep]
\item \verb|isCheckable()|
\item \verb|isChecked()|
\item \verb|setChecked()|
\end{itemize}
\end{multicols}
\end{sidenote}
Generates a \verb|clicked()| signal when the checkbox is selected, or when its shortcut key is pressed.
\end{definition}
\subsection{Vertical Layout}
Arrange widgets vertically, in a column one below another.
\subsection{Other Layouts}
Other layouts include GridLayout, and FormLayout.
\rulechapterend
\end{document}