Updates to support Qt v5.13

Replacement of deprecated Qt functions and member functions.
This commit is contained in:
Bill Somerville 2019-07-08 01:37:04 +01:00
parent 0c49f6f872
commit 01aaa852e3
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
7 changed files with 13 additions and 13 deletions

View File

@ -1379,8 +1379,8 @@ void Configuration::impl::read_settings ()
txDelay_ = settings_->value ("TxDelay",0.2).toDouble();
aggressive_ = settings_->value ("Aggressive", 0).toInt ();
RxBandwidth_ = settings_->value ("RxBandwidth", 2500).toInt ();
save_directory_ = settings_->value ("SaveDir", default_save_directory_.absolutePath ()).toString ();
azel_directory_ = settings_->value ("AzElDir", default_azel_directory_.absolutePath ()).toString ();
save_directory_.setPath (settings_->value ("SaveDir", default_save_directory_.absolutePath ()).toString ());
azel_directory_.setPath (settings_->value ("AzElDir", default_azel_directory_.absolutePath ()).toString ());
{
//
@ -2063,8 +2063,8 @@ void Configuration::impl::accept ()
TX_messages_ = ui_->TX_messages_check_box->isChecked ();
data_mode_ = static_cast<DataMode> (ui_->TX_mode_button_group->checkedId ());
bLowSidelobes_ = ui_->rbLowSidelobes->isChecked();
save_directory_ = ui_->save_path_display_label->text ();
azel_directory_ = ui_->azel_path_display_label->text ();
save_directory_.setPath (ui_->save_path_display_label->text ());
azel_directory_.setPath (ui_->azel_path_display_label->text ());
enable_VHF_features_ = ui_->enable_VHF_features_check_box->isChecked ();
decode_at_52s_ = ui_->decode_at_52s_check_box->isChecked ();
single_decode_ = ui_->single_decode_check_box->isChecked ();

View File

@ -1,5 +1,6 @@
#include "HRDTransceiver.hpp"
#include <algorithm>
#include <QHostAddress>
#include <QByteArray>
#include <QRegExp>
@ -36,7 +37,7 @@ struct HRDMessage
HRDMessage * storage (reinterpret_cast<HRDMessage *> (new char[size]));
storage->size_ = size ;
ushort const * pl (payload.utf16 ());
qCopy (pl, pl + payload.size () + 1, storage->payload_); // copy terminator too
std::copy (pl, pl + payload.size () + 1, storage->payload_); // copy terminator too
storage->magic_1_ = magic_1_value_;
storage->magic_2_ = magic_2_value_;
storage->checksum_ = 0;

View File

@ -55,8 +55,7 @@ QSize ForeignKeyDelegate::sizeHint (QStyleOptionViewItem const& option, QModelIn
{
size_hint = size_hint.expandedTo (qApp->style ()->sizeFromContents (QStyle::CT_ComboBox
, &combo_box_option
, {metrics.width (candidate_key_filter_->data (candidate_key_filter_->index (row, 0)).toString ())
, metrics.height ()}));
, metrics.boundingRect (candidate_key_filter_->data (candidate_key_filter_->index (row, 0)).toString ()).size ()));
}
return size_hint;
}

View File

@ -161,7 +161,7 @@ void EPlotter::DrawOverlay() //DrawOverlay()
int x,y;
QPainter painter(&m_OverlayPixmap);
painter.initFrom(this);
painter.setBackground (palette ().brush (backgroundRole ()));
QLinearGradient gradient(0, 0, 0 ,m_h2); //fill background with gradient
gradient.setColorAt(1, Qt::black);
gradient.setColorAt(0, Qt::darkBlue);
@ -199,7 +199,7 @@ void EPlotter::DrawOverlay() //DrawOverlay()
QRect rect0;
QPainter painter0(&m_ScalePixmap);
painter0.initFrom(this);
painter0.setBackground (palette ().brush (backgroundRole ()));
//create Font to use for scales
QFont Font("Arial");

View File

@ -58,7 +58,7 @@ void FPlotter::drawScale() //drawScale()
QRect rect0;
QPainter painter0(&m_ScalePixmap);
painter0.initFrom(this);
painter0.setBackground (palette ().brush (backgroundRole ()));
//create Font to use for scales
QFont Font("Arial");

View File

@ -331,7 +331,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
QPen penGreen(Qt::green, 3); //Mark Tol range with green line
QPen penRed(Qt::red, 3); //Mark Tx freq with red
QPainter painter(&m_OverlayPixmap);
painter.initFrom(this);
painter.setBackground (palette ().brush (backgroundRole ()));
QLinearGradient gradient(0, 0, 0 ,m_h2); //fill background with gradient
gradient.setColorAt(1, Qt::black);
gradient.setColorAt(0, Qt::darkBlue);
@ -371,7 +371,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
QRect rect0;
QPainter painter0(&m_ScalePixmap);
painter0.initFrom(this);
painter0.setBackground (palette ().brush (backgroundRole ()));
//create Font to use for scales
QFont Font("Arial");

View File

@ -35,7 +35,7 @@ public:
QSize minimumSizeHint () const override
{
QFontMetrics font_metrics {font (), nullptr};
return {tick_length + text_indent + font_metrics.width ("00+"), (font_metrics.height () + line_spacing) * range};
return {tick_length + text_indent + font_metrics.boundingRect ("00+").width (), (font_metrics.height () + line_spacing) * range};
}
protected: