Skip to content
Closed

Qt6 #1999

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
78dcc3d
Compiles under Qt6
dcorson-ticino-com Jun 3, 2021
4355d70
Compiles on both Qt5 and Qt6
dcorson-ticino-com Jun 3, 2021
035d39f
Modified to compile under Qt5 and Qt6.1
dcorson-ticino-com Jun 6, 2021
6810c02
clang-format
dcorson-ticino-com Jun 6, 2021
79e4c91
Update autobuild.yml
dcorson-ticino-com Jun 6, 2021
c8324d9
Update autobuild.yml
dcorson-ticino-com Jun 6, 2021
67f9b87
Update autobuild.yml
dcorson-ticino-com Jun 6, 2021
3c641ab
Update autobuild.yml
dcorson-ticino-com Jun 6, 2021
9dc90ef
Update autobuild.yml
dcorson-ticino-com Jun 6, 2021
7f40736
Update autobuild_windowsinstaller_1_prepare.ps1
dcorson-ticino-com Jun 6, 2021
920568b
Update autobuild_windowsinstaller_2_build.ps1
dcorson-ticino-com Jun 6, 2021
6475c1a
Update autobuild_deb_1_prepare.sh
dcorson-ticino-com Jun 6, 2021
10a231a
pragma for MS compiler
dcorson-ticino-com Jun 6, 2021
40c5682
Merge branch 'Qt6' of github.com:dcorson-ticino-com/jamulus into Qt6
dcorson-ticino-com Jun 6, 2021
6de4a86
Update autobuild_deb_1_prepare.sh
dcorson-ticino-com Jun 6, 2021
186a576
Removed macextras from Jamulus.pro
dcorson-ticino-com Jun 7, 2021
5790b93
Update autobuild.yml
dcorson-ticino-com Jun 7, 2021
28d9cb6
Removed include <QtMac>
dcorson-ticino-com Jun 7, 2021
f993363
Replaced QtMac::setBadgeLabelText
dcorson-ticino-com Jun 7, 2021
3bb96e4
Commented out Mac BadgeLabel
dcorson-ticino-com Jun 7, 2021
5e654cb
Added win64
dcorson-ticino-com Jun 7, 2021
8e6389b
Changes that clang-format required
dcorson-ticino-com Sep 7, 2021
d300289
Merge branch 'master' into Qt6
dcorson-ticino-com Sep 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,45 +92,47 @@ jobs:
fail-fast: false
matrix: # Think of this like a foreach loop. Basically runs the steps with every combination of the contents of this. More info: https://docs.github.com/en/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
config:
- config_name: AndroidAPK (artifact+codeQL)
target_os: android
building_on_os: ubuntu-20.04
cmd1_prebuild: "sh ./autobuild/android/autobuild_apk_1_prepare.sh" # this step needs sh instead of bash for permissions
cmd2_build: "./autobuild/android/autobuild_apk_2_build.sh"
cmd3_postbuild: "./autobuild/android/autobuild_apk_3_copy_files.sh"
uses_codeql: true

- config_name: Linux (artifacts+codeQL)
target_os: linux
building_on_os: ubuntu-18.04
cmd1_prebuild: "sh ./autobuild/linux/autobuild_deb_1_prepare.sh" # this step needs sh instead of bash for permissions
cmd2_build: "./autobuild/linux/autobuild_deb_2_build.sh"
cmd3_postbuild: "./autobuild/linux/autobuild_deb_3_copy_files.sh"
uses_codeql: true
# - config_name: AndroidAPK (artifact+codeQL)
# target_os: android
# building_on_os: ubuntu-20.04
# cmd1_prebuild: "sh ./autobuild/android/autobuild_apk_1_prepare.sh" # this step needs sh instead of bash for permissions
# cmd2_build: "./autobuild/android/autobuild_apk_2_build.sh"
# cmd3_postbuild: "./autobuild/android/autobuild_apk_3_copy_files.sh"
# uses_codeql: true
#
# - config_name: Linux (artifacts+codeQL)
# target_os: linux
# building_on_os: ubuntu-20.04
# cmd1_prebuild: "sh ./autobuild/linux/autobuild_deb_1_prepare.sh" # this step needs sh instead of bash for permissions
# cmd2_build: "./autobuild/linux/autobuild_deb_2_build.sh"
# cmd3_postbuild: "./autobuild/linux/autobuild_deb_3_copy_files.sh"
# uses_codeql: true

- config_name: MacOS (codeQL)
target_os: macos
building_on_os: macos-10.15
cmd1_prebuild: "./autobuild/mac/codeQL/autobuild_mac_1_prepare.sh 5.15.2"
cmd1_prebuild: "./autobuild/mac/codeQL/autobuild_mac_1_prepare.sh 6.1.0"
cmd2_build: "./autobuild/mac/codeQL/autobuild_mac_2_build.sh"
cmd3_postbuild: false
uses_codeql: true

- config_name: MacOS (artifacts)
target_os: macos
building_on_os: macos-10.15
cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.15.2"
cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh sign_if_possible"

cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 6.1.0"
cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh"
cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh"
uses_codeql: false

- config_name: MacOS Legacy (artifacts)
target_os: macos
building_on_os: macos-10.15
cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.9.9"
cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh do_not_sign"
cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh legacy"
uses_codeql: false
# - config_name: MacOS Legacy (artifacts)
# target_os: macos
# building_on_os: macos-10.15
# cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.9.9"
# cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh"
# cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh legacy"
# uses_codeql: false


- config_name: Windows (artifact+codeQL)
target_os: windows
Expand All @@ -153,11 +155,11 @@ jobs:

# For Qt5 on Mac, we need to ensure SDK 10.15 is used, and not SDK 11.x
# This is done by selecting Xcode 11.7 instead of the latest default of 12.x
- name: Select Xcode version for Mac
if: ${{ matrix.config.target_os == 'macos' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '11.7'
# - name: Select Xcode version for Mac
# if: ${{ matrix.config.target_os == 'macos' }}
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: '11.7'

# Checkout code
- name: Checkout code
Expand Down
48 changes: 47 additions & 1 deletion Jamulus.pro
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,52 @@ win32 {
LIBS += "$${programfilesdir}/JACK2/lib/$${libjackname}"
}

} else:win64 {
DEFINES -= UNICODE # fixes issue with ASIO SDK (asiolist.cpp is not unicode compatible)
DEFINES += NOMINMAX # solves a compiler error in qdatetime.h (Qt5)
HEADERS += windows/sound.h
SOURCES += windows/sound.cpp \
windows/ASIOSDK2/common/asio.cpp \
windows/ASIOSDK2/host/asiodrivers.cpp \
windows/ASIOSDK2/host/pc/asiolist.cpp
RC_FILE = windows/mainicon.rc
INCLUDEPATH += windows/ASIOSDK2/common \
windows/ASIOSDK2/host \
windows/ASIOSDK2/host/pc
mingw* {
LIBS += -lole64 \
-luser64 \
-ladvapi64 \
-lwinmm \
-lws2_64
} else {
QMAKE_LFLAGS += /DYNAMICBASE:NO # fixes crash with libjack64.dll, see https://github.com/jamulussoftware/jamulus/issues/93
LIBS += ole64.lib \
user64.lib \
advapi64.lib \
winmm.lib \
ws2_64.lib
}

# replace ASIO with jack if requested
contains(CONFIG, "jackonwindows") {
message(Using Jack instead of ASIO.)

!exists("C:/Program Files (x86)/Jack/includes/jack/jack.h") {
message(Warning: jack.h was not found at the usual place, maybe jack is not installed)
}

HEADERS -= windows/sound.h
SOURCES -= windows/sound.cpp
HEADERS += linux/sound.h
SOURCES += linux/sound.cpp
DEFINES += WITH_JACK
DEFINES += JACK_REPLACES_ASIO
DEFINES += _STDINT_H # supposed to solve compilation error in systemdeps.h
INCLUDEPATH += "C:/Program Files (x86)/Jack/includes"
LIBS += "C:/Program Files (x86)/Jack/lib/libjack64.lib"
}

} else:macx {
contains(CONFIG, "server_bundle") {
message(The generated application bundle will run a server instance.)
Expand All @@ -136,7 +182,7 @@ win32 {
RC_FILE = mac/mainicon.icns
}

QT += macextras
#QT += macextras
HEADERS += mac/sound.h
SOURCES += mac/sound.cpp
HEADERS += mac/activity.h
Expand Down
6 changes: 4 additions & 2 deletions autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ echo "Install Qt..."
pip install aqtinstall
echo "Get Qt 64 bit..."
# intermediate solution if the main server is down: append e.g. " -b https://mirrors.ocf.berkeley.edu/qt/" to the "aqt"-line below
aqt install --outputdir C:\Qt 5.15.2 windows desktop win64_msvc2019_64
aqt install --outputdir C:\Qt 6.1.0 windows desktop win64_msvc2019_64

echo "Get Qt 32 bit..."
# intermediate solution if the main server is down: append e.g. " -b https://mirrors.ocf.berkeley.edu/qt/" to the "aqt"-line below
aqt install --outputdir C:\Qt 5.15.2 windows desktop win32_msvc2019

aqt install --outputdir C:\Qt 6.1.0 windows desktop win32_msvc2019


#################################
Expand All @@ -44,3 +45,4 @@ if ($BuildOption -Eq "jackonwindows")
choco install --no-progress -y -f --forcex86 jack
}


11 changes: 3 additions & 8 deletions autobuild/windows/autobuild_windowsinstaller_2_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ if (("$jamulus_project_path" -eq $null) -or ("$jamulus_project_path" -eq "")) {

echo "Build installer..."
# Build the installer
if ($BuildOption -ne "")
{
powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\5.15.2" -BuildOption $BuildOption
}
else
{
powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\5.15.2"
}

powershell "$jamulus_project_path\windows\deploy_windows.ps1" "C:\Qt\6.1.0"

9 changes: 7 additions & 2 deletions src/audiomixerboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,13 @@ void CChannelFader::SetChannelInfos ( const CChannelInfo& cChanInfo )
// Country flag icon -------------------------------------------------------
if ( cChanInfo.eCountry != QLocale::AnyCountry )
{
#if QT_VERSION >= 0x060000
QLocale::Country eC = CLocale::LocaleQt5toQt6 ( cChanInfo.eCountry );
#else
QLocale::Country eC = cChanInfo.eCountry;
#endif
// try to load the country flag icon
QPixmap CountryFlagPixmap ( CLocale::GetCountryFlagIconsResourceReference ( cChanInfo.eCountry ) );
QPixmap CountryFlagPixmap ( CLocale::GetCountryFlagIconsResourceReference ( eC ) );

// first check if resource reference was valid
if ( CountryFlagPixmap.isNull() )
Expand All @@ -719,7 +724,7 @@ void CChannelFader::SetChannelInfos ( const CChannelInfo& cChanInfo )
{
// set correct picture
plblCountryFlag->setPixmap ( CountryFlagPixmap );
eTTCountry = cChanInfo.eCountry;
eTTCountry = eC;

// enable country flag
plblCountryFlag->setVisible ( true );
Expand Down
5 changes: 3 additions & 2 deletions src/chatdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
\******************************************************************************/

#include "chatdlg.h"
#include <QRegularExpression>

/* Implementation *************************************************************/
CChatDlg::CChatDlg ( QWidget* parent ) : CBaseDlg ( parent, Qt::Window ) // use Qt::Window to get min/max window buttons
Expand Down Expand Up @@ -114,11 +115,11 @@ void CChatDlg::AddChatText ( QString strChatText )
// analyze strChatText to check if hyperlink (limit ourselves to http(s)://) but do not
// replace the hyperlinks if any HTML code for a hyperlink was found (the user has done the HTML
// coding hisself and we should not mess with that)
if ( !strChatText.contains ( QRegExp ( "href\\s*=|src\\s*=" ) ) )
if ( !strChatText.contains ( QRegularExpression ( "href\\s*=|src\\s*=" ) ) )
{
// searches for all occurrences of http(s) and cuts until a space (\S matches any non-white-space
// character and the + means that matches the previous element one or more times.)
strChatText.replace ( QRegExp ( "(https?://\\S+)" ), "<a href=\"\\1\">\\1</a>" );
strChatText.replace ( QRegularExpression ( "(https?://\\S+)" ), "<a href=\"\\1\">\\1</a>" );
}

// add new text in chat window
Expand Down
38 changes: 20 additions & 18 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
\******************************************************************************/

#include "clientdlg.h"
#include <QActionGroup>

/* Implementation *************************************************************/
CClientDlg::CClientDlg ( CClient* pNCliP,
Expand Down Expand Up @@ -918,24 +919,25 @@ void CClientDlg::SetMyWindowTitle ( const int iNumClients )
}

setWindowTitle ( strWinTitle );

#if defined( Q_OS_MACX )
// for MacOS only we show the number of connected clients as a
// badge label text if more than one user is connected
// (only available in Qt5.2)
# if QT_VERSION >= QT_VERSION_CHECK( 5, 2, 0 )
if ( iNumClients > 1 )
{
// show the number of connected clients
QtMac::setBadgeLabelText ( QString ( "%1" ).arg ( iNumClients ) );
}
else
{
// clear the text (apply an empty string)
QtMac::setBadgeLabelText ( "" );
}
# endif
#endif
/***
#if defined( Q_OS_MACX )
// for MacOS only we show the number of connected clients as a
// badge label text if more than one user is connected
// (only available in Qt5.2)
# if QT_VERSION >= QT_VERSION_CHECK( 5, 2, 0 )
if ( iNumClients > 1 )
{
// show the number of connected clients
NSApp.dockTile.badgeLabel ( QString ( "%1" ).arg ( iNumClients ) );
}
else
{
// clear the text (apply an empty string)
NSApp.dockTile.badgeLabel ( "" );
}
# endif
#endif
***/
}

void CClientDlg::ShowConnectionSetupDialog()
Expand Down
5 changes: 0 additions & 5 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@
#include "connectdlg.h"
#include "analyzerconsole.h"
#include "ui_clientdlgbase.h"
#if defined( __APPLE__ ) || defined( __MACOSX )
# if QT_VERSION >= QT_VERSION_CHECK( 5, 2, 0 )
# include <QtMac>
# endif
#endif

/* Definitions ****************************************************************/
// update time for GUI controls
Expand Down
14 changes: 12 additions & 2 deletions src/connectdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,11 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr, const CVector<CS

if ( vecServerInfo[iIdx].eCountry != QLocale::AnyCountry )
{
#if QT_VERSION >= 0x060000
QString strCountryToString = QLocale::countryToString ( CLocale::LocaleQt5toQt6 ( vecServerInfo[iIdx].eCountry ) );
#else
QString strCountryToString = QLocale::countryToString ( vecServerInfo[iIdx].eCountry );

#endif
// Qt countryToString does not use spaces in between country name
// parts but they use upper case letters which we can detect and
// insert spaces as a post processing
Expand Down Expand Up @@ -476,8 +479,11 @@ void CConnectDlg::SetConnClientsList ( const CHostAddress& InetAddr, const CVect
if ( vecChanInfo[i].eCountry != QLocale::AnyCountry )
{
// try to load the country flag icon
#if QT_VERSION >= 0x060000
QPixmap CountryFlagPixmap ( CLocale::GetCountryFlagIconsResourceReference ( CLocale::LocaleQt5toQt6 ( vecChanInfo[i].eCountry ) ) );
#else
QPixmap CountryFlagPixmap ( CLocale::GetCountryFlagIconsResourceReference ( vecChanInfo[i].eCountry ) );

#endif
// first check if resource reference was valid
if ( !CountryFlagPixmap.isNull() )
{
Expand Down Expand Up @@ -739,7 +745,11 @@ void CConnectDlg::OnTimerPing()
bEnableIPv6 ) )
{
// if address is valid, send ping message using a new thread
#if QT_VERSION >= 0x060000
QtConcurrent::run ( &CConnectDlg::EmitCLServerListPingMes, this, CurServerAddress );
#else
QtConcurrent::run ( this, &CConnectDlg::EmitCLServerListPingMes, CurServerAddress );
#endif
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/levelmeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CLevelMeter::CLevelMeter ( QWidget* parent ) : QWidget ( parent ), eLevelMeterTy
QWidget* pLEDMeter = new QWidget();
QVBoxLayout* pLEDLayout = new QVBoxLayout ( pLEDMeter );
pLEDLayout->setAlignment ( Qt::AlignHCenter );
pLEDLayout->setMargin ( 0 );
pLEDLayout->setContentsMargins ( 0, 0, 0, 0 );
pLEDLayout->setSpacing ( 0 );

// create LEDs plus the clip LED
Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
\******************************************************************************/
#ifdef _MSC_VER
# pragma comment( linker, "/subsystem:windows /ENTRY:mainCRTStartup" )
#endif

#include <QCoreApplication>
#include <QDir>
Expand Down
Loading