QtEZ©

This page is dedicated to those who wish to do more technical things with QtEZ, the thrust of this page will, for now, cover adding components to the environment. This is not a complex feature, but it is a little more technical and more demanding, then the general QtEZ help found elsewhere on this site.
For the most part each component is just a class that inherits BaseComponant (found in componants/ of the source distribution). By inheriting this, you are responsible for 5 actions they are:

public: virtual void fillAttributes(); 1) You must tell QtEZ what attributes you wish to have available, this is done with the ADDATTRIB() macro. This macro basically just instantiates a item for the listbox in the attribute table. There are several different ways to call it based on the kind of attribute this will be. As of this writing there are 6 (W_MULTI, W_LIST, W_FILE, W_TEXT, W_TRUE, and W_COLOR). The way to call them are as follows. W_MULTI demands you first tell it what the attribute is called, then you tell it a little caption to put on the right side of the border (or just ""), then specificy it's a W_MULTI, then you tell it the number of items you want to put on this list, then you just put the caption of the item, followed by it's state (0 or 1), you do this however many times you told it there were items, so for 8 items there are 16 things following it. W_LIST is similar to W_MULTI, except that it asks you just to tell it: The caption, the current value (in string format), then specify W_LIST, then the number of items, followed by that many strings specificying all of the available choices. W_TEXT and W_FILE work the same, in that they both demand: the caption, the current value (string), and either W_FILE, or W_TEXT based on it's type of data. W_TRUE is basically just a pre-written W_LIST, you tell it: the caption, it's state (bool, on or off), and finally W_TRUE. Finally W_COLOR this one is more unique in that it expects you to tell it a current colour (QColor). You tell it, current caption, current colour, then W_COLOR and that wraps up the attribute table, the following is a list of each of the kinds of attribute.

ADDATTRIB("Width",width(),W_TEXT));
ADDATTRIB("Icon", iconPix->data(),W_FILE));
ADDATTRIB("Background Colour",backgroundColor(),W_COLOR));
ADDATTRIB("Interface Style",uiStyle->data(),W_LIST,5,
"Default",
"Macintosh",
"Windows",
"Windows 3.x",
"Motif"));
ADDATTRIB("Default",look->isDefault(),W_TRUE));
ADDATTRIB("Extra Flags","-MULTIPLE CHOICE-",W_MULTI,8,
"Normal Border", flg->find("WStyle_NormalBorder"),
"Dialog Border", flg->find("WStyle_DialogBorder"),
"No Border", flg->find("WStyle_NoBorder"),
"Title Bar", flg->find("WStyle_Title"),
"System Menu", flg->find("WStyle_SysMenu"),
"Maximize Button", flg->find("WStyle_Maximize"),
"Minimize Button", flg->find("WStyle_Minimize"),
"Tool Window", flg->find("WStyle_Tool")));

public: virtual void interpretAttributes(); 2) Interpreting attributes. This is done by a call to the attribute table asking for the type of data you want, under the caption you gave it when you filled the table (as above). There are

Home | Mail Author