Forum
Sign Up
× DataGrid for Qt.C++

GridTableViewOptions: Row Selection

12 years 10 months ago - 12 years 10 months ago #1 by Stefan
GridTableViewOptions: Row Selection was created by Stefan
I would like to be able to prevent the rubberband around focused cells and prevent selected row highlighting.

Based on what I saw in the demos I tried the following, but it seemed to have no effect:
tableView->setViewType(Qtitan::Grid::TableView);
Qtitan::GridTableView* view = tableView->view<Qtitan::GridTableView>();
view->options().setRubberBandSelection(false);
view->options().setShowFocusDecoration(false);
view->setModel(model);
Am I doing something wrong?
Last edit: 12 years 10 months ago by Stefan. Reason: spelling

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

  • Stefan
  • Stefan's Avatar Topic Author
12 years 10 months ago #2 by Developer Machines
I think you need to set the selection policy for the view:
view->options().setSelectionPolicy(Qtitan::SelectSingleCell);
In this case the rubber band is not used for selection and only one cell has focus.
Let me know, whether this solution is that you are looking for.

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

More
12 years 10 months ago #3 by Stefan
Replied by Stefan on topic GridTableViewOptions: Row Selection
My code now looks like this:
tableView->setViewType(Qtitan::Grid::TableView);
Qtitan::GridTableView* view = tableView->view<Qtitan::GridTableView>();
view->setModel(model);

view->options().setRubberBandSelection(false);
view->options().setShowFocusDecoration(false);
view->options().setSelectionPolicy(Qtitan::SelectSingleCell);
When clicking the grid only one cell is selected, but it still has the rubberband around it and it is still highlighted.

What are setRubberBandSelection(bool) and setShowFocusDecoration(bool) supposed to do? As far as I can tell, they have no effect.

:wq

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

  • Stefan
  • Stefan's Avatar Topic Author
12 years 10 months ago #4 by Developer Machines
My understanding of rubberband is a rubber square that marks the cell, when multi-selection cell's/row's mode is enabled. Maybe you mean a focus-frame around the cell? Can you attach a screenshot showing the problem?

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

More
12 years 3 months ago - 12 years 3 months ago #5 by Stefan
Replied by Stefan on topic GridTableViewOptions: Row Selection
I added the following lines to the constructor Window::Window() in window.cpp of the "addingnewrow" demo project of QtitanDataGrid 2.6:
view->options().setRubberBandSelection(false);
view->options().setShowFocusDecoration(false);
view->options().setSelectionPolicy(Qtitan::SelectSingleCell);

I've attached a screenshot with a single cell selected showing what I think is the rubberband around the cell (dotted white border around inside edge of the cell). Maybe my idea of what the rubberband is incorrect.

Also, what does setShowFocusDecoration(bool) control?
Attachments:
Last edit: 12 years 3 months ago by Stefan.

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

  • Stefan
  • Stefan'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.139 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 )