Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm working with a QTableView and I want add a QComboBox in the 3rd column of every cell. There will be thousands of cells so I have opted for an in place editor solution. I want the combo box to be displayed when the user enters a cell by clicking or when the users uses the arrow key to select a cell in the 3rd column.
void FixtureCalibrationPage::on_View_clicked(const QModelIndex & index)
{
if(!index.isValid()) return;
if(index.column() != 3) return;
if(selected_table_row == index.row()) return;
if(selected_table_row != -1) { //clean up
ui.view->setIndexWidget(index, NULL);
}
selected_table_row = index.row();
ui.view->setIndexWidget(index, &m_combo_box_selection); //set the
}
Click does not cover the case of using a the arrow keys. Is my only option to manually check if the users pressed the Arrow key or does another solution already exists?
That's what delegates are for. Create a delegate object for the view and set it on the 3rd column by using setItemDelegateForColumn. Note that delegates must not be shared by multiple views. Each view needs its own delegate. It makes sense for the delegate to be a child of the view.
In your delegate, you will create the combo box in the implementation of createEditor method. You of course need to implement setEditorData, setModelData, etc.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am using aws dynamodb.
Let's say I have a slideshow gallery like below.
There are only 3 columns in my Table "Banners" which are id, createAt and url.
I can use upload button to upload photo.
When I press upload, 2 api will be called.
The first one is to create photo and store it at aws s3 bucket and then return the url, and the second one is used to store the url in Table "Banner".
Now I've come up a new design as below.
Every time I upload photo, it will show in "inactive banner".
The "Active Banner" will be shown in the slideshow at the top.
I can drag and drop the photo from "inactive banner" to "active banner" and vice versa.
Also, the order inside "active banner" can be changed by dragging to different position.
Every time I make changes, I need to click save to call api(PATCH/PUT) and make it work.
I have a few questions for the design.
1.Do I need to add more column in my dynamodb or new table? If yes, what should I do?
2.When I create/update banner, what actions should I do? I am not sure how to make it work by make http request.
As it is one-to-one data ; so need to create multiple tables. Simple design would be to add two more columns in your table :
boolean activeOrInactive
int order
whenever you create banner; u would continue doing whatever u are right now along with default values of these two new columns also. During update banner; u will just update those values.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a grid set up with a bunch of columns and rows. Right now im able to double click a cell and create a new frame. But I would like to capture the row data on the double click and display that in the new frame. I understand how to create a new frame and display data in it, i just need help in capturing the row data on the double click
was able to achieve this by using GetCellValue(); in wxWidgets.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I generate a Timeline with data of a SQL query. I use various timesheets in the same row. The problem is, that sometimes I get same timesheet from two different query in a row, so these are in full cover. In this case I would like to see only one.
Is there a built in feature in the API to handle this situation?
Example: http://i.stack.imgur.com/KVClR.jpg
I am not certain that this will work, but you could try grouping your data before drawing the chart:
// the first array should contain a list of all of your column indicies, the second should be empty
var groupedData = google.visualization.data.group(data, [0, 1, 2, 3], []);
This will create a DataTable identical to your original, except any rows that are exact duplicates will be reduced to a single row.
It is probably faster to handle this in SQL than in javascript, though.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
For example: I have 2 lists (company and workers)
I would like to make a worker list view that will display all needed worker data + company.name + company.id
I know lookup field will display one specified column, but how can I bind another one to same lookup?
Thanks...
When you are creating the new lookup column in your workers list, it would ask you for the list from which you want to lookup (company in our case).
After that you need to specify which column's value you want to use as lookup value (this is the one specified column that you have said in your question).
Underneath that it would show a list of all columns available in the looked up list.
Select all columns that you want to show from your looked-up (company) list into your (worker) list view.
Note: dont think that now you would be asked for values of all these other selected columns when you are creating a new (worker) item. It would only ask for the primary column value (company title in our example). The other selected columns are only for display purpose and fetch values directly from looked-up list item.
You can also find my detailed blog post on this matter here.
Does anyone know how to add a new row (to add completely new data) to the TableView - directly to the control? Editing is quite easy, but how to add new data?
I thought this should not be a problem (as I know this from other prog. languages), but on the entire internet I have found only this one related topic posted a year ago which is not answered still. Is it imposible to do this in JavaFX?
JavaFX 2 TableView inserting rows directly on the control
Thank you very much.
TableView is backed by an items list, add a new entry to the items list and a row corresponding to the entry will be displayed in the TableView.
tableView.getItems().add(new Item());