Home > Mobile >  QWidgetTable child controls implementation row selected
QWidgetTable child controls implementation row selected

Time:09-26

1, use QWidgetTable create a table, each cell in a QLineEdit, the diagram below:

2, to focus on QLineEdit, selected QLineEdit in line at the same time,
3, QLineEdit associated with QWidgetTable code is as follows:
 HZTableItemBtn * iBtn=new HZTableItemBtn (HZTableItemBtn: : ItemType_Color, _editType); 
IBtn - & gt; SetParentTable (this);
IBtn - & gt; SetGeometry (0, 0, 25, 25);
QHBoxLayout * layout=new QHBoxLayout ();
QWidget * widget=new QWidget ();
Layout - & gt; AddWidget (iBtn);
Widgets - & gt; SetLayout (layout);

4, found a lot of kinds of methods are not achieve them, have a great spirit under the guidance of,

CodePudding user response:

//set the table for the entire line to select

Table - & gt; SetSelectionBehavior (QAbstractItemView: SelectRows);

Parameters:

AbstractItemView. SelectItems -- --
select a single cell
QAbstractItemView. SelectRows -- -- select one line

A list of QAbstractItemView. SelectColumns -- -- selected

CodePudding user response:

The
reference 1/f, to be continued _1006 response:
//set the table for the entire line to select

Table - & gt; SetSelectionBehavior (QAbstractItemView: SelectRows);

Parameters:

AbstractItemView. SelectItems -- --
select a single cell
QAbstractItemView. SelectRows -- -- select one line

QAbstractItemView. SelectColumns -- -- select a list
baidu search out what not to post, the topic
  •  Tags:  
  • Qt
  • Related