Toolbox Qt
Loading...
Searching...
No Matches
tbq::TableWidgetItemLink Class Reference

Qt widget item allowing to store link informations. More...

Inheritance diagram for tbq::TableWidgetItemLink:
Collaboration diagram for tbq::TableWidgetItemLink:

Public Member Functions

 TableWidgetItemLink ()
 Construct a table item link.
 
 TableWidgetItemLink (const RichLink &link)
 Construct a table item link with the given link.
 
 TableWidgetItemLink (const QIcon &icon, const RichLink &link)
 Construct a table item link with the given icon and link.
 
bool openLink () const
 Allow to open item link URL.
 
void setLink (const RichLink &link)
 Use to set link of the item.
 

Static Public Member Functions

static bool isTypeId (const QTableWidgetItem *item)
 Use to verify if a QTableWidgetItem is a TableWidgetItemLink.
 

Static Public Attributes

static constexpr int TypeId = QTableWidgetItem::UserType + 1
 

Detailed Description

Qt widget item allowing to store link informations.

Note that this class inherit from QTableWidgetItem.
Events management required usage of TableWidgetLinkHelper

See also
TableWidgetLinkHelper

Constructor & Destructor Documentation

◆ TableWidgetItemLink() [1/3]

tbq::TableWidgetItemLink::TableWidgetItemLink ( )

Construct a table item link.

See also
setLink()

◆ TableWidgetItemLink() [2/3]

tbq::TableWidgetItemLink::TableWidgetItemLink ( const RichLink & link)

Construct a table item link with the given link.

Parameters
[in]linkRich link to use for the item.
See also
setLink()

◆ TableWidgetItemLink() [3/3]

tbq::TableWidgetItemLink::TableWidgetItemLink ( const QIcon & icon,
const RichLink & link )

Construct a table item link with the given icon and link.

Parameters
[in]iconIcon to use for the item.
[in]linkRich link to use for the item.
See also
setLink()

Member Function Documentation

◆ isTypeId()

bool tbq::TableWidgetItemLink::isTypeId ( const QTableWidgetItem * item)
static

Use to verify if a QTableWidgetItem is a TableWidgetItemLink.

Can be useful is the type must be cast:

auto *linkItem = static_cast<TableWidgetItemLink *>(item);
// Do something with it
}else{
// Not a TableWidgetItemLink, do something else
}
Parameters
[in]itemTable widget item to verify.
if NULL, false will be returned.
Returns
Returns true if item is a TableWidgetItemLink object.

◆ openLink()

bool tbq::TableWidgetItemLink::openLink ( ) const

Allow to open item link URL.

Returns
Returns true if opening the URL has been accepted. This doesn't mean that the URL opening succeed, only that the request is accepted.

◆ setLink()

void tbq::TableWidgetItemLink::setLink ( const RichLink & link)

Use to set link of the item.

Parameters
[in]linkRich link to use for the item.

The documentation for this class was generated from the following files: