Skip to content

Commit

Permalink
Remove Qt Depreciated Warnings Part 1 (#5448)
Browse files Browse the repository at this point in the history
* Qt::SkipEmptyParts and Qt::endl

* qSort -> std:sort

* remove default.profraw

* more qDebug endl -> Qt::endl

* more endl -> Qt::endl
  • Loading branch information
amystamile-usgs authored Apr 1, 2024
1 parent fde64d8 commit 95bc410
Show file tree
Hide file tree
Showing 61 changed files with 347 additions and 346 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ object_script.*.Debug
*.moc
ui_*.h
*html
*.profraw

# ignore all files created by squish coco
*csmes
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/appjit/PixelOffset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace Isis {


for(size_t iline = 0; iline < lines.size(); iline++) {
fields = lines[iline].simplified().split(" ", QString::SkipEmptyParts);
fields = lines[iline].simplified().split(" ", Qt::SkipEmptyParts);
if(fields.count() != 3) {
QString msg = "Three fields are required: sample, line, and ephemeris time.";
throw IException(IException::Io, msg, _FILEINFO_);
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/isisimport/isisimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ namespace Isis {
stretchPairs->GetLine(line); //assigns value to line
line = line.simplified();

for (QString value: line.split(QRegExp("[\\s,]"), QString::SkipEmptyParts)) {
for (QString value: line.split(QRegExp("[\\s,]"), Qt::SkipEmptyParts)) {
vectorStretchPairs.push_back(temp1);
vectorStretchPairs.push_back(toDouble(value));
temp1++;
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/apps/isisminer/NumericalSortStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ namespace Isis {
int NumericalSortStrategy::apply(ResourceList &resources,
const ResourceList &globals) {
if ( "ascending" == m_order) {
qSort(resources.begin(), resources.end(), SortAscending(m_sortKey));
std::sort(resources.begin(), resources.end(), SortAscending(m_sortKey));
}
else { // ("descending" == m_order)
qSort(resources.begin(), resources.end(), SortDescending(m_sortKey));
std::sort(resources.begin(), resources.end(), SortDescending(m_sortKey));
}

// Keeps the Resource by just running the counter
Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/apps/isisminer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ void IsisMain() {
globals->add("PARAMETERS", parameters);

// Split by separate parameters
QStringList parmlist = parameters.split("@", QString::SkipEmptyParts);
QStringList parmlist = parameters.split("@", Qt::SkipEmptyParts);
BOOST_FOREACH (QString parm, parmlist) {
// Split values from keyword name
QStringList keyval = parm.split(":", QString::SkipEmptyParts);
QStringList keyval = parm.split(":", Qt::SkipEmptyParts);
if ( keyval.size() != 2 ) {
QString mess = "Ill-formed PARAMETERS (" + parm + ") - use form @key:val";
throw IException(IException::User, mess, _FILEINFO_);
}

// Now split multi string values and construct the Pvl keyword
QString keyname = keyval[0];
QStringList values = keyval[1].split(",", QString::SkipEmptyParts);
QStringList values = keyval[1].split(",", Qt::SkipEmptyParts);
PvlKeyword keyword(keyname);
BOOST_FOREACH ( QString val, values) {
keyword.addValue(val);
Expand Down
12 changes: 6 additions & 6 deletions isis/src/base/objs/BulletTargetShape/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ using namespace Isis;
int main(int argc, char *argv[]) {
try {
qDebug() << "Testing BulletTargetShape";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing default constructor";
qDebug() << "";
BulletTargetShape defaultTargetShape;
qDebug() << "Target name: " << defaultTargetShape.name();
qDebug() << "Maximum distance in kilometers: " << defaultTargetShape.maximumDistance();
qDebug() << "btCollisionBody pointer is valid? " << (bool) defaultTargetShape.body();
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing load constructor";
QString dskfile("$ISISTESTDATA/isis/src/base/unitTestData/hay_a_amica_5_itokawashape_v1_0_64q.bds");
Expand All @@ -37,30 +37,30 @@ int main(int argc, char *argv[]) {
qDebug() << "Target name: " << itokawaTargetShape->name();
qDebug() << "Maximum distance in kilometers: " << itokawaTargetShape->maximumDistance();
qDebug() << "btCollisionBody pointer is valid? " << (bool) itokawaTargetShape->body();
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing load constructor with cube";
QString itokawaCube = "$ISISTESTDATA/isis/src/hayabusa/unitTestData/st_2391934788_v.cub";
qDebug() << "Testing with " << itokawaCube << "...";
qDebug() << "";
BulletTargetShape *cubeTargetShape = BulletTargetShape::load(itokawaCube);
qDebug() << "Target shape pointer is valid?" << (bool) cubeTargetShape;
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing load constructor with other extension";
QString otherFile = "$ISISTESTDATA/isis/src/base/unitTestData/xmlTestLabel.xml";
qDebug() << "Testing with " << otherFile << "...";
qDebug() << "";
BulletTargetShape *otherTargetShape = BulletTargetShape::load(otherFile);
qDebug() << "Target shape pointer is valid?" << (bool) otherTargetShape;
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing collision body constructor";
BulletTargetShape collisionTargetShape(itokawaTargetShape->body(), "Itokawa");
qDebug() << "Target name: " << collisionTargetShape.name();
qDebug() << "Maximum distance in kilometers: " << collisionTargetShape.maximumDistance();
qDebug() << "btCollisionBody pointer is valid? " << (bool) collisionTargetShape.body();
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing null collision body constructor";
BulletTargetShape nullTargetShape(0, "Null");
Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/objs/BulletWorldManager/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ using namespace Isis;
int main(int argc, char *argv[]) {
try {
qDebug() << "Testing BulletWorldManager";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing default constructor";
qDebug() << "";
BulletWorldManager defaultWorld;
qDebug() << "World name: " << defaultWorld.name();
qDebug() << "World size: " << defaultWorld.size();
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing with a name";
BulletWorldManager namedWorld("TestWorld");
qDebug() << "World name: " << namedWorld.name();
qDebug() << "World size: " << namedWorld.size();
qDebug() << endl;
qDebug() << Qt::endl;


QString dskfile("$ISISTESTDATA/isis/src/base/unitTestData/hay_a_amica_5_itokawashape_v1_0_64q.bds");
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/CSVReader/CSVReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace Isis {
int parse(const QString &str, const char &delimiter = ',',
bool keepEmptyParts = true) {
QStringList tokens =
str.split(delimiter, keepEmptyParts? QString::KeepEmptyParts : QString::SkipEmptyParts);
str.split(delimiter, keepEmptyParts? Qt::KeepEmptyParts : Qt::SkipEmptyParts);
TokenList slist(tokens.size());
for(int i = 0 ; i < tokens.size() ; i++) {
slist[i] = TokenType(tokens[i]);
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/Cube/CubeIoHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ namespace Isis {
// Sorting the buffers didn't seem to have a large positive impact on speed,
// but does increase complexity so it's disabled.
// QList<Buffer * > buffersToWrite(*m_buffersToWrite);
// qSort(buffersToWrite.begin(), buffersToWrite.end(), bufferLessThan);
// std::sort(buffersToWrite.begin(), buffersToWrite.end(), bufferLessThan);

// If the buffers have any overlap at all then we can't sort them and still
// guarantee the last write() call makes it into the correct place. The
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/CubeAttribute/CubeAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace Isis {

QString str = toString().remove(QRegExp("^\\+"));

QStringList strSplit = str.split(",", QString::SkipEmptyParts);
QStringList strSplit = str.split(",", Qt::SkipEmptyParts);
foreach (QString commaTok, strSplit) {
// Is this token a range of bands
if (commaTok.contains('-')) {
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/CubeAttribute/CubeAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ namespace Isis {
* FileName("out.cub+Bsq")
*/
void setAttributes(const FileName &fileName) {
QStringList attributes = fileName.attributes().split("+", QString::SkipEmptyParts);
QStringList attributes = fileName.attributes().split("+", Qt::SkipEmptyParts);

m_attributes.clear();
foreach (QString attribute, attributes)
Expand Down
24 changes: 12 additions & 12 deletions isis/src/base/objs/EmbreeShapeModel/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) {

QString dskfile("$ISISTESTDATA/isis/src/base/unitTestData/hay_a_amica_5_itokawashape_v1_0_64q.bds");
qDebug() << "Testing with " << dskfile << "...";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Get an instance of the target manager";
qDebug() << "";
Expand Down Expand Up @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing observer look direction intersection";
qDebug() << endl;
qDebug() << Qt::endl;
std::vector<double> observerVec(3, 0.0);
std::vector<double> lookVec(3, 0.0);
observerVec[0] = 1000.0;
Expand All @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing observer look direction non-intersection";
qDebug() << endl;
qDebug() << Qt::endl;
observerVec[0] = 1000.0;
observerVec[1] = 1000.0;
observerVec[2] = 1000.0;
Expand All @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing latitude, longitude intersection";
qDebug() << endl;
qDebug() << Qt::endl;

Latitude testLat(45, Angle::Degrees);
Longitude testLon(85, Angle::Degrees);
Expand All @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing latitude, longitude occlusion";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Using " << itokawaCubeFile;
Latitude occLat(0, Angle::Degrees);
Expand All @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing surface point intersection";
qDebug() << endl;
qDebug() << Qt::endl;

testLat.setDegrees(0.0);
testLon.setDegrees(200.0);
Expand All @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing surface point occlusion";
qDebug() << endl;
qDebug() << Qt::endl;

testLat.setDegrees(-45.0);
testLon.setDegrees(80.0);
Expand All @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing local radius";
qDebug() << endl;
qDebug() << Qt::endl;

testLat.setDegrees(35.0);
testLon.setDegrees(270.0);
Expand All @@ -232,7 +232,7 @@ int main(int argc, char *argv[]) {
outputModelStatus(itokawaModel);

qDebug() << "Testing visibility check";
qDebug() << endl;
qDebug() << Qt::endl;

observerVec[0] = 1000.0;
observerVec[1] = 0.0;
Expand Down Expand Up @@ -267,7 +267,7 @@ int main(int argc, char *argv[]) {
<< itokawaModel.isVisibleFrom(observerVec, lookVec);

qDebug() << "Testing default ellipsoid normal";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Starting model status";
outputModelStatus(itokawaModel);
Expand All @@ -276,7 +276,7 @@ int main(int argc, char *argv[]) {
outputModelStatus(itokawaModel);

qDebug() << "Testing photometric angles";
qDebug() << endl;
qDebug() << Qt::endl;

outputModelStatus(itokawaModel);
observerVec[0] = 1000.0;
Expand All @@ -289,7 +289,7 @@ int main(int argc, char *argv[]) {
qDebug() << "Incidence angle: " << itokawaModel.incidenceAngle(observerVec);

qDebug() << "Testing errors";
qDebug() << endl;
qDebug() << Qt::endl;

}
catch (IException &e) {
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/EmbreeTargetManager/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
try {
Preference::Preferences(true);
qDebug() << "Testing EmbreeTargetManager";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Get an instance of the target manager";
EmbreeTargetManager *manager = EmbreeTargetManager::getInstance();
Expand Down
Loading

0 comments on commit 95bc410

Please sign in to comment.