WSJT-X/HintedSpinBox.hpp
Bill Somerville 873b1d1c43 Updated decode highlighting and LotW user's data file management
Includes a new settings facility  with the highlighting being contrled
by a new model class and a  modified QListView to display the data for
editing. Edits  include enable and  disable check boxes,  a contextual
pop-up menu to adjust backkground and foreground colours.

Still   to   be   implemented    are   priorities   for   highlighting
categories. This  will be adjustable  by drag  and drop in  the Colors
settings panel, it is already implemented by the priority order has no
effect on highlighting of decodes yet.

The LotW  users data file fetch  and time since user's  last upload is
now controled from the settings dialog.

This change also drops support for Qt versions before 5.5 so that many
workarounds for earlier versions can be removed.

Debug trace is slightly modified to make better use of the Qt built in
facilities to format and synchronize cross thread messaging.
2018-10-17 00:26:04 +01:00

54 lines
1.3 KiB
C++

#ifndef HINTED_SPIN_BOX_HPP_
#define HINTED_SPIN_BOX_HPP_
#include <vector>
#include <QSpinBox>
//
// HintedSpinBox - QSpinBox refinement with an optional sequence of
// discrete hints
//
// The hint sequence values are used as step values and can
// optionally define the minimum and maximum value. Intermediate
// values are allowed but the step up/down arrows and accelerator
// keys will only use the hints.
//
// Ensure that the default minimum and maximum values are sufficient
// to allow initial initialization if done before the hints are set.
//
class HintedSpinBox
: public QSpinBox
{
public:
typedef std::vector<int> values_type;
HintedSpinBox (QWidget * parent = nullptr)
: QSpinBox {parent}
{
}
// Initialize sequence of values allowed.
//
// This spin box behaves exactly as a standard QSpinBox if the
// sequence of values is empty.
//
// The minimum and maximum are automatically set to the lowest and
// highest value provided if required.
//
// Returns the previous sequence.
values_type values (values_type values, bool set_min_max = true);
// Read access to the values.
values_type const& values () const {return values_;}
protected:
// override the QSpinBox stepping
void stepBy (int steps) override;
private:
values_type values_;
};
#endif