Especially when we can remove the code for loading the binary bits of
the old project file format, this should allow us to get rid of a ton of
static_casts.
This adds visual sort indicators to the already working multi-column
sorting. Qt sort indicator is disabled, so only one indicator per column
is visible.
Unicode characters are used to indicate direction (triangles) and sort
column order (superscript numbers).
See issue #1761
A new dialog for editing conditional formats that can be invoked from the
filter line editor or from the data browser contextual menus. The dialog
allows adding and removing conditional formats, changing the priority order
and editing foreground colour, background colour and filter condition.
The conditional formats have been expanded to allow defining the foreground
colour. By default is the setting configured by user.
This is a continuation of the functionality introduced in PR #1503.
This undoes 9e2f8e5ede and try to solve the
issues present in Linux with Qt 5.9 and the one in Windows with the Dark
Style at the same time.
I think both issues come from using the filter box height as y offset. The
real offset has to be the original table header height. In Windows+Dark the
box is apparently shorter, so after moving, part of the header is clipped.
In Linux+Qt5.9, the original header height is shorter than the filter box,
so moving by the filter box height clips the filter box at the bottom.
The new height increment for the table header is also reduced to 4, so the
margin is 2 in both the bottom and the top of the filter boxes.
See issue #1493
The filter box was clipped one or two pixels for both the follow-desktop
mode and the dark-style mode. This fixes it, but not sure if it will fix
the problem reported in issue #1493 in Windows.
After setting a filter, the user can select from the context menu in the
filter line a new option "Use for Conditional Format", that assigns
automatically a colour to the background of cells fulfilling that
condition.
The formatting is preserved after the user has removed the filter. Several
conditional formats can be successively added to a column using different
filters.
The conditional formats of a column can be cleared when the filter is empty
selecting "Clear All Conditional Formats" from the filter line context
menu.
The conditional formats are saved and loaded in project files as other
browse table settings.
A new class Palette has been added for reusing the automatic colour
assignment of the Plot Dock. It takes into account the theme kind of the
application (dark, light) for the colour selection.
A new class CondFormat for using the conditional formatting settings from
several classes. The conversion of a filter string from our format to an
SQL condition has been moved here for reuse in filters and conditional
formatting.
Whether the conditional format applies is resolved by SQLite, so filters
and conditional formats give the same exact results.
Code for getting a pragma value has been reused for getting the condition
result, and consequently renamed to selectSingleCell.
Possible future improvement:
- New dialog for editing the conditional formatting (at least colour and
application order of conditions, but maybe too: adding new conditions and
editing the condition itself).
When changing a filter value delay the application of the new value on
the table for a couple of milliseconds. This makes the filter process
much smoother for fast typing users working on large tables.
See issue #415.
See issue #408.
This isn't working reliably yet on my system: If you enable the fix
restoring the previous settings when going back to a table doesn't work
and if you disable it that very way is the only way to change the
option. Don't know what's going on there :(
This is a proof-of-concept or even a basic first implementation of a new
feature I'd like to have in DB4S which at the moment I call display
formats.
The idea here is to allow the user to change the data in the Browse Data
tab on a per column basis before displaying it. This means even though
the data is stored in format X in the database it can be shown in format
Y in the browser. This should be useful in cases where the original
format X is hard to read or just not useful in a particular case.
This first implementation allows the user to right click on the header
of a column and open a new dialog for setting the display format which
offers a (limited) list of pre-defined formats. The selected format is
then integrated into the SELECT statement which is sent to SQLite.
While it works, this draft implementation lacks a number of features.
Here are the most prominent ones I'm currently aware of:
* Data not editable (or only via the Edit Dialog) because it isn't
transformed back yet.
* More display formats needed; maybe customizable ones, too.
* No indication in the UI for which columns a format has been set.
* Could _maybe_ be integrated into the import/export etc. for optional
use.
When changing the table in the Browse Data tab we used to remember the
column widths for that particular table. When changing the tab and then
coming back or when pressing the refresh button we used to save the
filters (but not for a table change). The sort order wasn't remembered
at all. I think this behaviour doesn't make any sense.
With this patch we remember column widths, sort order and filter values
for each table individually and restore it when the user switches back to
the table. All the settings are handled the same way and as much
information as possible is stored. It gets also saved in our project
file format.
Add a tooltip to the database browser when you hover a cell with a
foreign key set in order to show the referenced table and column.
When clicking on such a cell while holding the Ctrl and Shift key (only
one of them won't work because they are for multiselection and Alt
doesn't do the trick on my system because it's just for grabbing and
moving the window) try to jump to the table and row which is referenced
in the clicked cell.
See issue #192.
Move the FilterTableHeader object from the MainWindow to the
ExtendedTableWidget class because it actually is a part of the latter,
not the former.
Show sort order arrows in the table header of the Browse Data tab after
clicking it.
Add a row of line edits between the table header and the actual content
of the table in the browse tab. Show one input widget per table column
in this row.
Add a live search which hides any table rows which do not fit to the
current filter settings.
Why add this to the parital-data-fetch branch? Because this is an
attempt to get rid of the find dialog which is broken again and not even
worth fixing. Also there is not much to break in this branch at the
moment ;)