WSL/SLF GitLab Repository

Commit 8db3655b authored by Mathias Bavay's avatar Mathias Bavay
Browse files

More fixes for Qt6 compatibility

parent eab72a11
......@@ -211,7 +211,7 @@ void SectionTab::setSectionDynamic(const QString &section, const QDomNode &node)
*/
bool SectionTab::isDynamicParent(const QString &section) const
{
const int dyn_idx = dynamic_sections_.indexOf(QRegExp(section, Qt::CaseInsensitive));
const int dyn_idx = dynamic_sections_.indexOf(QRegularExpression(section, QRegularExpression::CaseInsensitiveOption));
return (dyn_idx != -1);
}
......@@ -288,7 +288,7 @@ QString SectionTab::getParentOf(const QString &section)
void SectionTab::spawnDynamicSection(const QString &section, const QString &new_tab_name)
{
int index = getIndex(section, Qt::CaseInsensitive);
const int dyn_idx = dynamic_sections_.indexOf(QRegExp(section, Qt::CaseInsensitive));
const int dyn_idx = dynamic_sections_.indexOf(QRegularExpression(section, QRegularExpression::CaseInsensitiveOption));
bool found = false;
for (int ii = index + 1; ii < this->count(); ++ii) {
......
......@@ -80,7 +80,7 @@ INISyntaxHighlighter::INISyntaxHighlighter(QTextDocument *textdoc) : QSyntaxHigh
rule.pattern = QRegularExpression("\\" + Cst::section_open + section + "\\" +
Cst::section_close, QRegularExpression::CaseInsensitiveOption); //TODO: escape only if needed for the set char
rule.format = format_known_section;
if (added_sections_.indexOf(QRegExp(section, Qt::CaseInsensitive)) == -1) {
if (added_sections_.indexOf(QRegularExpression(section, QRegularExpression::CaseInsensitiveOption)) == -1) {
rules_.append(rule);
added_sections_.append(section);
}
......
......@@ -231,7 +231,7 @@ bool parseAvailableSections(const QDomElement &current_element, const QString &p
}
}
if (!parent_section.isNull()) { //not at top level - the parent is fixed
if (!section_list.isEmpty() && (section_list.indexOf(QRegExp(parent_section, Qt::CaseInsensitive)) == -1))
if (!section_list.isEmpty() && (section_list.indexOf(QRegularExpression(parent_section, QRegularExpression::CaseInsensitiveOption)) == -1))
return false; //sections are given, but they don't match the parent
section_list.clear(); //don't build multiple times
section_list.push_back(parent_section);
......
......@@ -220,7 +220,7 @@ void Checklist::onPropertySet()
const QString values( this->property("ini_value").toString() );
if (ini_value_ == values)
return;
const QStringList value_list( values.split(QRegExp("\\s+"), Qt::SkipEmptyParts) );
const QStringList value_list( values.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts) );
/* clear the list, overwriting current settings */
for (int ii = 0; ii < list_->count(); ++ii) {
......
......@@ -212,7 +212,7 @@ void Choice::onPropertySet()
const QString values( this->property("ini_value").toString() );
if (ini_value_ == values)
return;
const QStringList value_list( values.split(QRegExp("\\s+"), Qt::SkipEmptyParts) );
const QStringList value_list( values.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts) );
if (checkbox_container_->count() == 1) {
topLog(QString(tr(R"(XML error: No checkable options set for Choice panel "%1::%2".)").arg(
......
......@@ -342,7 +342,7 @@ void Number::setOptions(const QDomNode &options)
*/
int Number::getPrecisionOfNumber(const QString &str_number) const
{
const QStringList dec( str_number.split(QRegExp("[,.]")) );
const QStringList dec( str_number.split(QRegularExpression("[,.]")) );
if (dec.size() > 1) //there's a decimal sign
return dec.at(1).length();
return 0; //integer
......
......@@ -104,10 +104,10 @@ bool Replicator::canSpawnPanel(const QString &key)
//freely replicate child items (which do not have to be tied to a Replicator's key).
//In this case of a Replicator that is not tied to any INI structure (like a frame),
//we check the list of potential child panels for a matching entry:
ok = child_panel_keys_.indexOf(QRegExp(key_sub, Qt::CaseInsensitive)) != -1;
ok = child_panel_keys_.indexOf(QRegularExpression(key_sub, QRegularExpression::CaseInsensitiveOption)) != -1;
if (!ok) {
const QString key_sub_multi = getRepName(key, false); //TA::FILTER1::ARG1 --> TA::FILTER1::ARG#
ok = child_panel_keys_.indexOf(QRegExp(key_sub_multi, Qt::CaseInsensitive)) != -1;
ok = child_panel_keys_.indexOf(QRegularExpression(key_sub_multi, QRegularExpression::CaseInsensitiveOption)) != -1;
}
}
return ok; //otherwise, the Replicator for sure can not create this panel
......
......@@ -219,8 +219,8 @@ void Textfield::onValidButtonClicked() //for now this button only pops up for co
QString lon( coord_match.captured(idx_lon_dms) );
const QChar latchar = lat.section('d',1,1).toDouble() < 0? 'S' : 'N';
const QChar lonchar = lon.section('d',1,1).toDouble() < 0? 'W' : 'E';
lat.remove(QRegExp(" |\"")); lat.replace(QRegExp("d|'"), "_");
lon.remove(QRegExp(" |\"")); lon.replace(QRegExp("d|'"), "_");
lat.remove(QRegularExpression(" |\"")); lat.replace(QRegularExpression("d|'"), "_");
lon.remove(QRegularExpression(" |\"")); lon.replace(QRegularExpression("d|'"), "_");
url += lat + "_" + latchar + "_";
url += lon + "_" + lonchar;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment