Highlight entire row of a QTableWidget - c++

I want to highlight the entire row of a my QTableWidget when I click on one cell of this row.
I already put a connection between an activation of my cell and my function highlightRow :
QObject::connect(ui->variableTableWidget,SIGNAL(cellActivated(int,int)), this, SLOT(highlightRow()));
Now I have to write my function, but I don't know how could I know which cell is activated.
Is there a function in the QTableWidget that is suppose to return all activated cell ?

Call this on your table widget when it is created
setSelectionBehavior(QAbstractItemView::SelectRows);
this will make it so that when you click on a cell that row is selected

Related

QTableView force one cell selection

I want the user to be able to select only one cell at time. How can I set the maximum possible selection of cells of a QTableView to 1 (c++) ?
Set selectionMode to SingleSelection and set selectionBehavior to SelectItems
tableView->setSelectionMode(QAbstractItemView::SingleSelection);
tableView->setSelectionBehavior(QAbstractItemView::SelectItems);

Adding fields to datasets through GUI in SAS EG

I would like to add a couple of fields to an existing dataset in SAS EG. Can I do this through a properties dialog, without having to write code?
If you are in Update mode (easiest way - double click on any cell, choose yes), you can right click on a column header (the variable label up top) where you want to insert the new one and select "Insert Column".
you need to open table (douple clic on it) and try to edit (double click on the row filed) -> in pop up window select to transfer table in update mode. After its done, select whole row and in right click menu u will see add or delete rows options.
p.s. you can also add coloumns via similar manipulations.

How to get current value show in listbox in a cell for an Open Office Macro?

I am trying to yank the value from a listbox which is in a cell. Whenever I query the value however, it returns the first entry in the listbox, regardless of the current selection showing in the cell.
How do I access the current value displayed in the listbox?
Thank you for your help!
If this one dropdown list for one cell, you could create a (hidden) list in a column. In the first cell of this list, you place a reference to the listbox cell.
e.g.
Column D
=A1
2nd FIXED value
3rd FIXED value
4th FIXED value
in A1, you put the dropdown with validity, cell list D1...D4.
Whatever you have in A1 will show up as a selectable option in your dropdown list.

How to update the data of slickgrid on row change?

I want to update the slickgrid on everyrowchange in the sense after making the changes in entire row i want event to fire update.
Can anybody suggest please?
SlickGrid has no concept of editing a row, only editing individual cells. If the user edits several cells in a row, how would you decide when the edit to the whole row is complete?
If you consider the row complete when the last column is edited, you can set an event handler on cell edit for the last column and react appropriately.
You could keep an array of "Dirty Row IDs".
Then when the selected row changes, loop through your array of Dirty Row IDs and do your thing.

How to add rows that include formula in spreadsheet?

I am working with a spreadsheet in OpenOffice. This spreadsheet already has the
formulas for each row. I need to add additional rows to this spreadsheet, but don't
know how to do so in order that it copys the formula but applies it to that row.
For example, each row has 8 columns (A-H), and there are formulas in D,F,G,and H. The formulas apply to each row, for example the last row on the sheet is the 6th row, so the formulas read like: =+B6*C6, =+E6*B6, etc.
Lets say I need to add a 7th row that utilizes the same formulas, but don't want to have to manually enter it for each new row so that it applies (for example: =+B7*C7, etc) How would I accomplish this?
Normal copy and paste will do that. That's the beauty of a spreadsheet. Although the formula looks like it says "B6" it is actually stored internally as something like "three cells to the left" so when you copy it to the row below, it is still "three cells to the left" only it appears as B7.
You can also select (click) the cell with the formula, then drag the little black square in the bottom right hand corner of your selection, down to repeat however many times you need it to.
I found a way.
Select the entire row (clicking on the row number), hold Ctrl+Alt and drag the row to the line below. It will copy+insert the row.
You can also copy the entire row and "paste special" (Ctrl+Shift+V) selecting the option to shift the cells down
I just didn't find a way to insert many rows at once with the data.
(I now it´s an old post, but it´s to help people looking on Google)
Excel tables auto fill formulas as new rows are added.
As easy as it sounds to copy/fill formulas down, it is usually beyond a users ability to either comprehend or remember to do the fill. OpenOffice/libre office, etc., needs to be able to do so.
Although new rows with copied formulas can be inserted anywhere for any reason, these instructions assume that you have spreadsheet with many data rows. And above is/are header rows. And below is/are total rows. And it is your desire to add a row to the bottom of the data rows (immediately above the total rows) and that the data rows contain formulas you would like to copy. And the new data row is to applied to the total below.
The first time you do it... not so easy... After that... two clicks...
Select the row with the formulas by clicking the row number (the last data row).
Copy the row (Ctrl+C).
Press the down arrow (now on footer row possibly containing summation formulas).
Begin a special paste operation (Ctrl+Shift+V).
Change the "selection" check marks so that only "Formulas" is selected.
Chose "Down" in "Shift Cells".
Hit "OK" (or press Return) to inset the row.
Edit the summation formula (F2) and make sure the summation range is still correct. If it is not, then you can manually fix the range, but you really need to change the following LibreOffice setting:
Choose menu option "Tools" (Alt-T).
Choose "Options" (O) in the "Tools" menu.
Expand "LibreOffice Calc" (Hit the disclosure triangle there).
Select "General" in the "LibreOffice Calc" expansion list.
Put a checkmark in (click) the "Expand references when new columns/rows are inserted"
Now that you have the row in the copy buffer and proper setup is complete, you only need to be on the first footer row, press Ctrl+Shift+V and hit Return.