diff options
| author | 2011-05-08 22:25:35 +0000 | |
|---|---|---|
| committer | 2011-05-08 22:25:35 +0000 | |
| commit | 3d8714d797ce5b09cea2e3b36edee2fc231f28a1 (patch) | |
| tree | 5b13cd3775c52333155ff349f3e45dc24b271b04 /src/modules/objects/KvsObject_treeWidgeteItem.cpp | |
| parent | Fix fix (diff) | |
| download | KVIrc-3d8714d797ce5b09cea2e3b36edee2fc231f28a1.tar.gz KVIrc-3d8714d797ce5b09cea2e3b36edee2fc231f28a1.tar.bz2 KVIrc-3d8714d797ce5b09cea2e3b36edee2fc231f28a1.zip | |
Objects module: fixed indentation (2nd part)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5837 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/KvsObject_treeWidgeteItem.cpp')
| -rw-r--r-- | src/modules/objects/KvsObject_treeWidgeteItem.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/src/modules/objects/KvsObject_treeWidgeteItem.cpp b/src/modules/objects/KvsObject_treeWidgeteItem.cpp index 8e7903227..0220c8810 100644 --- a/src/modules/objects/KvsObject_treeWidgeteItem.cpp +++ b/src/modules/objects/KvsObject_treeWidgeteItem.cpp @@ -33,7 +33,7 @@ #include <QIcon> const int item_flags[] = { - Qt::NoItemFlags, + Qt::NoItemFlags, Qt::ItemIsSelectable, Qt::ItemIsEditable, Qt::ItemIsDragEnabled, @@ -45,7 +45,7 @@ const int item_flags[] = { const char * const itemflags_tbl[] = { "noitemflag", - "selectable", + "selectable", "editable", "dragEnabled", "dropEnabled", @@ -59,25 +59,25 @@ const char * const itemflags_tbl[] = { /* - @doc: listviewitem + @doc: listviewitem @keyterms: - listview tlistviewitem class + listview tlistviewitem class @title: - listviewtitem class + listviewtitem class @type: class @short: - A listviewitem class + A listviewitem class @inherits: - [class]listviewitem[/class] + [class]listviewitem[/class] @description: - The listviewitem class implements a list view item. - A list view item is a multi-column object capable of displaying itself in a [class]listview[/class]. - To use this class you must instantiate it with another listviewitem or a [class]listview[/class] + The listviewitem class implements a list view item. + A list view item is a multi-column object capable of displaying itself in a [class]listview[/class]. + To use this class you must instantiate it with another listviewitem or a [class]listview[/class] as parent. The item will be automatically displayed. You can set the text and a pixmap in each column and you can make it checkable - with [classfnc:listviewitem]$setCheckable[/classfnc](). - A checkable listviewitem will display a small check mark in the first column. + with [classfnc:listviewitem]$setCheckable[/classfnc](). + A checkable listviewitem will display a small check mark in the first column. @functions: !fn: $setText(<column:integer>,<text:string>) Sets the text in column column to text, if column is a valid column number and text is different from the existing text. @@ -89,20 +89,20 @@ const char * const itemflags_tbl[] = { Sets the pixmap in column column to pm, if pm is non-null and different from the current pixmap, and if column is non-negative. Pixmap can be a Kvirc imageid, an image file or a [class]pixmap[/class] object. - !fn: $setItemEditable(<bEnabled:boolean>) - If bEnabled is TRUE (1), this item can be in-place editable by the user; otherwise it cannot be editable in-place. + !fn: $setItemEditable(<bEnabled:boolean>) + If bEnabled is TRUE (1), this item can be in-place editable by the user; otherwise it cannot be editable in-place. - !fn: $isItemEditable() - Returns $true if this item is editable and $false otherwise. + !fn: $isItemEditable() + Returns $true if this item is editable and $false otherwise. !fn: $setEnabled(<bEnabled:boolean>) - Enables or disables the item. + Enables or disables the item. !fn: $isEnabled() - Returns $true if this item is enabled and $false otherwise. + Returns $true if this item is enabled and $false otherwise. !fn: $setOpen(<bOpen:boolean>) - Opens or closes the item to show its children items. + Opens or closes the item to show its children items. !fn: $isOpen() Returns the open state of this item @@ -117,24 +117,24 @@ const char * const itemflags_tbl[] = { Returns $true if this item is checkable and $false otherwise !fn: $setChecked(<bChecked:boolean>) - Sets this item to be checked or not. [classfnc:listviewitem]$setCheckable[/classfnc]() must + Sets this item to be checked or not. [classfnc:listviewitem]$setCheckable[/classfnc]() must have been previously called. !fn: $isChecked() - Returns the check status of this item. [classfnc:listviewitem]$setCheckable[/classfnc]() must + Returns the check status of this item. [classfnc:listviewitem]$setCheckable[/classfnc]() must have been previously called. !fn: $setFlags(<flag1:string>, <flag2:string>, ...) - Sets the flags for the item to the given flags. These determine whether the item can be selected or modified. This is often used to disable an item. - Supported flags are: - - noitemflag : no flag sets; - - selectable : item is selecatble; - - editable : item is editable; - - dragEnabled : item can dragged; - - dropEnabled : item can used as drop target; - - userCheckable : item is checkable; - - enabled :item is enabled; - - tristate : item is checkable with three separate states. + Sets the flags for the item to the given flags. These determine whether the item can be selected or modified. This is often used to disable an item. + Supported flags are: + [br]- noitemflag : no flag sets; + [br]- selectable : item is selecatble; + [br]- editable : item is editable; + [br]- dragEnabled : item can dragged; + [br]- dropEnabled : item can used as drop target; + [br]- userCheckable : item is checkable; + [br]- enabled :item is enabled; + [br]- tristate : item is checkable with three separate states. */ @@ -146,17 +146,17 @@ KVSO_BEGIN_REGISTERCLASS(KvsObject_treeWidgetItem,"listviewitem","object") KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setText) KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,text) KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setPixmap); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setItemEditable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isItemEditable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isEnabled); + KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setItemEditable); + KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isItemEditable); + KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setEnabled); + KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isEnabled); KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setOpen); KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isOpen); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setCheckable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isCheckable); + KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setCheckable); + KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isCheckable); KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setChecked); KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isChecked); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setFlags); + KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setFlags); KVSO_END_REGISTERCLASS(KvsObject_treeWidgetItem) @@ -188,7 +188,7 @@ bool KvsObject_treeWidgetItem::init(KviKvsRunTimeContext * pContext,KviKvsVarian if(parentObject()->inheritsClass("listview")) m_pTreeWidgetItem = new KviKvsStandardTreeWidgetItem(this,((QTreeWidget *)parentScriptWidget())); else { - pContext->error(__tr2qs_ctx("The parent of the listviewitem must be either another listviewitem or a listview","objects")); + pContext->error(__tr2qs_ctx("The parent of the listviewitem must be either another listviewitem or a listview","objects")); return false; } } @@ -243,23 +243,23 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,setText) KVSO_CLASS_FUNCTION(treeWidgetItem,setItemEditable) { - bool bEnabled; + bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) - KVSO_PARAMETERS_END(c) + KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETERS_END(c) if(m_pTreeWidgetItem) - m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsEditable:m_pTreeWidgetItem->flags()&~Qt::ItemIsEditable); + m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsEditable:m_pTreeWidgetItem->flags()&~Qt::ItemIsEditable); return true; } KVSO_CLASS_FUNCTION(treeWidgetItem,isItemEditable) { - if(!m_pTreeWidgetItem) - { - c->returnValue()->setBoolean(false); - return true; - } - c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsEditable); - return true; + if(!m_pTreeWidgetItem) + { + c->returnValue()->setBoolean(false); + return true; + } + c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsEditable); + return true; } KVSO_CLASS_FUNCTION(treeWidgetItem,setFlags) { @@ -285,7 +285,7 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,setFlags) sum = sum | flag; } else - c->warning(__tr2qs_ctx("Unknown item flag '%Q'","objects"),&itemflags.at(i)); + c->warning(__tr2qs_ctx("Unknown item flag '%Q'","objects"),&itemflags.at(i)); } if(m_pTreeWidgetItem) m_pTreeWidgetItem->setFlags((Qt::ItemFlags)sum); @@ -300,7 +300,7 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,setEnabled) KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) KVSO_PARAMETERS_END(c) if(m_pTreeWidgetItem) - m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsEnabled:m_pTreeWidgetItem->flags()&~Qt::ItemIsEnabled); + m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsEnabled:m_pTreeWidgetItem->flags()&~Qt::ItemIsEnabled); return true; } @@ -311,7 +311,7 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,isEnabled) c->returnValue()->setBoolean(false); return true; } - c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsEnabled); + c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsEnabled); return true; } @@ -361,12 +361,12 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,isChecked) KVSO_CLASS_FUNCTION(treeWidgetItem,setCheckable) { - bool bEnabled; + bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bCheckable",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bCheckable",KVS_PT_BOOL,0,bEnabled) KVSO_PARAMETERS_END(c) if(!m_pTreeWidgetItem)return true; - m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsUserCheckable:m_pTreeWidgetItem->flags()&~Qt::ItemIsUserCheckable); + m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsUserCheckable:m_pTreeWidgetItem->flags()&~Qt::ItemIsUserCheckable); return true; } @@ -377,7 +377,7 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,isCheckable) c->returnValue()->setBoolean(false); return true; } - c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsUserCheckable); + c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsUserCheckable); return true; } @@ -403,14 +403,14 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,setPixmap) KVSO_PARAMETER("pixmap",KVS_PT_VARIANT,0,vPixmap) KVSO_PARAMETERS_END(c) QPixmap *pix = 0; - if (vPixmap->isEmpty()) {m_pTreeWidgetItem->setIcon(uCol,QIcon());return true;} + if (vPixmap->isEmpty()) {m_pTreeWidgetItem->setIcon(uCol,QIcon());return true;} if(vPixmap->isHObject()) { vPixmap->asHObject(obHpixmap); obPixmap=KviKvsKernel::instance()->objectController()->lookupObject(obHpixmap); if (!obPixmap->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object or image Id required","objects")); + c->warning(__tr2qs_ctx("Pixmap object or image Id required","objects")); return true; } pix=((KvsObject_pixmap *)obPixmap)->getPixmap(); @@ -420,7 +420,7 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,setPixmap) pix=g_pIconManager->getImage(szPix); if(!pix) { - c->warning(__tr2qs_ctx("Error occured: the suitable file '%Q' is not of the correct format or it is not a valid icon number.","objects"),&szPix); + c->warning(__tr2qs_ctx("Error occured: the suitable file '%Q' is not of the correct format or it is not a valid icon number.","objects"),&szPix); return true; } } |
