diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/objects/class_groupbox.cpp | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/objects/class_groupbox.cpp')
-rw-r--r-- | src/modules/objects/class_groupbox.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/src/modules/objects/class_groupbox.cpp b/src/modules/objects/class_groupbox.cpp index 14e640d1..023d1e25 100644 --- a/src/modules/objects/class_groupbox.cpp +++ b/src/modules/objects/class_groupbox.cpp @@ -29,7 +29,7 @@ #include "kvi_locale.h" #include "kvi_iconmanager.h" -// Tables used in $setAlignment , $alignment and in $setOrientation & $orientation +// Tables used in $tqsetAlignment , $tqalignment and in $setOrientation & $orientation const char * const align_tbl[] = { "Left", @@ -37,9 +37,9 @@ const char * const align_tbl[] = { "HCenter" }; const int align_cod[] = { - Qt::AlignLeft, - Qt::AlignRight, - Qt::AlignHCenter + TQt::AlignLeft, + TQt::AlignRight, + TQt::AlignHCenter }; #define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) @@ -59,9 +59,9 @@ const int align_cod[] = { [class]widget[/class] @description: This widget can be used to display a groupbox. - It will be usually a parent for other child controls. - You can either use a child layout to manage the children geometries - or use $setColumnLayout to manage the layout automatically. + It will be usually a tqparent for other child controls. + You can either use a child tqlayout to manage the tqchildren geometries + or use $setColumnLayout to manage the tqlayout automatically. @functions: !fn: $setTitle(<text:String>) Sets the group box title to <text>. @@ -89,15 +89,15 @@ const int align_cod[] = { Returns the number of columns or rows in the groupbox. !fn: $addSpace() Adds an empty cell at the next free position. - !fn: <string> $alignment() - Returns the alignment of the group box title. - !fn: $setAlignment(<alignment:string>) - Set the alignment of the groupbox; Valid values are Left,Right,HCenter. + !fn: <string> $tqalignment() + Returns the tqalignment of the group box title. + !fn: $tqsetAlignment(<tqalignment:string>) + Set the tqalignment of the groupbox; Valid values are Left,Right,HCenter. !fn: $setOrientation<orientation:string> - Sets the group box's orientation. Valid values are: Horizontal, Vertical. + Sets the group box's orientation. Valid values are:Qt::Horizontal,Qt::Vertical. !fn: $setColumnLayout(<columns:integer>,<orientation:string>) - Enables the automatic layout management. The children are arranged in n columns with the specified orientation.[br] - Valid values for <orientation> are: Horizontal, Vertical. + Enables the automatic tqlayout management. The tqchildren are arranged in n columns with the specified orientation.[br] + Valid values for <orientation> are:Qt::Horizontal,Qt::Vertical. @examples: [example] |-Start:[br] @@ -108,7 +108,7 @@ const int align_cod[] = { #then the groupbox [br] %gb=$new(groupbox,%widget)[br] %gb->$setTitle(Login)[br] - %gb->$setAlignment("Left")[br] + %gb->$tqsetAlignment("Left")[br] [br] #now we create the labels and lineedits.[br] %labeluser=$new(label,%gb)[br] @@ -119,31 +119,31 @@ const int align_cod[] = { %inputpass=$new(lineedit,%gb)[br] %inputpass->$setechomode("password")[br] [br] - #now lets' layouting the groupbox's element's.[br] - %layoutgb=$new(layout,%gb)[br] - %layoutgb->$setmargin(20)[br] - %layoutgb->$addwidget(%labeluser,0,0)[br] - %layoutgb->$addwidget(%labelpass,1,0)[br] - %layoutgb->$addwidget(%inputuser,0,1)[br] - %layoutgb->$addwidget(%inputpass,1,1)[br] + #now lets' tqlayouting the groupbox's element's.[br] + %tqlayoutgb=$new(tqlayout,%gb)[br] + %tqlayoutgb->$setmargin(20)[br] + %tqlayoutgb->$addwidget(%labeluser,0,0)[br] + %tqlayoutgb->$addwidget(%labelpass,1,0)[br] + %tqlayoutgb->$addwidget(%inputuser,0,1)[br] + %tqlayoutgb->$addwidget(%inputpass,1,1)[br] [br] - # now we create a fake widget and managing the two buttons layout.[br] + # now we create a fake widget and managing the two buttons tqlayout.[br] %fakewidget=$new(widget,%widget)[br] - %layoutbtn=$new(layout,%fakewidget)[br] + %tqlayoutbtn=$new(tqlayout,%fakewidget)[br] %btnok=$new(button,%fakewidget)[br] %btnok->$settext("OK")[br] %btncancel=$new(button,%fakewidget)[br] %btncancel->$settext("Cancel")[br] - %layoutbtn->$addwidget(%btnok,0,0)[br] - %layoutbtn->$addwidget(%btncancel,0,1)[br] + %tqlayoutbtn->$addwidget(%btnok,0,0)[br] + %tqlayoutbtn->$addwidget(%btncancel,0,1)[br] [br] - #And finally we create a main layout with the groupbox (and its "children")[br] - #and fakewiget (with its buttons children). - %mainlayout=$new(layout,%widget)[br] - %mainlayout->$setspacing(10)[br] - %mainlayout->$setmargin(10)[br] - %mainlayout->$addwidget(%gb,0,0)[br] - %mainlayout->$addwidget(%fakewidget,1,0)[br] + #And finally we create a main tqlayout with the groupbox (and its "tqchildren")[br] + #and fakewiget (with its buttons tqchildren). + %maintqlayout=$new(tqlayout,%widget)[br] + %maintqlayout->$setspacing(10)[br] + %maintqlayout->$setmargin(10)[br] + %maintqlayout->$addwidget(%gb,0,0)[br] + %maintqlayout->$addwidget(%fakewidget,1,0)[br] [br] #Let's show our nice login request =D ! [br] %widget->$show()[br] @@ -165,8 +165,8 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_groupbox,"groupbox","widget") KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"setColumns", functionSetColumns) KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"columns", functionColumns) KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"addSpace", functionAddSpace) - KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"alignment", functionAlignment) - KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"setAlignment", functionSetAlignment) + KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"tqalignment", functionAlignment) + KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"tqsetAlignment", functionSetAlignment) KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"setOrientation", functionSetOrientation) KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"isChecked", functionIsChecked) KVSO_REGISTER_HANDLER(KviKvsObject_groupbox,"setChecked", functionSetChecked) @@ -185,18 +185,18 @@ KVSO_END_CONSTRUCTOR(KviKvsObject_groupbox) bool KviKvsObject_groupbox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) { #ifdef COMPILE_USE_QT4 - KviTalGroupBox *groupbox=new KviTalGroupBox(name(),parentScriptWidget()); + KviTalGroupBox *groupbox=new KviTalGroupBox(name(),tqparentScriptWidget()); groupbox->setObjectName(name()); setObject(groupbox,true); #else - setObject(new KviTalGroupBox(name(),parentScriptWidget()), true); + setObject(TQT_TQOBJECT(new KviTalGroupBox(name(),tqparentScriptWidget())), true); #endif return true; } bool KviKvsObject_groupbox::functionSetTitle(KviKvsObjectFunctionCall *c) { - QString szTitle; + TQString szTitle; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("title",KVS_PT_STRING,0,szTitle) KVSO_PARAMETERS_END(c) @@ -308,26 +308,26 @@ bool KviKvsObject_groupbox::functionAddSpace(KviKvsObjectFunctionCall *c) bool KviKvsObject_groupbox::functionSetAlignment(KviKvsObjectFunctionCall *c) { - QString szAlign; + TQString szAlign; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("alignment",KVS_PT_STRING,0,szAlign) + KVSO_PARAMETER("tqalignment",KVS_PT_STRING,0,szAlign) KVSO_PARAMETERS_END(c) if (!widget()) return true; for(unsigned int i = 0; i < align_num; i++) { - if(KviQString::equalCI(szAlign, align_tbl[i])) + if(KviTQString::equalCI(szAlign, align_tbl[i])) { - ((KviTalGroupBox *)widget())->setAlignment(align_cod[i]); + ((KviTalGroupBox *)widget())->tqsetAlignment(align_cod[i]); return true; } } - c->warning(__tr2qs("Unknown alignment")); + c->warning(__tr2qs("Unknown tqalignment")); return true; } bool KviKvsObject_groupbox::functionAlignment(KviKvsObjectFunctionCall *c) { - int mode = ((KviTalGroupBox *)widget())->alignment(); - QString szAlignment=""; + int mode = ((KviTalGroupBox *)widget())->tqalignment(); + TQString szAlignment=""; for(unsigned int i = 0; i < align_num; i++) { if(mode == align_cod[i]) @@ -342,15 +342,15 @@ bool KviKvsObject_groupbox::functionAlignment(KviKvsObjectFunctionCall *c) bool KviKvsObject_groupbox::functionSetOrientation(KviKvsObjectFunctionCall *c) { - QString szMode; + TQString szMode; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("orientation",KVS_PT_STRING,0,szMode) KVSO_PARAMETERS_END(c) if(!widget())return true; - if(KviQString::equalCI(szMode, "Horizontal")) + if(KviTQString::equalCI(szMode, "Horizontal")) ((KviTalGroupBox *)widget())->setOrientation(Qt::Horizontal); else - if(KviQString::equalCI(szMode, "Vertical")) + if(KviTQString::equalCI(szMode, "Vertical")) ((KviTalGroupBox *)widget())->setOrientation(Qt::Vertical); else c->warning( __tr2qs("Unknown orientation: ")); return true; @@ -358,7 +358,7 @@ bool KviKvsObject_groupbox::functionSetOrientation(KviKvsObjectFunctionCall *c) bool KviKvsObject_groupbox::functionSetColumnLayout(KviKvsObjectFunctionCall *c) { - QString szMode; + TQString szMode; kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("columns",KVS_PT_UNSIGNEDINTEGER,0,uCol) |