Forum
Sign Up
× DataGrid for Qt.C++

editing cell

10 years 1 month ago #1 by
editing cell was created by
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

Please Log in or Create an account to join the conversation.

  • 's Avatar Topic Author
10 years 1 month ago #2 by
Replied by on topic editing cell
For the first point i find the method setAutoSelect.

Please Log in or Create an account to join the conversation.

  • 's Avatar Topic Author
10 years 1 month ago #3 by Developer Machines
Replied by Developer Machines on topic editing cell
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.

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #4 by
Replied by on topic editing cell
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

Please Log in or Create an account to join the conversation.

  • 's Avatar Topic Author
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.149 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 )