summaryrefslogtreecommitdiff
path: root/quackleio
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2019-07-19 12:05:36 -0500
committerJohn Fultz <jfultz@wolfram.com>2019-07-19 12:05:36 -0500
commitb6654916b426574a4f576d3511f21a85377746f9 (patch)
treea29c5d92541f1e0c6b418445a18d2f917d760ce8 /quackleio
parent595735c6fa5c9ed837151947e6ba1fbfdcd3190c (diff)
Fix deprecation errors for Qt 5.13.
Most are Qt4-isms, except where noted. * Replaced QFontMetrics::width with QFontMetrics::horizontalAdvance, conditionally as the latter wasn't even introduced until Qt 5.11. * QColor::light and dark instead of QColor::light and dark. * QString() instead of QString::null. * std::sort instead of qSort * QTreeWidgetItem::setSelected instead of QTreeWidget::setItemSelected. * QFileDialog::setOption(QFileDialog::DontConfirmOverwrite) instead of QFileDialog::setConfirmOverwrite(false). * QDrag::exec instead of QDrag::start.
Diffstat (limited to 'quackleio')
-rw-r--r--quackleio/dictimplementation.cpp2
-rw-r--r--quackleio/froggetopt.cpp14
-rw-r--r--quackleio/froggetopt.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/quackleio/dictimplementation.cpp b/quackleio/dictimplementation.cpp
index 2107440..43c1005 100644
--- a/quackleio/dictimplementation.cpp
+++ b/quackleio/dictimplementation.cpp
@@ -77,7 +77,7 @@ Dict::WordList QuackleIO::DictImplementation::query(const QString &query, int fl
ret.setSortBy(Dict::WordList::Alphabetical);
}
- qSort(ret);
+ std::sort(ret.begin(), ret.end());
return ret;
}
diff --git a/quackleio/froggetopt.cpp b/quackleio/froggetopt.cpp
index 9131ecc..43f1d6b 100644
--- a/quackleio/froggetopt.cpp
+++ b/quackleio/froggetopt.cpp
@@ -486,14 +486,14 @@ void GetOpt::setSwitch( const Option &o )
Registers an option with the short name \a s and long name \a l to
the parser. If this option is found during parsing the value will
be stored in the string pointed to by \a v. By default \a *v will
- be initialized to \c QString::null.
+ be initialized to \c QString().
*/
void GetOpt::addOption( char s, const QString &l, QString *v )
{
Option opt( OArg1, s, l );
opt.stringValue = v;
addOption( opt );
- *v = QString::null;
+ *v = QString();
}
/**
@@ -548,7 +548,7 @@ opt.parse();
*/
void GetOpt::addRepeatableOption( char s, QStringList *v )
{
- Option opt( ORepeat, s, QString::null );
+ Option opt( ORepeat, s, QString() );
opt.listValue = v;
addOption( opt );
*v = QStringList();
@@ -599,13 +599,13 @@ void GetOpt::addOptionalOption( char s, const QString &l,
opt.stringValue = v;
opt.def = def;
addOption( opt );
- *v = QString::null;
+ *v = QString();
}
/**
Registers a required command line argument \a name. If the argument
is missing parse() will return false to indicate an error and \a *v
- will remain with its default QString::null value. Otherwise \a *v
+ will remain with its default QString() value. Otherwise \a *v
will be set to the value of the argument.
Example:
@@ -634,7 +634,7 @@ void GetOpt::addArgument( const QString &name, QString *v )
opt.stringValue = v;
reqArg = opt;
++numReqArgs;
- *v = QString::null;
+ *v = QString();
}
/**
@@ -648,7 +648,7 @@ void GetOpt::addOptionalArgument( const QString &name, QString *v )
opt.stringValue = v;
optArg = opt;
++numOptArgs;
- *v = QString::null;
+ *v = QString();
}
/**
diff --git a/quackleio/froggetopt.h b/quackleio/froggetopt.h
index 895dd9e..84abf06 100644
--- a/quackleio/froggetopt.h
+++ b/quackleio/froggetopt.h
@@ -81,7 +81,7 @@ private:
struct Option {
Option( OptionType t = OUnknown,
- char s = 0, const QString &l = QString::null )
+ char s = 0, const QString &l = QString() )
: type( t ),
sname( s ),
lname( l ),