Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3594

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtablewidget.cpp -->
  <title>QTableWidgetItem Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QTableWidgetItem</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#subclassing">Subclassing</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QTableWidgetItem Class</h1>
<!-- $$$QTableWidgetItem-brief -->
<p>The <a href="qtablewidgetitem.html">QTableWidgetItem</a> class provides an item for use with the <a href="qtablewidget.html">QTableWidget</a> class. <a href="#details">More...</a></p>
<!-- @@@QTableWidgetItem -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QTableWidgetItem&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr></table></div><ul>
<li><a href="qtablewidgetitem-members.html">List of all members, including inherited members</a></li>
<li><a href="qtablewidgetitem-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#ItemType-enum">ItemType</a></b> { Type, UserType }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></b>(int <i>type</i> = Type)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#QTableWidgetItem-1">QTableWidgetItem</a></b>(const QString &amp;<i>text</i>, int <i>type</i> = Type)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#QTableWidgetItem-2">QTableWidgetItem</a></b>(const QIcon &amp;<i>icon</i>, const QString &amp;<i>text</i>, int <i>type</i> = Type)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#QTableWidgetItem-3">QTableWidgetItem</a></b>(const QTableWidgetItem &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#dtor.QTableWidgetItem">~QTableWidgetItem</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBrush </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#background">background</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::CheckState </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#checkState">checkState</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QTableWidgetItem *</td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#clone">clone</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#column">column</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#data">data</a></b>(int <i>role</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ItemFlags </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#flags">flags</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#font">font</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBrush </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#foreground">foreground</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#icon">icon</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#isSelected">isSelected</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#read">read</a></b>(QDataStream &amp;<i>in</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#row">row</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setBackground">setBackground</a></b>(const QBrush &amp;<i>brush</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setCheckState">setCheckState</a></b>(Qt::CheckState <i>state</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setData">setData</a></b>(int <i>role</i>, const QVariant &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setFlags">setFlags</a></b>(Qt::ItemFlags <i>flags</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setFont">setFont</a></b>(const QFont &amp;<i>font</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setForeground">setForeground</a></b>(const QBrush &amp;<i>brush</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setIcon">setIcon</a></b>(const QIcon &amp;<i>icon</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setSelected">setSelected</a></b>(bool <i>select</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setSizeHint">setSizeHint</a></b>(const QSize &amp;<i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setStatusTip">setStatusTip</a></b>(const QString &amp;<i>statusTip</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setText">setText</a></b>(const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setTextAlignment">setTextAlignment</a></b>(int <i>alignment</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setToolTip">setToolTip</a></b>(const QString &amp;<i>toolTip</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#setWhatsThis">setWhatsThis</a></b>(const QString &amp;<i>whatsThis</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#sizeHint">sizeHint</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#statusTip">statusTip</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTableWidget *</td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#tableWidget">tableWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#text">text</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#textAlignment">textAlignment</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#toolTip">toolTip</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#type">type</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#whatsThis">whatsThis</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#write">write</a></b>(QDataStream &amp;<i>out</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#operator-lt">operator&lt;</a></b>(const QTableWidgetItem &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTableWidgetItem &amp;</td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#operator-eq">operator=</a></b>(const QTableWidgetItem &amp;<i>other</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#operator-lt-lt">operator&lt;&lt;</a></b>(QDataStream &amp;<i>out</i>, const QTableWidgetItem &amp;<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qtablewidgetitem.html#operator-gt-gt">operator&gt;&gt;</a></b>(QDataStream &amp;<i>in</i>, QTableWidgetItem &amp;<i>item</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QTableWidgetItem-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qtablewidgetitem.html">QTableWidgetItem</a> class provides an item for use with the <a href="qtablewidget.html">QTableWidget</a> class.</p>
<p>Table items are used to hold pieces of information for table widgets. Items usually contain text, icons, or checkboxes</p>
<p>The <a href="qtablewidgetitem.html">QTableWidgetItem</a> class is a convenience class that replaces the <code>QTableItem</code> class in Qt 3. It provides an item for use with the <a href="qtablewidget.html">QTableWidget</a> class.</p>
<p>Top-level items are constructed without a parent then inserted at the position specified by a pair of row and column numbers:</p>
<pre class="cpp">

      <span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> <span class="operator">*</span>newItem <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span>(tr(<span class="string">&quot;%1&quot;</span>)<span class="operator">.</span>arg(
          pow(row<span class="operator">,</span> column<span class="operator">+</span><span class="number">1</span>)));
      tableWidget<span class="operator">-</span><span class="operator">&gt;</span>setItem(row<span class="operator">,</span> column<span class="operator">,</span> newItem);

</pre>
<p>Each item can have its own background brush which is set with the <a href="qtablewidgetitem.html#setBackground">setBackground</a>() function. The current background brush can be found with <a href="qtablewidgetitem.html#background">background</a>(). The text label for each item can be rendered with its own font and brush. These are specified with the <a href="qtablewidgetitem.html#setFont">setFont</a>() and <a href="qtablewidgetitem.html#setForeground">setForeground</a>() functions, and read with <a href="qtablewidgetitem.html#font">font</a>() and <a href="qtablewidgetitem.html#foreground">foreground</a>().</p>
<p>By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. Each item's flags can be changed by calling <a href="qtablewidgetitem.html#setFlags">setFlags</a>() with the appropriate value (see <a href="../qtcore/qt.html#ItemFlag-enum">Qt::ItemFlags</a>). Checkable items can be checked and unchecked with the <a href="qtablewidgetitem.html#setCheckState">setCheckState</a>() function. The corresponding <a href="qtablewidgetitem.html#checkState">checkState</a>() function indicates whether the item is currently checked.</p>
<a name="subclassing"></a>
<h3 >Subclassing</h3>
<p>When subclassing <a href="qtablewidgetitem.html">QTableWidgetItem</a> to provide custom items, it is possible to define new types for them so that they can be distinguished from standard items. The constructors for subclasses that require this feature need to call the base class constructor with a new type value equal to or greater than <a href="qtablewidgetitem.html#ItemType-enum">UserType</a>.</p>
</div>
<p><b>See also </b><a href="qtablewidget.html">QTableWidget</a>, <a href="model-view-programming.html">Model/View Programming</a>, <a href="qlistwidgetitem.html">QListWidgetItem</a>, and <a href="qtreewidgetitem.html">QTreeWidgetItem</a>.</p>
<!-- @@@QTableWidgetItem -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ItemType$$$Type$$$UserType -->
<h3 class="fn" id="ItemType-enum"><a name="ItemType-enum"></a>enum QTableWidgetItem::<span class="name">ItemType</span></h3>
<p>This enum describes the types that are used to describe table widget items.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTableWidgetItem::Type</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The default type for table widget items.</td></tr>
<tr><td class="topAlign"><code>QTableWidgetItem::UserType</code></td><td class="topAlign tblval"><code>1000</code></td><td class="topAlign">The minimum value for custom types. Values below UserType are reserved by Qt.</td></tr>
</table></div>
<p>You can define new user types in <a href="qtablewidgetitem.html">QTableWidgetItem</a> subclasses to ensure that custom items are treated specially.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#type">type</a>().</p>
<!-- @@@ItemType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTableWidgetItem[overload1]$$$QTableWidgetItemint -->
<h3 class="fn" id="QTableWidgetItem"><a name="QTableWidgetItem"></a>QTableWidgetItem::<span class="name">QTableWidgetItem</span>(<span class="type">int</span> <i>type</i> = Type)</h3>
<p>Constructs a table item of the specified <i>type</i> that does not belong to any table.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#type">type</a>().</p>
<!-- @@@QTableWidgetItem -->
<!-- $$$QTableWidgetItem$$$QTableWidgetItemconstQString&int -->
<h3 class="fn" id="QTableWidgetItem-1"><a name="QTableWidgetItem-1"></a>QTableWidgetItem::<span class="name">QTableWidgetItem</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type">int</span> <i>type</i> = Type)</h3>
<p>Constructs a table item with the given <i>text</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#type">type</a>().</p>
<!-- @@@QTableWidgetItem -->
<!-- $$$QTableWidgetItem$$$QTableWidgetItemconstQIcon&constQString&int -->
<h3 class="fn" id="QTableWidgetItem-2"><a name="QTableWidgetItem-2"></a>QTableWidgetItem::<span class="name">QTableWidgetItem</span>(const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type">int</span> <i>type</i> = Type)</h3>
<p>Constructs a table item with the given <i>icon</i> and <i>text</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#type">type</a>().</p>
<!-- @@@QTableWidgetItem -->
<!-- $$$QTableWidgetItem$$$QTableWidgetItemconstQTableWidgetItem& -->
<h3 class="fn" id="QTableWidgetItem-3"><a name="QTableWidgetItem-3"></a>QTableWidgetItem::<span class="name">QTableWidgetItem</span>(const <span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> &amp;<i>other</i>)</h3>
<p>Constructs a copy of <i>other</i>. Note that <a href="qtablewidgetitem.html#type">type</a>() and <a href="qtablewidgetitem.html#tableWidget">tableWidget</a>() are not copied.</p>
<p>This function is useful when reimplementing <a href="qtablewidgetitem.html#clone">clone</a>().</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#data">data</a>() and <a href="qtablewidgetitem.html#flags">flags</a>().</p>
<!-- @@@QTableWidgetItem -->
<!-- $$$~QTableWidgetItem[overload1]$$$~QTableWidgetItem -->
<h3 class="fn" id="dtor.QTableWidgetItem"><a name="dtor.QTableWidgetItem"></a><code>[virtual] </code>QTableWidgetItem::<span class="name">~QTableWidgetItem</span>()</h3>
<p>Destroys the table item.</p>
<!-- @@@~QTableWidgetItem -->
<!-- $$$background[overload1]$$$background -->
<h3 class="fn" id="background"><a name="background"></a><span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> QTableWidgetItem::<span class="name">background</span>() const</h3>
<p>Returns the brush used to render the item's background.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setBackground">setBackground</a>() and <a href="qtablewidgetitem.html#foreground">foreground</a>().</p>
<!-- @@@background -->
<!-- $$$checkState[overload1]$$$checkState -->
<h3 class="fn" id="checkState"><a name="checkState"></a><span class="type"><a href="../qtcore/qt.html#CheckState-enum">Qt::CheckState</a></span> QTableWidgetItem::<span class="name">checkState</span>() const</h3>
<p>Returns the checked state of the table item.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setCheckState">setCheckState</a>() and <a href="qtablewidgetitem.html#flags">flags</a>().</p>
<!-- @@@checkState -->
<!-- $$$clone[overload1]$$$clone -->
<h3 class="fn" id="clone"><a name="clone"></a><code>[virtual] </code><span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> *QTableWidgetItem::<span class="name">clone</span>() const</h3>
<p>Creates a copy of the item.</p>
<!-- @@@clone -->
<!-- $$$column[overload1]$$$column -->
<h3 class="fn" id="column"><a name="column"></a><span class="type">int</span> QTableWidgetItem::<span class="name">column</span>() const</h3>
<p>Returns the column of the item in the table. If the item is not in a table, this function will return -1.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#row">row</a>().</p>
<!-- @@@column -->
<!-- $$$data[overload1]$$$dataint -->
<h3 class="fn" id="data"><a name="data"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QTableWidgetItem::<span class="name">data</span>(<span class="type">int</span> <i>role</i>) const</h3>
<p>Returns the item's data for the given <i>role</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setData">setData</a>().</p>
<!-- @@@data -->
<!-- $$$flags[overload1]$$$flags -->
<h3 class="fn" id="flags"><a name="flags"></a><span class="type"><a href="../qtcore/qt.html#ItemFlag-enum">Qt::ItemFlags</a></span> QTableWidgetItem::<span class="name">flags</span>() const</h3>
<p>Returns the flags used to describe the item. These determine whether the item can be checked, edited, and selected.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setFlags">setFlags</a>().</p>
<!-- @@@flags -->
<!-- $$$font[overload1]$$$font -->
<h3 class="fn" id="font"><a name="font"></a><span class="type"><a href="../qtgui/qfont.html">QFont</a></span> QTableWidgetItem::<span class="name">font</span>() const</h3>
<p>Returns the font used to render the item's text.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setFont">setFont</a>().</p>
<!-- @@@font -->
<!-- $$$foreground[overload1]$$$foreground -->
<h3 class="fn" id="foreground"><a name="foreground"></a><span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> QTableWidgetItem::<span class="name">foreground</span>() const</h3>
<p>Returns the brush used to render the item's foreground (e.g&#x2e; text).</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setForeground">setForeground</a>() and <a href="qtablewidgetitem.html#background">background</a>().</p>
<!-- @@@foreground -->
<!-- $$$icon[overload1]$$$icon -->
<h3 class="fn" id="icon"><a name="icon"></a><span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> QTableWidgetItem::<span class="name">icon</span>() const</h3>
<p>Returns the item's icon.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setIcon">setIcon</a>() and <a href="qabstractitemview.html#iconSize-prop">iconSize</a>.</p>
<!-- @@@icon -->
<!-- $$$isSelected[overload1]$$$isSelected -->
<h3 class="fn" id="isSelected"><a name="isSelected"></a><span class="type">bool</span> QTableWidgetItem::<span class="name">isSelected</span>() const</h3>
<p>Returns <code>true</code> if the item is selected, otherwise returns <code>false</code>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setSelected">setSelected</a>().</p>
<!-- @@@isSelected -->
<!-- $$$read[overload1]$$$readQDataStream& -->
<h3 class="fn" id="read"><a name="read"></a><code>[virtual] </code><span class="type">void</span> QTableWidgetItem::<span class="name">read</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>in</i>)</h3>
<p>Reads the item from stream <i>in</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#write">write</a>().</p>
<!-- @@@read -->
<!-- $$$row[overload1]$$$row -->
<h3 class="fn" id="row"><a name="row"></a><span class="type">int</span> QTableWidgetItem::<span class="name">row</span>() const</h3>
<p>Returns the row of the item in the table. If the item is not in a table, this function will return -1.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#column">column</a>().</p>
<!-- @@@row -->
<!-- $$$setBackground[overload1]$$$setBackgroundconstQBrush& -->
<h3 class="fn" id="setBackground"><a name="setBackground"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setBackground</span>(const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i>)</h3>
<p>Sets the item's background brush to the specified <i>brush</i>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#background">background</a>() and <a href="qtablewidgetitem.html#setForeground">setForeground</a>().</p>
<!-- @@@setBackground -->
<!-- $$$setCheckState[overload1]$$$setCheckStateQt::CheckState -->
<h3 class="fn" id="setCheckState"><a name="setCheckState"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setCheckState</span>(<span class="type"><a href="../qtcore/qt.html#CheckState-enum">Qt::CheckState</a></span> <i>state</i>)</h3>
<p>Sets the check state of the table item to be <i>state</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#checkState">checkState</a>().</p>
<!-- @@@setCheckState -->
<!-- $$$setData[overload1]$$$setDataintconstQVariant& -->
<h3 class="fn" id="setData"><a name="setData"></a><code>[virtual] </code><span class="type">void</span> QTableWidgetItem::<span class="name">setData</span>(<span class="type">int</span> <i>role</i>, const <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> &amp;<i>value</i>)</h3>
<p>Sets the item's data for the given <i>role</i> to the specified <i>value</i>.</p>
<p><b>See also </b><a href="../qtcore/qt.html#ItemDataRole-enum">Qt::ItemDataRole</a> and <a href="qtablewidgetitem.html#data">data</a>().</p>
<!-- @@@setData -->
<!-- $$$setFlags[overload1]$$$setFlagsQt::ItemFlags -->
<h3 class="fn" id="setFlags"><a name="setFlags"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setFlags</span>(<span class="type"><a href="../qtcore/qt.html#ItemFlag-enum">Qt::ItemFlags</a></span> <i>flags</i>)</h3>
<p>Sets the flags for the item to the given <i>flags</i>. These determine whether the item can be selected or modified.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#flags">flags</a>().</p>
<!-- @@@setFlags -->
<!-- $$$setFont[overload1]$$$setFontconstQFont& -->
<h3 class="fn" id="setFont"><a name="setFont"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setFont</span>(const <span class="type"><a href="../qtgui/qfont.html">QFont</a></span> &amp;<i>font</i>)</h3>
<p>Sets the font used to display the item's text to the given <i>font</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#font">font</a>(), <a href="qtablewidgetitem.html#setText">setText</a>(), and <a href="qtablewidgetitem.html#setForeground">setForeground</a>().</p>
<!-- @@@setFont -->
<!-- $$$setForeground[overload1]$$$setForegroundconstQBrush& -->
<h3 class="fn" id="setForeground"><a name="setForeground"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setForeground</span>(const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i>)</h3>
<p>Sets the item's foreground brush to the specified <i>brush</i>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#foreground">foreground</a>() and <a href="qtablewidgetitem.html#setBackground">setBackground</a>().</p>
<!-- @@@setForeground -->
<!-- $$$setIcon[overload1]$$$setIconconstQIcon& -->
<h3 class="fn" id="setIcon"><a name="setIcon"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setIcon</span>(const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>)</h3>
<p>Sets the item's icon to the <i>icon</i> specified.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#icon">icon</a>(), <a href="qtablewidgetitem.html#setText">setText</a>(), and <a href="qabstractitemview.html#iconSize-prop">iconSize</a>.</p>
<!-- @@@setIcon -->
<!-- $$$setSelected[overload1]$$$setSelectedbool -->
<h3 class="fn" id="setSelected"><a name="setSelected"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setSelected</span>(<span class="type">bool</span> <i>select</i>)</h3>
<p>Sets the selected state of the item to <i>select</i>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#isSelected">isSelected</a>().</p>
<!-- @@@setSelected -->
<!-- $$$setSizeHint[overload1]$$$setSizeHintconstQSize& -->
<h3 class="fn" id="setSizeHint"><a name="setSizeHint"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setSizeHint</span>(const <span class="type"><a href="../qtcore/qsize.html">QSize</a></span> &amp;<i>size</i>)</h3>
<p>Sets the size hint for the table item to be <i>size</i>. If no size hint is set, the item delegate will compute the size hint based on the item data.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#sizeHint">sizeHint</a>().</p>
<!-- @@@setSizeHint -->
<!-- $$$setStatusTip[overload1]$$$setStatusTipconstQString& -->
<h3 class="fn" id="setStatusTip"><a name="setStatusTip"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setStatusTip</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>statusTip</i>)</h3>
<p>Sets the status tip for the table item to the text specified by <i>statusTip</i>. <a href="qtablewidget.html">QTableWidget</a> mouse tracking needs to be enabled for this feature to work.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#statusTip">statusTip</a>(), <a href="qtablewidgetitem.html#setToolTip">setToolTip</a>(), and <a href="qtablewidgetitem.html#setWhatsThis">setWhatsThis</a>().</p>
<!-- @@@setStatusTip -->
<!-- $$$setText[overload1]$$$setTextconstQString& -->
<h3 class="fn" id="setText"><a name="setText"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setText</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Sets the item's text to the <i>text</i> specified.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#text">text</a>(), <a href="qtablewidgetitem.html#setFont">setFont</a>(), and <a href="qtablewidgetitem.html#setForeground">setForeground</a>().</p>
<!-- @@@setText -->
<!-- $$$setTextAlignment[overload1]$$$setTextAlignmentint -->
<h3 class="fn" id="setTextAlignment"><a name="setTextAlignment"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setTextAlignment</span>(<span class="type">int</span> <i>alignment</i>)</h3>
<p>Sets the text alignment for the item's text to the <i>alignment</i> specified.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#textAlignment">textAlignment</a>() and <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a>.</p>
<!-- @@@setTextAlignment -->
<!-- $$$setToolTip[overload1]$$$setToolTipconstQString& -->
<h3 class="fn" id="setToolTip"><a name="setToolTip"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setToolTip</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>toolTip</i>)</h3>
<p>Sets the item's tooltip to the string specified by <i>toolTip</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#toolTip">toolTip</a>(), <a href="qtablewidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qtablewidgetitem.html#setWhatsThis">setWhatsThis</a>().</p>
<!-- @@@setToolTip -->
<!-- $$$setWhatsThis[overload1]$$$setWhatsThisconstQString& -->
<h3 class="fn" id="setWhatsThis"><a name="setWhatsThis"></a><span class="type">void</span> QTableWidgetItem::<span class="name">setWhatsThis</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>whatsThis</i>)</h3>
<p>Sets the item's &quot;What's This?&quot; help to the string specified by <i>whatsThis</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#whatsThis">whatsThis</a>(), <a href="qtablewidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qtablewidgetitem.html#setToolTip">setToolTip</a>().</p>
<!-- @@@setWhatsThis -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QTableWidgetItem::<span class="name">sizeHint</span>() const</h3>
<p>Returns the size hint set for the table item.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setSizeHint">setSizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$statusTip[overload1]$$$statusTip -->
<h3 class="fn" id="statusTip"><a name="statusTip"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTableWidgetItem::<span class="name">statusTip</span>() const</h3>
<p>Returns the item's status tip.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setStatusTip">setStatusTip</a>().</p>
<!-- @@@statusTip -->
<!-- $$$tableWidget[overload1]$$$tableWidget -->
<h3 class="fn" id="tableWidget"><a name="tableWidget"></a><span class="type"><a href="qtablewidget.html">QTableWidget</a></span> *QTableWidgetItem::<span class="name">tableWidget</span>() const</h3>
<p>Returns the table widget that contains the item.</p>
<!-- @@@tableWidget -->
<!-- $$$text[overload1]$$$text -->
<h3 class="fn" id="text"><a name="text"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTableWidgetItem::<span class="name">text</span>() const</h3>
<p>Returns the item's text.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setText">setText</a>().</p>
<!-- @@@text -->
<!-- $$$textAlignment[overload1]$$$textAlignment -->
<h3 class="fn" id="textAlignment"><a name="textAlignment"></a><span class="type">int</span> QTableWidgetItem::<span class="name">textAlignment</span>() const</h3>
<p>Returns the text alignment for the item's text.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setTextAlignment">setTextAlignment</a>() and <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a>.</p>
<!-- @@@textAlignment -->
<!-- $$$toolTip[overload1]$$$toolTip -->
<h3 class="fn" id="toolTip"><a name="toolTip"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTableWidgetItem::<span class="name">toolTip</span>() const</h3>
<p>Returns the item's tooltip.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setToolTip">setToolTip</a>().</p>
<!-- @@@toolTip -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn" id="type"><a name="type"></a><span class="type">int</span> QTableWidgetItem::<span class="name">type</span>() const</h3>
<p>Returns the type passed to the <a href="qtablewidgetitem.html">QTableWidgetItem</a> constructor.</p>
<!-- @@@type -->
<!-- $$$whatsThis[overload1]$$$whatsThis -->
<h3 class="fn" id="whatsThis"><a name="whatsThis"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTableWidgetItem::<span class="name">whatsThis</span>() const</h3>
<p>Returns the item's &quot;What's This?&quot; help.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#setWhatsThis">setWhatsThis</a>().</p>
<!-- @@@whatsThis -->
<!-- $$$write[overload1]$$$writeQDataStream& -->
<h3 class="fn" id="write"><a name="write"></a><code>[virtual] </code><span class="type">void</span> QTableWidgetItem::<span class="name">write</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>out</i>) const</h3>
<p>Writes the item to stream <i>out</i>.</p>
<p><b>See also </b><a href="qtablewidgetitem.html#read">read</a>().</p>
<!-- @@@write -->
<!-- $$$operator<[overload1]$$$operator<constQTableWidgetItem& -->
<h3 class="fn" id="operator-lt"><a name="operator-lt"></a><code>[virtual] </code><span class="type">bool</span> QTableWidgetItem::<span class="name">operator&lt;</span>(const <span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if the item is less than the <i>other</i> item; otherwise returns false.</p>
<!-- @@@operator< -->
<!-- $$$operator=[overload1]$$$operator=constQTableWidgetItem& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> &amp;QTableWidgetItem::<span class="name">operator=</span>(const <span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> &amp;<i>other</i>)</h3>
<p>Assigns <i>other</i>'s data and flags to this item. Note that <a href="qtablewidgetitem.html#type">type</a>() and <a href="qtablewidgetitem.html#tableWidget">tableWidget</a>() are not copied.</p>
<p>This function is useful when reimplementing <a href="qtablewidgetitem.html#clone">clone</a>().</p>
<p><b>See also </b><a href="qtablewidgetitem.html#data">data</a>() and <a href="qtablewidgetitem.html#flags">flags</a>().</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<[overload1]$$$operator<<QDataStream&constQTableWidgetItem& -->
<h3 class="fn" id="operator-lt-lt"><a name="operator-lt-lt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&lt;&lt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>out</i>, const <span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> &amp;<i>item</i>)</h3>
<p>Writes the table widget item <i>item</i> to stream <i>out</i>.</p>
<p>This operator uses <a href="qtablewidgetitem.html#write">QTableWidgetItem::write</a>().</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>[overload1]$$$operator>>QDataStream&QTableWidgetItem& -->
<h3 class="fn" id="operator-gt-gt"><a name="operator-gt-gt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&gt;&gt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>in</i>, <span class="type"><a href="qtablewidgetitem.html#QTableWidgetItem">QTableWidgetItem</a></span> &amp;<i>item</i>)</h3>
<p>Reads a table widget item from stream <i>in</i> into <i>item</i>.</p>
<p>This operator uses <a href="qtablewidgetitem.html#read">QTableWidgetItem::read</a>().</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>