editing cell
(1 viewing) (1) Guest
DataGrid for Qt.C++
  • Page:
  • 1

TOPIC: editing cell

editing cell

#467 1 year, 8 months ago
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

Re: editing cell

#468 1 year, 8 months ago
For the first point i find the method setAutoSelect.
  • bigz
  • OFFLINE
  • Developer
  • Karma: 10

Re: editing cell

#476 1 year, 7 months ago
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.

Re: editing cell

#480 1 year, 7 months ago
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
  • Page:
  • 1
Time to create page: 0.11 seconds

Developer's Newsletter


Register to our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt, 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:

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:

support@devmachines.com ( any questions related to our products or services )
license@devmachines.com ( questions related to licensing )

Copyright © 2009-2014 Developer Machines. All Rights Reserved.

Login to Developer Machines

Welcome to Developer Machines CMS



Developer Machines Registration



*
*
*
*
*

Fields marked with an asterisk (*) are required.