Forum
Sign Up
DataGrid for Qt.C++

TOPIC: editing cell

editing cell 2 years 4 months ago #1

Hi,
when i start editing a cell i want that all inside the editor widget will selected and when the editor widget lost the focus the editing will end. How can i do this?
Thanks
Ulrich
The administrator has disabled public write access.

Re: editing cell 2 years 4 months ago #2

For the first point i find the method setAutoSelect.
The administrator has disabled public write access.

Re: editing cell 2 years 3 months ago #3

  • bigz
  • bigz's Avatar
  • OFFLINE
  • More Details
    • Developer
    • Karma: 10
Now there is no way to do so. But you can catch event when a grid lost focus and finish editing manualy - GridTableView::closeEditor() or GridTableView::hideEditor().

P.S. GridTableView::hideEditor() - close editing without setting new value to the model.
The administrator has disabled public write access.

Re: editing cell 2 years 3 months ago #4

I catch the event with the following code:
void HeadLineGrid::focusOutEvent(QFocusEvent* pEvent)
{
	if(pEvent->lostFocus())
	{
		qDebug() << tr("HeadLineGrid::focusOutEvent");
		GridTableView* pView = view<GridBandedTableView>();
		if(pView && pView->isEditing())
		{
			pView->closeEditor();
			return;
		}
	}
	Grid::focusOutEvent(pEvent);
}

When i run the program i get an unhandled exception in EmbedGraphicPrimitive::focusInEvent.

Could you send me an example?

Thanks
The administrator has disabled public write access.
Moderators: richmendoza
Time to create page: 0.109 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )