I run Slackware 10.0, and with my build I got a 3.x version of Qt.
I wanted to see what it would do, I began with the Metric conversion.
I got that to work, and did a couple mods, just to play with it.
Then I started on the Colortool example.
Everything went fairly well, until I got to the part where it says:
Navigate to /tools/designer/examples/colortool/images; click the designer_tabwidget.png image.
Oops. There IS no such folder, and No image either!
Actually you could use any 22x22 png icon, but it took me a while to figure that out.
Anyways, I did figure that out and made a 22x22 png icon, and proceeded to the next step.
When I got to:
Change its iconSet property to designer_widgetstack.png.
I got very frustrated!
I imagine that's where you are at right now.
There were a few stumbling blocks along the way, but eventually I did get a working executable of colortool.

So, in the interest of promoting TrollTechs, Qt C++ programming
environment, I hope to give you the edge you need to get through the
example, so that you can begin, like myself to fully enjoy this
excellent tool!
First, I have a zip file that contains all the files, including the icons I used.
colortool.zip
Now I'll list the icons I used.
(If all you need is a nudge forward with the icons, grab em here instead of the zip file)

ark_options.png
(designer_tabwidget.png)
| 
colorpicker.png
|

deletecell.png
|

edit_add.png
(designer_widgetstack.png) |

exit.png |

filesaveas.png
|

inserttable.png
(designer_table.png) |

view_icon.png
(designer_iconview.png) |

45_blank.png
(editraise.png) |
(The filenames in paretheses are the one you could not find, the other ones are just for fun.)
I found these icons in my Slackware 10.0 at:
/opt/kde/share/icons/kdeclassic/22x22/actions
You should be able to find an icon set in your distro, poke around in /usr and usr/local.
UPDATE:
Thank you to Robert Cook for taking time to forward the REAL icons from the example!
There are 4 of them in this zip file:
widget.zip
Here they are individually:

iconview.png
(designer_iconview.png) |

table.png
(designer_table.png) |

tabwidget.png
(designer_tabwidget.png) |

widgetstack.png
(designer_widgetstack.png) |
Onwards:
There were some code problems as well.
For instance, the example tells me that since we changed edit-Cut to edit-Delete, we freed up the accelerator Ctrl-C.
On my system that was not true, Ctrl-C is the assigned accelerator for edit-Copy, there is no need to change it.
Tidying Up
We're going to use "Cut" for deleting colors, so we'll change the
user-visible name to "Delete" to make its meaning clearer. Click the
editCutAction in the Action Editor to make its properties appear in the
Property Editor. Change its text property to "Delete" and change its menuText property to "&Delete".
A side-effect of the above change is that Alt+C (originally used for "Cut") is now unused. Click the editCopyAction action in the Action Editor, and change its menuText property to "&Copy".
|
(I changed the icon as well, to deletecell.png) 
Now then, at the point in the example, where you have to start coding, you can't copy the code from:
/tools/designer/examples/colortool
Because it don't exist! (which is why you came here to begin with, right??)
The list of constants works fine, copy them from the manual.
The init() code is a different story.
Almost as small print you are told to comment out:
findForm = 0; loadSettings();
But they don't tell you *how* to comment those, LOL.
Just put a couple // (forward slashes) in front of each of them. They turn red, and are now comments.
Also!!! do not copy the bold init() above the actual code:
init() <--causes error
void MainForm::init() { clipboard = QApplication::clipboard(); if ( clipboard->supportsSelection() ) clipboard->setSelectionMode( TRUE );
//findForm = 0; <--commented out //loadSettings(); <--commented out
|
The actual code starts at:
void MainForm::init()
If you paste in the bold "init()" above that, the compiler will give you errors!
In file included from .ui/mainform.cpp:46:
mainform.ui.h:22: error: ISO C++ forbids declaration of `init' with no type
mainform.ui.h: In function `int init()':
mainform.ui.h:22: error: parse error before `void'
make: *** [.obj/mainform.o] Error 1
|
(By the way, if you run Linux, we'll probably have to go back and edit that init() code again to get the loadsettings() to work.)
When you get to the main.cpp part of the example:
Creating main.cpp
Now that we've entered some of the code it would be nice to build
and run the application to get a feel for the progress we've made. To
do this we need to create a main() function. In Qt we typically create a small main.cpp file for the main() function. We can ask Qt Designer to create this file for us.
Click File|New to invoke the New File dialog. Click "C++ Main-File", then click OK. The Configure Main-File
dialog appears, listing the all the forms in the project. We've only
got one form, "MainForm", so it is already highlighted. Click OK to create a main.cpp file that loads our MainForm.
#include <qapplication.h> #include "mainform.h"
int main( int argc, char ** argv ) { QApplication a( argc, argv ); MainForm *w = new MainForm; w->show(); return a.exec(); }
When Qt Designer generates a main.cpp file it includes this line:
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
If we left this code as-is, the user could by-pass our own
termination code by clicking the main window's close (X) button. Since
we want to give the user the option to save any unsaved changes we need
to ensure that we intercept any attempt to close the application. To
achieve this we delete the connection and add a new slot, closeEvent() which will intercept attempts to close the application and call our fileExit() function.
|
What they want you to do is delete this line in the code:
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
DON'T do that. Nothing bad happens if you do, but it's not a good idea to just delete code you don't understand. So, instead of deleting it, make it a comment, by adding a couple // (forward slashes) in front of it.
It should look like this:
#include <qapplication.h> #include "mainform.h"
int main( int argc, char ** argv ) { QApplication a( argc, argv ); MainForm w; w.show(); //a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); return a.exec(); }
|
After this, you paste in a couple more code snippets about exiting, then you should be able to build and run.
If you got that far, then you will paste in some more code snippets:
changedTableColor()
void MainForm::changedTableColor( int row, int ) { changedColor( colorTable->text( row, COL_NAME ) ); }
We connected to this slot so that we'd know whenever the user moved or clicked in the table view. We call the changedColor()
function (which we'll see in a moment) with the name of the current
color. Note that we don't care about the column argument, so we could
have left it out. Don't forget to name the changedTableColor parameter
to "int row".
|
Then:
changedIconColor()
void MainForm::changedIconColor( QIconViewItem *item ) { changedColor( item->text() ); }
This slot is connected for the same purpose as changedTableColor(), above. It also calls changedColor() with the name of the current color. (If you're cutting and pasting the code don't forget to name the QIconViewItem parameter "item".)
|
That was the end of my troubles for Chapter 3. Now I'm starting with chapter 4!
They start you out by making a form for adding colors, they call it --Color Name. Anyways they tell you a bunch of stuff about layouts and widgets, then:
|
We need to create a QLabel
that will show the color the user has chosen. Click the TextLabel tool
in the Toolbox, then click on the left hand side of the form. Change
the label's name property to "colorLabel", and delete the text in the text property. Click the pixmap property's ellipsis button and choose the "editraise.png" image. Change the minimumSize property's width sub-property to 80, and set the scaledContents property to True.
|
And of course there is NO "editraise.png", so use this one instead! 45_blank.png, 
Now, what next?
Oh yeah, Finding Colors!
The code they give is NOT wrong, it does exactly what they say it does. (silly wabbit, kids are for trix)
Yep, this is what they say it does:
|
If the user is using the table view we start looking from the row
following the row they're on. If we get a match we select the row
containing the match, set found to TRUE and stop looking. If we didn't find a match we set the current cell back to the cell we started from.
If the user is using the icon view, we start looking from the item
following the current item. If we find a match we select the
corresponding item and ensure that it is visible. Again, if we didn't
find a match we set the current item to be the item we started looking
from.
|
Which means that if you have selected some random color in the middle of your list, then decide you want to look for a color, and that color happens to be *above* your selection, the Find tool will never find it. To find a color reliably you need to select the TOP/FIRST color in the list.
I changed the code so that it always begins searching at the top, but when I did that, the find tool will ONLY find the first matching color, sigh, I need to work on that.
This next one took me 2-3 hours to figure out! (45 Mike is a dopey fool sometimes)
Load Settings!
2 part problem, the first is a problem with the example code, it caused a compiler error.
.ui/mainform.cpp: In member function `virtual void MainForm::loadSettings()':
.ui/mainform.cpp:52: error: parse error before `*' token
.ui/mainform.cpp:56: error: invalid use of member (did you forget the `&' ?)
.ui/mainform.cpp:56: error: in argument to unary !
make: *** [.obj/mainform.o] Error 1
|
After losing a bunch of hair, I noticed that the example code was missing an ending curly brace, " } ". That fixed it!
OK, then, I noticed that now the program compiles perfectly, but the size and position settings would NOT load.
To be precise, the settings *did* load, but never actually changed the size or position to the last state before exit. The app insisted on appearing with the default size, and at random positions.
After some reading I discovered that the problem is that the code is designed to resize and reposition "WINDOWS" applications! So I fixed it.
I am reasonably certain that what I did will still allow it to work in Windows, but now it also works in KDE!
What I did:
First I added the four variables from loadsettings() to class variables so they were available throughout the class code.

Then I changed the code in the loadsettings() function:
void MainForm::loadSettings()
{
QSettings settings;
settings.insertSearchPath( QSettings::Windows, WINDOWS_REGISTRY );
windowWidth = settings.readNumEntry( APP_KEY + "WindowWidth", 550 );
windowHeight = settings.readNumEntry( APP_KEY + "WindowHeight", 500 );
windowX = settings.readNumEntry( APP_KEY + "WindowX", 0 );
windowY = settings.readNumEntry( APP_KEY + "WindowY", 0 );
m_clip_as = settings.readNumEntry( APP_KEY + "ClipAs", CLIP_AS_HEX );
m_show_web = settings.readBoolEntry( APP_KEY + "ShowWeb", TRUE );
if ( ! settings.readBoolEntry( APP_KEY + "View", TRUE ) ) {
colorWidgetStack->raiseWidget( iconsPage );
viewIconsAction->setOn( TRUE );
}
}
|
Notice that the variables are declared as int in the class declaration, so they are not declared in the function!
Now, I went back to the init() funtion!
void MainForm::init()
{
clipboard = QApplication::clipboard();
if ( clipboard->supportsSelection() )
clipboard->setSelectionMode( TRUE );
findForm = 0;
loadSettings();
m_filename = "";
m_changed = FALSE;
m_table_dirty = TRUE;
m_icons_dirty = TRUE;
clearData( TRUE );
setGeometry(windowX,windowY,windowWidth,windowHeight);
}
|
That last line, after everything else, but before the form is actually drawn to the screen, setGeometry() reads the values we loaded and sets the size and position.
There ya have it.
FIXED!
If you have questions about what I did, be welcome to ask, use my feed back form below.
If you have questions outside the scope of what I did, you'd be better off asking in a mail list or web forum.
I don't want to sound cruel, but the fact is that some people just don't get it, maybe they never will. If pretty much NONE of what I wrote makes any sense, you might take up knitting, or something requiring less thought. (sorry to those who do knit, it's a whole nuther technical problem! I know, I seen my mom and grandma struggling with the math) There are classes at your local community college, and if you look around you could probably find someone local who could sit down and walk you through getting started with programming, or with C++.
Anyways I do hope this has been of some value!
|