Forum
Sign Up
DataGrid for Qt.C++

TOPIC: Start edit mode with keyboard ?

Start edit mode with keyboard ? 2 years 4 months ago #1

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
The administrator has disabled public write access.

Re: Start edit mode with keyboard ? 2 years 4 months ago #2

  • bigz
  • bigz's Avatar
  • OFFLINE
  • More Details
    • Developer
    • Karma: 10
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.
The administrator has disabled public write access.

Re: Start edit mode with keyboard ? 2 years 4 months ago #3

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.
The administrator has disabled public write access.

Re: Start edit mode with keyboard ? 2 years 3 months ago #4

  • bigz
  • bigz's Avatar
  • OFFLINE
  • More Details
    • Developer
    • Karma: 10
This is a bug in our code. Thanks for the information. Bug was fixed and bugfix will be available in the next update.
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 )