Commit Graph

32 Commits

Author SHA1 Message Date
Martin Kleusberg
be06bf2ac9 More consistent use of size_t for indexing table columns
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.
2019-10-04 17:58:42 +02:00
mgrojo
7541a82050 Highlight column headers to emulate spreadsheet behaviour
The column headers contained in a selection are highlighted for
consistency to the row headers and to emulated spreadsheet behaviour.
2019-09-22 23:16:04 +02:00
Martin Kleusberg
7f051f8926 Some progress towards less usage of SIGNAL and SLOT macros
This is in no way complete but since it is a routine task and I got
bored of it I am going to stop here.
2019-08-21 11:58:31 +02:00
Martin Kleusberg
b32351e7b6 Try to avoid automatic column resizing in Browse Data tab
See issue #1941.
2019-07-26 15:10:32 +02:00
Martin Kleusberg
f821fbb1a8 Silence a couple of warnings 2019-04-29 19:14:10 +02:00
Martin Kleusberg
15c23bb0d3 Use some more SQL containers instead of their Qt equivalents 2019-04-29 18:11:19 +02:00
Manuel
ea2aa495b3 Visual sort indicators for multi-column sorting (#1810)
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
2019-03-28 15:05:27 +11:00
mgrojo
217563fd47 Dialog and foreground configuration for conditional formats
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.
2019-03-23 22:14:18 +01:00
mgrojo
baaeea8844 Fix table header issues in a more portable way
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
2019-03-03 20:29:59 +01:00
mgrojo
9e2f8e5ede Fix for table header filters under Ubuntu Linux 18.04 and Qt 5.9.5
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.
2019-03-02 19:05:24 +01:00
Manuel
abb6f686a3 Initial implementation of "conditional formatting" (#1503)
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).
2018-10-30 21:22:14 +01:00
Martin Kleusberg
3bd2dc3bc1 Replace 'foreach' by range-based for loop from C++11 2017-10-30 13:10:08 +01:00
Martin Kleusberg
b9e4433318 Drop Qt4 support
This commit removes all code and configuration that was required for
building with Qt4. Hopefully noone really needs it anymore.

See issue #603.
2016-10-18 18:07:38 +02:00
safaalfulaij
6bb7036fa4 Tweak the filter header RTL code 2016-08-02 17:49:51 +01:00
safaalfulaij
94e2caea73 Fix Filter Input in RTL Locales 2016-07-29 17:48:32 +03:00
Vladislav Tronko
d23e6cf1b8 Optimize code for removing filters 2016-07-15 02:48:25 +03:00
Vladislav Tronko
8d0d6ba445 Remove redundant indexing operator 2016-07-01 13:29:17 +03:00
Martin Kleusberg
71b7806f03 Delay applying a changed filter value
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.
2015-10-15 11:42:59 +02:00
Martin Kleusberg
1ebecbbc9d Add option for showing the rowid column
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 :(
2015-09-11 13:30:24 +02:00
Martin Kleusberg
7c1d237d9b Support alternative display formats in the Browse Data tab
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.
2015-07-06 18:28:30 +02:00
Martin Kleusberg
944e22a80d Add clear button to filter line edit widgets
When entering some filter value show a clear button in that line edit
widget which when clicked clears the filter value.
2015-07-06 13:52:35 +02:00
Martin Kleusberg
748f06df93 Save filter settings and sort order for each table
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.
2015-07-04 23:12:30 +02:00
Martin Kleusberg
39a49e33c2 Allow clicking cells with foreign key in order to jump to referenced cell
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.
2015-06-21 23:59:45 +02:00
Bernardo Sulzbach
abc432fcd6 Fixed a few typos. 2015-05-20 10:17:52 -03:00
schdub
b5c1c7b0ab enhancement: preserve field filters when switching tab 2015-05-11 23:35:59 +03:00
Martin Kleusberg
eb8e801b57 Make it possible to jump between filters by pressing the tab key
Allow jumping between the filter input fields by pressing Tab and
Shift+Tab.

See issue #106.
2014-10-11 15:45:30 +02:00
Peinthor Rene
c615e9ac46 filters: add missing file commit for 57d086fbf2 2014-09-19 20:54:12 +02:00
Martin Kleusberg
297bfbce0a Move filter header from window to table widget and show sort indicators
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.
2014-05-25 14:35:56 +02:00
Peinthor Rene
de1fb9ff2f qt5: full qt5 compability
ifdef rest of the code which can't be ported 100%
add CMake option USE_QT5 to use qt5 ;)
Thanks to stretchtiberius for initial patch
2014-02-14 00:28:42 +01:00
Peinthor Rene
94819f22e2 for loop pre-increment optimization's and a slight syntax style change 2013-09-20 14:49:07 +02:00
Peinthor Rene
1bac11348f include cleanup 2013-09-19 22:55:35 +02:00
Martin Kleusberg
6742f5632d Add a filter row to the table view in the browse tab
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 ;)
2013-04-09 18:52:37 +02:00