Skip to content

Commit

Permalink
Merge branch '279-qt6'
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Dec 8, 2023
2 parents 175d114 + 716b4ed commit f7bfe7b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(Qt5 COMPONENTS Core Widgets Gui REQUIRED)
find_package(Qt6 COMPONENTS Core Widgets Gui REQUIRED)
find_package(libusb-1.0 REQUIRED)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please see [Contributing](CONTRIBUTING.md) for how to contribute to this project

## Requirements

- [**Qt5**](https://www.qt.io/)
- [**Qt6**](https://www.qt.io/)
- [**libusb-1.0**](http://libusb.info/)


Expand Down
5 changes: 3 additions & 2 deletions script/ci_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ then
export CXXFLAGS="-stdlib=libc++"
fi


# Install dependencies
apt-get update
apt-get install -y --no-install-recommends \
pkg-config \
qtbase5-dev \
qt6-base-dev \
libglx-dev \
libgl1-mesa-dev \
libusb-1.0-0-dev

git clone --depth=1 --branch=v1.14.0 https://github.com/google/googletest.git
Expand Down
6 changes: 3 additions & 3 deletions src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_library(plug-ui amp_advanced.cpp

target_link_libraries(plug-ui
PUBLIC
Qt5::Widgets
Qt5::Gui
Qt5::Core
Qt6::Widgets
Qt6::Gui
Qt6::Core
)
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 f7bfe7b

Please sign in to comment.