Skip to content

Commit

Permalink
Adapt Qt6 API changes (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Dec 8, 2023
1 parent d297262 commit 4cfc1dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions src/ui/loadfromfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ namespace plug
{
xml.readNextStartElement();
amp_settings amp;
while (xml.name() != "Amplifier")
while (xml.name().toString() != "Amplifier")
{
if (xml.isStartElement())
{
if (xml.name() == "Module")
if (xml.name().toString() == "Module")
{
switch (xml.attributes().value("ID").toString().toInt())
{
Expand Down Expand Up @@ -120,7 +120,7 @@ namespace plug
break;
}
}
else if (xml.name() == "Param")
else if (xml.name().toString() == "Param")
{
int i = 0;
switch (xml.attributes().value("ControlIndex").toString().toInt())
Expand Down Expand Up @@ -197,13 +197,13 @@ namespace plug
std::vector<fx_pedal_settings> settings;

xml.readNextStartElement();
while (xml.name() != "FX")
while (xml.name().toString() != "FX")
{
fx_pedal_settings effect{FxSlot{0}, effects::EMPTY, 0, 0, 0, 0, 0, 0, false};

if (xml.isStartElement())
{
if (xml.name() == "Module")
if (xml.name().toString() == "Module")
{
const int position = xml.attributes().value("POS").toString().toInt();
effect.slot = FxSlot{static_cast<std::uint8_t>(position)};
Expand Down Expand Up @@ -363,7 +363,7 @@ namespace plug
break;
}
}
else if (xml.name() == "Param")
else if (xml.name().toString() == "Param")
{
int i = 0;
switch (xml.attributes().value("ControlIndex").toString().toInt())
Expand Down Expand Up @@ -411,7 +411,7 @@ namespace plug
xml.readNextStartElement();
while (!xml.isEndElement())
{
if (xml.name() == "Info")
if (xml.name().toString() == "Info")
{
return (xml.attributes().value("name").toString());
}
Expand Down
20 changes: 10 additions & 10 deletions src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ namespace plug
connect(ui->action_Quick_presets, SIGNAL(triggered()), quickpres, SLOT(show()));

// shortcuts to activate effect windows
QShortcut* showFx1 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_1), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx2 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_2), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx3 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_3), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx4 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_4), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx5 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_5), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx6 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_6), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx7 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_7), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx8 = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_8), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx1 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_1), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx2 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_2), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx3 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_3), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx4 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_4), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx5 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_5), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx6 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_6), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx7 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_7), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showFx8 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_8), this, nullptr, nullptr, Qt::ApplicationShortcut);
connect(showFx1, &QShortcut::activated, this, [this]
{ this->showEffect(0); });
connect(showFx2, &QShortcut::activated, this, [this]
Expand All @@ -181,7 +181,7 @@ namespace plug
connect(showFx8, &QShortcut::activated, this, [this]
{ this->showEffect(7); });

QShortcut* showamp = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_A), this, nullptr, nullptr, Qt::ApplicationShortcut);
QShortcut* showamp = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_A), this, nullptr, nullptr, Qt::ApplicationShortcut);
connect(showamp, SIGNAL(activated()), this, SLOT(show_amp()));

// shortcuts for quick loading presets
Expand Down Expand Up @@ -217,7 +217,7 @@ namespace plug
{ loadPreset(9); });

// shortcut to activate buttons
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_A), this);
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_A), this);
connect(shortcut, SIGNAL(activated()), this, SLOT(enable_buttons()));

// connect the functions if needed
Expand Down

0 comments on commit 4cfc1dd

Please sign in to comment.