Forum
Sign Up
× DataGrid for Qt.C++

Start edit mode with keyboard ?

10 years 2 months ago #1 by
To start editing a cell i must double click into the cell. How can i start editing with keyboard? In Excel you can start editing by press F2 oder type characters, digits etc.. I want to have the same behaviour.
Thanks
Ulrich

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

  • 's Avatar Topic Author
10 years 2 months ago #2 by Developer Machines
You can set various options for the start cell editing. For this purposes grid has GridEditorActivationPolicy enumerator and GridEditorRepository::setEditorActivationPolicy(GridEditorActivationPolicy policy) function. However, it does not provide start editing by pressing F2. To do that you need to catch F2 press event and invoke - GridViewBase::showEditor() function.

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

More
10 years 1 month ago #3 by
Replied by on topic Start edit mode with keyboard ?
Hi,
i insert the following into your largedataset demo:
column = (Qtitan::GridTableColumn *)view->getColumn(2);
    column->setEditorType(Qtitan::StringEditorType);

	Qtitan::GridEditorActivationPolicy editorPolicy = Qtitan::DblClick | Qtitan::KeyPress | Qtitan::Enter;
	column->editorRepository()->setEditorActivationPolicy(editorPolicy);
	column->editorRepository()->setAutoSelect(true);

    //Add cell button to the column.
    column->addButton(Qtitan::TextButton, Qtitan::RightPosition);
    column->addButton(Qtitan::ChoiceButton, Qtitan::RightPosition);

When a string cell i selected and i press a character, then the editor will displayed and the hole text is selected but the character is lost. It's the same behaviour as KeyPress_WithEating.

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

  • 's Avatar Topic Author
10 years 1 month ago #4 by Developer Machines
This is a bug in our code. Thanks for the information. Bug was fixed and bugfix will be available in the next update.

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

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.128 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 )