@ -54,7 +54,7 @@ controlling the use of these libraries.
<p><h2> Freetype 2 (freetype)
</h2>
<aname="1"></a><p><em>The FreeType project is a team of volunteers who develop free, portable and high-quality software solutions for digital typography. We specifically target embedded systems and focus on bringing small, efficient and ubitquitous products.</em> -- quoted from <tt>3rdparty/freetype/docs/freetype2.html</tt>.
<aname="1"></a><p><em>The FreeType project is a team of volunteers who develop free, portable and high-quality software solutions for digital typography. We specifically target embedded systems and focus on bringing small, efficient and ubiquitous products.</em> -- quoted from <tt>3rdparty/freetype/docs/freetype2.html</tt>.
<p> See <tt>3rdparty/freetype/docs/FIL.txt</tt> and <tt>3rdparty/freetype/docs/GPL.txt</tt> for license details.
<p> See also the files in <tt>3rdparty/opentype</tt> which are used by
Freetype.
@ -79,7 +79,7 @@ Freetype.
</h2>
<aname="6"></a><p><em>The Helvetica BDF font files supplied with TQt/Embedded are distributed under the following highly permissive license. We recommend that all TQt/Embedded installations that use these font files also acknowledge this contribution, and quote this license statement in an appendix to the documentation.</em> -- located in <tt>lib/fonts</tt>
<p> Copyright 1984-1989, 1994 Adobe Systems Incorporated.
<p> Copyright 1988, 1994 Digital Etquipment Corporation.
<p> Copyright 1988, 1994 Digital Equipment Corporation.
<p> Adobe is a trademark of Adobe Systems Incorporated which may be
registered in certain jurisdictions.
Permission to use these trademarks is hereby granted only in
@ -89,10 +89,10 @@ and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notices appear in all
copies and that both those copyright notices and this permission
notice appear in supporting documentation, and that the names of
Adobe Systems and Digital Etquipment Corporation not be used in
Adobe Systems and Digital Equipment Corporation not be used in
advertising or publicity pertaining to distribution of the software
without specific, written prior permission. Adobe Systems and
Digital Etquipment Corporation make no representations about the
Digital Equipment Corporation make no representations about the
suitability of this software for any purpose. It is provided "as
<p>Although the new version of <em>TQt Designer</em> introduces new approaches and techniques you can ignore these aspects and simply use it in exactly the same way as you used the version supplied with TQt 2.x, if you just want a simple but powerful single dialog visual design tool.</p>
<h4><aname="3-1"></a>What's New in <em>TQt Designer</em> for TQt 3.1?</h4>
<ul><li><p><em>TQt Designer</em> now features a start-up dialog for fast access to recently used files, etc. (It can be switched off if you don't want it.)</p>
<li><p>The signals and slots dialog has changed significantly. It is far easier to use and much faster for creating lots of connections in one go. You can still click and drag to create connections, but the new dialog is much tquicker.</p>
<li><p>The signals and slots dialog has changed significantly. It is far easier to use and much faster for creating lots of connections in one go. You can still click and drag to create connections, but the new dialog is much quicker.</p>
<li><p>Widgets are now accessible using the Toolbox. (All the original toolbars are still available.) This provides the same easy access as toolbar buttons, and also shows the names of the widgets and takes up less space.</p>
<li><p><ahref="ntqwidgetstack.html">TQWidgetStack</a> is now available as a container widget. The new example demonstrates its use.</p>
<li><p><tt>.ui.h</tt> files may now contain arbitrary C++, including <tt>const</tt> definitions, <tt>#include</tt>s, plain functions, etc.</p>
<p>The 'Navigation and Editing' wizard page is used to create navigation and editing buttons.</p>
<p>Check the 'Include Navigation Buttons' checkbox to include navigation buttons. In the 'Navigation section, click 'Previous' to display the 'Previous' button on the form. This option allows you to navigate to the previous record in the table. Click 'Next' to display the 'next' button on the form. This button allows you to navigate to the next record in the table. Click 'First' to display the 'First' button on the form. This option allows you to navigate to the first record in the table. Click 'Last' to display the 'Last' button on the form. This button allows you to navigate to the last record in the table.</p>
<p>Click the 'Include Edit Buttons' checkbox to include editing buttons. In the 'Editing' section, check the 'Insert' checkbox to create an 'Insert' button for adding new records. Check the 'Update' checkbox to create an 'Update' button for updating existing records. Check the 'Delete' checkbox to create a 'Delete' button for deleting records.</p>
<p>The navigation buttons, and 'Update' and 'Delete' buttons will work without retquiring any code. Since most database designs expect new records to be created with a unique key the 'Insert' button will not work. This can easily be fixed by generating the key in a slot connected to the <tt>TQDataBrowser::beforeInsert()</tt> signal.</p>
<p>The navigation buttons, and 'Update' and 'Delete' buttons will work without requiring any code. Since most database designs expect new records to be created with a unique key the 'Insert' button will not work. This can easily be fixed by generating the key in a slot connected to the <tt>TQDataBrowser::beforeInsert()</tt> signal.</p>
<p>Click <b>Next</b> to move on to the next wizard page. Click <b>Back</b> if you want to return to the 'Displayed Fields' wizard page.</p>
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><palign="right">[<ahref="designer-manual-1.html">Prev: Preface</a>] [<ahref="designer-manual.html">Home</a>] [<ahref="designer-manual-3.html">Next: Creating a Main Window Application</a>]</p>
<h2align="center">Quick Start</h2>
<p>This chapter provides a tquick start for users of <em>TQt Designer</em>. The chapter takes you step-by-step through the creation of a small dialog-style metric conversion application. It introduces many of the common tasks users perform when creating an application: adding widgets to a form, setting widget properties, making connections between signals and slots, laying out widgets, and adding custom code. This chapter only covers a portion of <em>TQt Designer</em>'s functionality; explanations and details are mostly left for the more detailed <tt>colortool</tt> tutorial presented in chapters two and three.</p>
<p>This chapter provides a quick start for users of <em>TQt Designer</em>. The chapter takes you step-by-step through the creation of a small dialog-style metric conversion application. It introduces many of the common tasks users perform when creating an application: adding widgets to a form, setting widget properties, making connections between signals and slots, laying out widgets, and adding custom code. This chapter only covers a portion of <em>TQt Designer</em>'s functionality; explanations and details are mostly left for the more detailed <tt>colortool</tt> tutorial presented in chapters two and three.</p>
<p>We need to add spacers to absorb redundant space in our dialog, so that it will lay out nicely at any size. Usually spacers are added as you experiment with the layout but, since this is a tquick guide to <em>TQt Designer</em>, and we already know that they will be needed, we will add the spacers now.</p>
<p>We need to add spacers to absorb redundant space in our dialog, so that it will lay out nicely at any size. Usually spacers are added as you experiment with the layout but, since this is a quick guide to <em>TQt Designer</em>, and we already know that they will be needed, we will add the spacers now.</p>
<ul><li><p>Click the <b>Common Widgets</b> button in the Toolbox.</p>
<li><p>Click the <b>Spacer</b> button. Click to the right of the "Decimal" label, drag right towards the spinbox, then release. A horizontal spacer will appear.</p>
<li><p>Click the <b>Spacer</b> button again. Click to the right of the Calculate push button, drag right towards the Quit push button, then release.</p>
<p>The <tt>colortool</tt> application is a multiplatform application that allows users to create, edit and save lists of colors. Each color has a user defined name and an RGB (Red, Green, Blue) value.</p>
<p>This application presents the user with a view of a set of colors and their names. We will provide two views (using a <ahref="ntqwidgetstack.html">TQWidgetStack</a>) which the user can switch between. The tabular view will show each color as a small square followed by its name and hex value. It will also provide the option of an indicator to show whether or not the color is one of the 216 standard web colors. The iconic view will show each color as a circular color swatch with the name of the color beneath.</p>
<p>The application will read and write files in the format used by the X Consortium for the <tt>rgb.txt</tt> file. This will allow users to create their own color files and to load, edit and save <tt>rgb.txt</tt> format files.</p>
<p>We will provide a simple search option so that users can tquickly locate a color; this is particularly useful when hundreds or thousands of colors are shown. The search will be provided in a modeless dialog so that the user can conduct a search but still interact with the main form. We will also enable the user to add and delete colors, and to set some user options. To provide these facilities, we must create some modal dialogs.</p>
<p>We will provide a simple search option so that users can quickly locate a color; this is particularly useful when hundreds or thousands of colors are shown. The search will be provided in a modeless dialog so that the user can conduct a search but still interact with the main form. We will also enable the user to add and delete colors, and to set some user options. To provide these facilities, we must create some modal dialogs.</p>
<p>Finally, we must ensure that the application loads user options at start up and saves user options at termination. We will also include the view and the size and position of the main window with these options, so that the application will always start with the size, position and view it had when the user last used it.</p>
<palign="center"><imgalign="middle"src="mw-colortool2.png"alt="The Color Tool application"width="580"height="485">
<!-- index Layouts --><!-- index Scaling widgets and application windows --><!-- index Automatically scaling widgets and application windows --><!-- index Absolute positioning --><p>Layouts provide a means of laying out widgets, groups of widgets, and layouts into horizontal and vertical pairs and into grids. If you use layouts your forms, and the widgets they contain, will scale automatically when the user resizes the window. This is better than using absolute sizes and positions since you don't have to write any code to achieve the scaling and your users can make the most of their screen size whether they have a laptop or a very large screen desktop machine. Layouts use standard sizes for margins and widget spacing which helps give your applications a consistent and proportional look without retquiring any effort on your part. Layouts are also easier and faster to use than absolute positioning; you can just place your widgets on the form in approximate positions and leave the layout tools to size and scale the widgets correctly.</p>
<!-- index Layouts --><!-- index Scaling widgets and application windows --><!-- index Automatically scaling widgets and application windows --><!-- index Absolute positioning --><p>Layouts provide a means of laying out widgets, groups of widgets, and layouts into horizontal and vertical pairs and into grids. If you use layouts your forms, and the widgets they contain, will scale automatically when the user resizes the window. This is better than using absolute sizes and positions since you don't have to write any code to achieve the scaling and your users can make the most of their screen size whether they have a laptop or a very large screen desktop machine. Layouts use standard sizes for margins and widget spacing which helps give your applications a consistent and proportional look without requiring any effort on your part. Layouts are also easier and faster to use than absolute positioning; you can just place your widgets on the form in approximate positions and leave the layout tools to size and scale the widgets correctly.</p>
<aname="adding-the-widgets-subsection"></a><h5><aname="1-2-2"></a>Adding the Widgets</h5>
<p>We can use one of TQt's static dialogs to get the user to choose a color, but we need our own dialog to get them to give it a name. We'll create that dialog now.</p>
<p>Click <b>File|New</b> to invoke the <em>New File</em> dialog, then click "Dialog", then click <b>OK</b>. Drag a corner of the new form to make it a lot smaller. Change the form's name (in the <ahref="designer-manual-3.html#using-the-property-editor-sidebar">Property Editor</a>) to "ColorNameForm", and change its caption to "Color Tool -- Color Name". Click <b>File|Save</b>, then click <b>Save</b> to save it.</p>
<p>Click the ButtonGroup tool and click below the table view group box. Change this group's <em>title</em> property to "Copy to Clipboard As" and drag a corner to make it larger.</p>
<p>We want to add three radio buttons to the clipboard group. When there are a lot of identical widgets to add we can use <em>TQt Designer</em>'s multiple placement mode to work more tquickly.</p>
<p>We want to add three radio buttons to the clipboard group. When there are a lot of identical widgets to add we can use <em>TQt Designer</em>'s multiple placement mode to work more quickly.</p>
<p><em>Double</em> click the RadioButton tool to enter multiple placement mode. Now every click on the form will create a radio button. Click inside, and towards the top of, the clipboard group box. Click below the first radio button. Click for a third time, below the second radio button. Now click the Pointer toolbar button to cancel multiple placement mode.</p>
<p>The 'book' table is simplified for the purposes of the example. It can only relate a book to a single author (authorid) and lacks an ISBN field. The 'sequence' table is used for generating unique index values for the example tables. Note that SQL databases often provide their own method for creating sequences (for example, using the <tt>CREATE SETQUENCE</tt> command) which is very likely to be a more optimal solution. For the sake of portability the examples will use a 'sequence' table which will work with the vast majority of SQL databases.</p>
<p>The 'book' table is simplified for the purposes of the example. It can only relate a book to a single author (authorid) and lacks an ISBN field. The 'sequence' table is used for generating unique index values for the example tables. Note that SQL databases often provide their own method for creating sequences (for example, using the <tt>CREATE SEQUENCE</tt> command) which is very likely to be a more optimal solution. For the sake of portability the examples will use a 'sequence' table which will work with the vast majority of SQL databases.</p>
</blockquote>
<h3><aname="1"></a>Setting Up Database Connections</h3>
<!-- index Databases!Connecting to Database Servers --><!-- index Connecting!Databases to Database Servers --><p>There are two aspects of database connections that we must consider. Firstly the connection we wish to use within <em>TQt Designer</em> itself, and secondly the connection we wish to use in the applications that we create.</p>
<p>GTK+ provides a class called GtkPacker that provides for exotic layouts; TQt does not provide a <b>TQPackerLayout</b> and none is planned. <em>TQt Designer</em> will treat packer layouts as if they were vertical layouts and you will probably have to change them to whatever combination of layouts that produces the right effect.</p>
<li><p>Incorrectly-justified text after conversion</p>
<p>The "<em>hAlign</em>" property is sometimes set wrongly, in which case you have to change it manually. It is caused by a tquirk in Glade.</p>
<p>The "<em>hAlign</em>" property is sometimes set wrongly, in which case you have to change it manually. It is caused by a quirk in Glade.</p>
</ul></ul><p>It's tquickest to press <b>Alt+D</b> (which clicks the <em>Done & Next</em> button) after typing each translation, since this marks the translation as done and moves on to the next source text.</p>
</ul></ul><p>It's quickest to press <b>Alt+D</b> (which clicks the <em>Done & Next</em> button) after typing each translation, since this marks the translation as done and moves on to the next source text.</p>
<p>Save the file and do the same for Dutch working with <tt>tt2_nl.ts</tt>:</p>
widget, we can extend the interface easily. We can use some of the
more advanced features of <ahref="ntqmainwindow.html">TQMainWindow</a>, which includes dockable
toolbars. Adding these is simple with the <em>TQt Designer</em>. The
final version of our project includes a toolbar, which provides tquick
final version of our project includes a toolbar, which provides quick
access to the <em>Open</em>, <em>Save</em>, <em>Print</em>, <em>New Page</em> and <em>Delete to Trash</em> actions.
<p> The possibilities are endless. An <em>Edit</em> menu, with the common <em>Cut</em>, <em>Copy</em> and <em>Paste</em> actions, could be added in a relatively
short period of time. As our project expands to other platforms, we
</ul><p> Although <ahref="#BackgroundMode-enum">FixedColor</a> and <ahref="#BackgroundMode-enum">FixedPixmap</a> are sometimes just
right, if you use them, make sure that you test your application
when the desktop color scheme has been changed. (On X11, a tquick
when the desktop color scheme has been changed. (On X11, a quick
way to test this is e.g. "./myapp -bg paleblue". On Windows, you
must use the control panel.)
<p><p>See also <ahref="ntqwidget.html#backgroundMode-prop">TQWidget::backgroundMode</a>, <ahref="ntqwidget.html#backgroundMode-prop">TQWidget::backgroundMode</a>, <ahref="ntqwidget.html#setBackgroundPixmap">TQWidget::setBackgroundPixmap</a>(), and <ahref="ntqwidget.html#paletteBackgroundColor-prop">TQWidget::paletteBackgroundColor</a>.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>TQToolButton Class Reference</h1>
<p>The TQToolButton class provides a tquick-access button to
<p>The TQToolButton class provides a quick-access button to
commands or options, usually used inside a TQToolBar.
@ -74,7 +74,7 @@ The QCanvasPolygonalItem class provides a polygonal canvas item on a QCanvas.
.PP
The mostly rectangular classes, such as QCanvasSprite and QCanvasText, use the object's bounding rectangle for movement, repainting and collision calculations. For most other items, the bounding rectangle can be far too large -- a diagonal line being the worst case, and there are many other cases which are also bad. QCanvasPolygonalItem provides polygon-based bounding rectangle handling, etc., which is much faster for non-rectangular items.
.PP
Derived classes should try to define as small an area as possible to maximize efficiency, but the polygon must \fIdefinitely\fR be contained completely within the polygonal area. Calculating the exact requirements is usually difficult, but if you allow a small overestimate it can be easy and tquick, while still getting almost all of QCanvasPolygonalItem's speed.
Derived classes should try to define as small an area as possible to maximize efficiency, but the polygon must \fIdefinitely\fR be contained completely within the polygonal area. Calculating the exact requirements is usually difficult, but if you allow a small overestimate it can be easy and quick, while still getting almost all of QCanvasPolygonalItem's speed.
.PP
Note that all subclasses \fImust\fR call hide() in their destructor since hide() needs to be able to access areaPoints().
@ -107,7 +107,7 @@ Use width() and height() to retrieve the dimensions of the current frame.
.PP
Use leftEdge() and rightEdge() to retrieve the current frame's left-hand and right-hand x-coordinates respectively. Use bottomEdge() and topEdge() to retrieve the current frame's bottom and top y-coordinates respectively. These functions have an overload which will accept an integer frame number to retrieve the coordinates of a particular frame.
.PP
QCanvasSprite draws very tquickly, at the expense of memory.
QCanvasSprite draws very quickly, at the expense of memory.
.PP
The current frame's image can be drawn on a painter with draw().
@ -293,7 +293,7 @@ QDataTable supports various functions for presenting and editing SQL data from a
.PP
If you want a to present your data in a form use QDataBrowser, or for read-only forms, QDataView.
.PP
When displaying data, QDataTable only retrieves data for visible rows. If the driver supports the 'query size' property the QDataTable will have the correct number of rows and the vertical scrollbar will accurately reflect the number of rows displayed in proportion to the number of rows in the dataset. If the driver does not support the 'query size' property, rows are dynamically fetched from the database on an as-needed basis with the scrollbar becoming more accurate as the user scrolls down through the records. This allows extremely large queries to be displayed as tquickly as possible, with minimum memory usage.
When displaying data, QDataTable only retrieves data for visible rows. If the driver supports the 'query size' property the QDataTable will have the correct number of rows and the vertical scrollbar will accurately reflect the number of rows displayed in proportion to the number of rows in the dataset. If the driver does not support the 'query size' property, rows are dynamically fetched from the database on an as-needed basis with the scrollbar becoming more accurate as the user scrolls down through the records. This allows extremely large queries to be displayed as quickly as possible, with minimum memory usage.
.PP
QDataTable inherits QTable's API and extends it with functions to sort and filter the data and sort columns. See setSqlCursor(), setFilter(), setSort(), setSorting(), sortColumn() and refresh().
Returns the number of pixels by which the image is intended to be offset by when positioning relative to other images.
.SH "bool QImage::operator!= ( const QImage & i ) const"
Returns TRUE if this image and image \fIi\fR have different contents; otherwise returns FALSE. The comparison can be slow, unless there is some obvious difference, such as different widths, in which case the function will return tquickly.
Returns TRUE if this image and image \fIi\fR have different contents; otherwise returns FALSE. The comparison can be slow, unless there is some obvious difference, such as different widths, in which case the function will return quickly.
@ -762,7 +762,7 @@ If the image shares data with other images, it will first dereference the shared
.PP
Makes a call to QPixmap::convertToImage().
.SH "bool QImage::operator== ( const QImage & i ) const"
Returns TRUE if this image and image \fIi\fR have the same contents; otherwise returns FALSE. The comparison can be slow, unless there is some obvious difference, such as different widths, in which case the function will return tquickly.
Returns TRUE if this image and image \fIi\fR have the same contents; otherwise returns FALSE. The comparison can be slow, unless there is some obvious difference, such as different widths, in which case the function will return quickly.
@ -306,7 +306,7 @@ l - l. Function Description text() Returns the text in a column. Many subclasses
.fi
</center>
.PP
Some subclasses call setExpandable(TRUE) even when they have no children, and populate themselves when setup() or setOpen(TRUE) is called. The dirview/dirview.cpp example program uses this technique to start up tquickly: The files and subdirectories in a directory aren't inserted into the tree until they're actually needed.
Some subclasses call setExpandable(TRUE) even when they have no children, and populate themselves when setup() or setOpen(TRUE) is called. The dirview/dirview.cpp example program uses this technique to start up quickly: The files and subdirectories in a directory aren't inserted into the tree until they're actually needed.
@ -202,7 +202,7 @@ Returns the active color group. Use active() instead.
.PP
See also setActive() and active().
.SH "bool QPalette::operator!= ( const QPalette & p ) const"
Returns TRUE (slowly) if this palette is different from \fIp\fR; otherwise returns FALSE (usually tquickly).
Returns TRUE (slowly) if this palette is different from \fIp\fR; otherwise returns FALSE (usually quickly).
.SH "QPalette & QPalette::operator= ( const QPalette & p )"
Assigns \fIp\fR to this palette and returns a reference to this palette.
.PP
@ -210,7 +210,7 @@ This is fast (it uses copy-on-write).
.PP
See also copy().
.SH "bool QPalette::operator== ( const QPalette & p ) const"
Returns TRUE (usually tquickly) if this palette is equal to \fIp\fR; otherwise returns FALSE (slowly).
Returns TRUE (usually quickly) if this palette is equal to \fIp\fR; otherwise returns FALSE (slowly).
.SH "int QPalette::serialNumber () const"
Returns a number that uniquely identifies this QPalette object. The serial number is intended for caching. Its value may not be used for anything other than equality testing.
@ -234,7 +234,7 @@ You can retrieve the width(), height(), depth() and size() of a pixmap. The encl
.PP
In addition to loading a pixmap from file using load() you can also loadFromData(). You can control optimization with setOptimization() and obtain a transformed version of the pixmap using xForm()
.PP
Note regarding Windows 95 and 98: on Windows 9x the system crashes if you create more than about 1000 pixmaps, independent of the size of the pixmaps or installed RAM. Windows NT-systems (including 2000, XP and following versions) do not have the same limitation, but depending on the graphics etquipment the system will fail to allocate pixmap objects at some point (due to system running out of GDI resources).
Note regarding Windows 95 and 98: on Windows 9x the system crashes if you create more than about 1000 pixmaps, independent of the size of the pixmaps or installed RAM. Windows NT-systems (including 2000, XP and following versions) do not have the same limitation, but depending on the graphics equipment the system will fail to allocate pixmap objects at some point (due to system running out of GDI resources).
.PP
Qt tries to work around the resource limitation. If you set the pixmap optimization to QPixmap::MemoryOptim and the width of your pixmap is less than or equal to 128 pixels, Qt stores the pixmap in a way that is very memory-efficient when there are many pixmaps.
@ -160,7 +160,7 @@ Returns TRUE if both the x value and the y value are 0; otherwise returns FALSE.
.SH "int QPoint::manhattanLength () const"
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point. The tradition arises because such distances apply to travelers who can only travel on a rectangular grid, like the streets of Manhattan.
.PP
This is a useful, and tquick to calculate, approximation to the true length: sqrt(pow(x(),2)+pow(y(),2)).
This is a useful, and quick to calculate, approximation to the true length: sqrt(pow(x(),2)+pow(y(),2)).
.SH "QPoint & QPoint::operator*= ( int c )"
Multiplies this point's x and y by \fIc\fR, and returns a reference to this point.
@ -368,7 +368,7 @@ Set this property's value with setLabelText() and get this property's value with
.SH "int minimumDuration"
This property holds the time that must pass before the dialog appears.
.PP
If the expected duration of the task is less than the minimumDuration, the dialog will not appear at all. This prevents the dialog popping up for tasks that are tquickly over. For tasks that are expected to exceed the minimumDuration, the dialog will pop up after the minimumDuration time or as soon as any progress is set.
If the expected duration of the task is less than the minimumDuration, the dialog will not appear at all. This prevents the dialog popping up for tasks that are quickly over. For tasks that are expected to exceed the minimumDuration, the dialog will pop up after the minimumDuration time or as soon as any progress is set.
.PP
If set to 0, the dialog is always shown as soon as any progress is set. The default is 4000 milliseconds.
@ -52,7 +52,7 @@ For example, suppose we have an application that stores data in a large tree str
.PP
A non-computing example of a semaphore would be dining at a restuarant. A semaphore is initialized to have a maximum count equal to the number of chairs in the restuarant. As people arrive, they want a seat. As seats are filled, the semaphore is accessed, once per person. As people leave, the access is released, allowing more people to enter. If a party of 10 people want to be seated, but there are only 9 seats, those 10 people will wait, but a party of 4 people would be seated (taking the available seats to 5, making the party of 10 people wait longer).
.PP
When a semaphore is created it is given a number which is the maximum number of concurrent accesses it will permit. Accesses to the sempahore are gained using operator++() or operator+=(), and released with operator--() or operator-=(). The number of accesses allowed is retrieved with available(), and the total number with total(). Note that the incrementing functions will block if there aren't enough available accesses. Use tryAccess() if you want to actquire accesses without blocking.
When a semaphore is created it is given a number which is the maximum number of concurrent accesses it will permit. Accesses to the sempahore are gained using operator++() or operator+=(), and released with operator--() or operator-=(). The number of accesses allowed is retrieved with available(), and the total number with total(). Note that the incrementing functions will block if there aren't enough available accesses. Use tryAccess() if you want to acquire accesses without blocking.
Constructs a QSound that can tquickly play the sound in a file named \fIfilename\fR.
Constructs a QSound that can quickly play the sound in a file named \fIfilename\fR.
.PP
This may use more memory than the static \fCplay\fR function.
.PP
@ -111,7 +111,7 @@ Returns the filename associated with the sound.
.SH "bool QSound::isAvailable ()\fC [static]\fR"
Returns TRUE if sound facilities exist on the platform; otherwise returns FALSE. An application may choose either to notify the user if sound is crucial to the application or to operate silently without bothering the user.
.PP
If no sound is available, all QSound operations work silently and tquickly.
If no sound is available, all QSound operations work silently and quickly.
.SH "bool QSound::isFinished () const"
Returns TRUE if the sound has finished playing; otherwise returns FALSE.
@ -376,7 +376,7 @@ If \fIinvalidate\fR is TRUE (the default), the cursor will no longer be position
cur.insert();
.fi
.PP
In the above example, a cursor is created on the 'prices' table and a pointer to the insert buffer is atquired using primeInsert(). Each field's value is set to the desired value and then insert() is called to insert the data into the database. Remember: all edit operations (insert(), update() and delete()) operate on the contents of the cursor edit buffer and not on the contents of the cursor itself.
In the above example, a cursor is created on the 'prices' table and a pointer to the insert buffer is acquired using primeInsert(). Each field's value is set to the desired value and then insert() is called to insert the data into the database. Remember: all edit operations (insert(), update() and delete()) operate on the contents of the cursor edit buffer and not on the contents of the cursor itself.
.PP
See also setMode() and lastError().
.SH "bool QSqlCursor::isCalculated ( const QString & name ) const"
@ -617,7 +617,7 @@ If \fIinvalidate\fR is TRUE (the default), the current cursor can no longer be n
}
.fi
.PP
In the above example, a cursor is created on the 'prices' table and is positioned on the record to be updated. Then a pointer to the cursor's edit buffer is actquired using primeUpdate(). A new value is calculated and placed into the edit buffer with the setValue() call. Finally, an update() call is made on the cursor which uses the tables's primary index to update the record in the database with the contents of the cursor's edit buffer. Remember: all edit operations (insert(), update() and delete()) operate on the contents of the cursor edit buffer and not on the contents of the cursor itself.
In the above example, a cursor is created on the 'prices' table and is positioned on the record to be updated. Then a pointer to the cursor's edit buffer is acquired using primeUpdate(). A new value is calculated and placed into the edit buffer with the setValue() call. Finally, an update() call is made on the cursor which uses the tables's primary index to update the record in the database with the contents of the cursor's edit buffer. Remember: all edit operations (insert(), update() and delete()) operate on the contents of the cursor edit buffer and not on the contents of the cursor itself.
.PP
Note that if the primary index does not uniquely distinguish records the database may be changed into an inconsistent state.
@ -231,7 +231,7 @@ The final three values have special meaning:
.TP
\fCQt::FixedPixmap\fR - the widget is cleared to a fixed pixmap, normally different from all the ones in the palette(). Set using setPaletteBackgroundPixmap().
.PP
Although FixedColor and FixedPixmap are sometimes just right, if you use them, make sure that you test your application when the desktop color scheme has been changed. (On X11, a tquick way to test this is e.g. "./myapp -bg paleblue". On Windows, you must use the control panel.)
Although FixedColor and FixedPixmap are sometimes just right, if you use them, make sure that you test your application when the desktop color scheme has been changed. (On X11, a quick way to test this is e.g. "./myapp -bg paleblue". On Windows, you must use the control panel.)
.PP
See also QWidget::backgroundMode, QWidget::backgroundMode, QWidget::setBackgroundPixmap(), and QWidget::paletteBackgroundColor.
QTextEdit is an advanced WYSIWYG viewer/editor supporting rich text formatting using HTML-style tags. It is optimized to handle large documents and to respond tquickly to user input.
QTextEdit is an advanced WYSIWYG viewer/editor supporting rich text formatting using HTML-style tags. It is optimized to handle large documents and to respond quickly to user input.
.PP
QTextEdit has four modes of operation: <center>.nf
@ -84,7 +84,7 @@ This can be used to do heavy work while providing a snappy user interface:
.br
.fi
.PP
myObject->processOneThing() will be called repeatedly and should return tquickly (typically after processing one data item) so that Qt can deliver events to widgets and stop the timer as soon as it has done all its work. This is the traditional way of implementing heavy work in GUI applications; multi-threading is now becoming available on more and more platforms, and we expect that null events will eventually be replaced by threading.
myObject->processOneThing() will be called repeatedly and should return quickly (typically after processing one data item) so that Qt can deliver events to widgets and stop the timer as soon as it has done all its work. This is the traditional way of implementing heavy work in GUI applications; multi-threading is now becoming available on more and more platforms, and we expect that null events will eventually be replaced by threading.
.PP
Note that QTimer's accuracy depends on the underlying operating system and hardware. Most platforms support an accuracy of 20ms; some provide more. If Qt is unable to deliver the requested number of timer clicks, it will silently discard some.
The QToolBar class provides a movable panel containing widgets such as tool buttons.
.PP
A toolbar is a panel that contains a set of controls, usually represented by small icons. It's purpose is to provide tquick access to frequently used commands or options. Within a QMainWindow the user can drag toolbars within and between the dock areas. Toolbars can also be dragged out of any dock area to float freely as top-level windows.
A toolbar is a panel that contains a set of controls, usually represented by small icons. It's purpose is to provide quick access to frequently used commands or options. Within a QMainWindow the user can drag toolbars within and between the dock areas. Toolbars can also be dragged out of any dock area to float freely as top-level windows.
.PP
QToolBar is a specialization of QDockWindow, and so provides all the functionality of a QDockWindow.
.PP
@ -104,7 +104,7 @@ Use this constructor if you want to create torn-off (undocked, floating) toolbar
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Constructs an empty toolbar called \fIname\fR, with parent \fIparent\fR, in its \fIparent\fR's top dock area, without any label and without retquiring a newline.
Constructs an empty toolbar called \fIname\fR, with parent \fIparent\fR, in its \fIparent\fR's top dock area, without any label and without requiring a newline.
.SH "void QToolBar::addSeparator ()"
Adds a separator to the right/bottom of the toolbar.
The QToolButton class provides a tquick-access button to commands or options, usually used inside a QToolBar.
The QToolButton class provides a quick-access button to commands or options, usually used inside a QToolBar.
.PP
A tool button is a special button that provides tquick-access to specific commands or options. As opposed to a normal command button, a tool button usually doesn't show a text label, but shows an icon instead. Its classic usage is to select tools, for example the "pen" tool in a drawing program. This would be implemented with a QToolButton as toggle button (see setToggleButton() ).
A tool button is a special button that provides quick-access to specific commands or options. As opposed to a normal command button, a tool button usually doesn't show a text label, but shows an icon instead. Its classic usage is to select tools, for example the "pen" tool in a drawing program. This would be implemented with a QToolButton as toggle button (see setToggleButton() ).
.PP
QToolButton supports auto-raising. In auto-raise mode, the button draws a 3D frame only when the mouse points at it. The feature is automatically turned on when a button is used inside a QToolBar. Change it with setAutoRaise().
@ -111,7 +111,7 @@ QToolTipGroup provides a way for tool tips to display another text elsewhere (mo
.PP
At any point in time, QToolTip is either dormant or active. In dormant mode the tips are not shown and in active mode they are. The mode is global, not particular to any one widget.
.PP
QToolTip switches from dormant to active mode when the user hovers the mouse on a tip-etquipped region for a second or so and remains active until the user either clicks a mouse button, presses a key, lets the mouse hover for five seconds or moves the mouse outside \fIall\fR tip-etquipped regions for at least a second.
QToolTip switches from dormant to active mode when the user hovers the mouse on a tip-equipped region for a second or so and remains active until the user either clicks a mouse button, presses a key, lets the mouse hover for five seconds or moves the mouse outside \fIall\fR tip-equipped regions for at least a second.
.PP
The QToolTip class can be used in three different ways: <ol type=1>
.IP 1
@ -129,7 +129,7 @@ To add a tip to a widget, call the \fIstatic\fR function QToolTip::add() with th
.br
.fi
.PP
This is the simplest and most common use of QToolTip. The tip will be deleted automatically when \fItquitButton\fR is deleted, but you can remove it yourself, too:
This is the simplest and most common use of QToolTip. The tip will be deleted automatically when \fIquitButton\fR is deleted, but you can remove it yourself, too:
@ -275,7 +275,7 @@ Protocol) is declared (\c network/infoprotocol/infourlclient/qip.h):
\skipto Qip
\printuntil };
QNetworkProtocol is the base class for every Network Protocol class. Because this protocol uses network, we embedded one QSocket* member variable to which we'll delegate network communication. Protocols that doesn't require to use network will do it on their own way - e.g. QLocalFs uses QDir, some data actquisition protocol may use serial or USB connection, only requirement is that protocol uses hierarchical structure and can be accessed using URLs (to have addressable nodes).
QNetworkProtocol is the base class for every Network Protocol class. Because this protocol uses network, we embedded one QSocket* member variable to which we'll delegate network communication. Protocols that doesn't require to use network will do it on their own way - e.g. QLocalFs uses QDir, some data acquisition protocol may use serial or USB connection, only requirement is that protocol uses hierarchical structure and can be accessed using URLs (to have addressable nodes).
Let us go to the Qip implementation (\c
network/infoprotocol/infourlclient/qip.cpp):
@ -346,7 +346,7 @@ Here is where we use some QNetworkProtocol magic. (QUrlOperator)op is constructe
\printuntil return
\printuntil }
This function implements simple QFileDialog that will serve us to browse through the nodes on the server and to select one data node to view. Starting url is "qip://localhost/" which indicates to QFileDialog that we want to use Qip protocol served on the local server. We could also specify the exact port, e.g. "qip://my_server:123" will try to intquire my_server over port 123, otherwise the default port is used.
This function implements simple QFileDialog that will serve us to browse through the nodes on the server and to select one data node to view. Starting url is "qip://localhost/" which indicates to QFileDialog that we want to use Qip protocol served on the local server. We could also specify the exact port, e.g. "qip://my_server:123" will try to inquire my_server over port 123, otherwise the default port is used.
We didn't use static function QFileDialog::getOpenFileName() because under Windows and Mac OS X, it will usually use the native file dialog and not a QFileDialog, in which case we wouldn't be able to use our protocol at all.
<palign="justify">TQTextEdit is an advanced WYSIWYG editor supporting richtext formatting. It is optimized to handle large documents and to respond tquickly to user input.</p>
<palign="justify">TQTextEdit is an advanced WYSIWYG editor supporting richtext formatting. It is optimized to handle large documents and to respond quickly to user input.</p>
<palign="justify">TQTextEdit supports font styles such as <spanstyle="font-weight:600">bold</span>, <spanstyle="font-style:italic">italic, </span><spanstyle="text-decoration:underline">underlined</span> as well as various <spanstyle="font-weight:600;color:#00007f">c</span><spanstyle="font-weight:600;color:#aa0000">o</span><spanstyle="font-weight:600;color:#005500">l</span><spanstyle="font-weight:600;color:#aa5500">o</span><spanstyle="font-weight:600;color:#00aa00">r</span><spanstyle="font-weight:600;color:#ff0000">s </span>and <spanstyle="font-size:16pt">s</span><spanstyle="font-size:18pt">i</span><spanstyle="font-size:20pt">z</span><spanstyle="font-size:22pt">e</span><spanstyle="font-size:28pt">s</span>. You can select different font families, for example <spanstyle="font-family:Times;font-weight:600">Times New Roman</span> or <spanstyle="font-family:Courier;font-weight:600">Courier</span>. Futhermore the widget supports different paragraph alignments such as justified,</p>