From 0f92dd542b65bc910caaf190b7c623aa5158c86a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 14 Nov 2011 22:33:41 -0600 Subject: Fix native TQt3 accidental conversion to tquit --- doc/html/designer-manual-4.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/html/designer-manual-4.html') diff --git a/doc/html/designer-manual-4.html b/doc/html/designer-manual-4.html index fd642a9da..17b27fcfb 100644 --- a/doc/html/designer-manual-4.html +++ b/doc/html/designer-manual-4.html @@ -201,7 +201,7 @@ body { background: #ffffff; color: black; } } } -

The code for this function is tquite long, but it isn't difficult. We start by setting a default color to white. If there are any colors in the m_colors map we set the default color to be the current color showing in the current view. We then invoke TQt's static getColor() dialog, passing it the default color. (If the user cancels an invalid color is returned.)

+

The code for this function is quite long, but it isn't difficult. We start by setting a default color to white. If there are any colors in the m_colors map we set the default color to be the current color showing in the current view. We then invoke TQt's static getColor() dialog, passing it the default color. (If the user cancels an invalid color is returned.)

If the user chose a color we want to show their chosen color in our custom dialog, so we create a pixmap and fill it with their chosen color. We create an instance of our ColorNameForm as a modal dialog (third argument is TRUE). We then call its setColors() function to set the colors in the m_colors map (so that the validate() function will work correctly). We set its colorLabel's pixmap to the pixmap we've just created, i.e. to a rectangle in the user's chosen color.

We execute (exec()) the dialog. If the user clicks OK (and the color name they've entered is valid), the call will return a true value. In this case we retrieve the name they've entered from the line edit and create a new entry in the m_colors map using the name the user has given and the color they chose.

At this point we could simply mark the views "dirty" and call repopulate. Instead we'll add the new color to each view directly and save the overhead of a full update (which might be considerable if we have thousands of colors).

-- cgit v1.2.1