mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 10:03:55 -07:00
min Qt 6.4
This commit is contained in:
parent
288a408bb0
commit
39f663aaaa
6 changed files with 5 additions and 32 deletions
|
|
@ -168,6 +168,8 @@ if [[ $RUNNER_OS == macOS ]]; then
|
||||||
# we use find to get the first subfolder with the name "macos"
|
# we use find to get the first subfolder with the name "macos"
|
||||||
# this works independent of the qt version as there should be only one version installed on the runner at a time
|
# this works independent of the qt version as there should be only one version installed on the runner at a time
|
||||||
export QTDIR
|
export QTDIR
|
||||||
|
# Add QTDIR to CMAKE_PREFIX_PATH so CMake can find Qt6
|
||||||
|
export CMAKE_PREFIX_PATH="$QTDIR:$CMAKE_PREFIX_PATH"
|
||||||
|
|
||||||
if [[ $TARGET_MACOS_VERSION ]]; then
|
if [[ $TARGET_MACOS_VERSION ]]; then
|
||||||
# CMAKE_OSX_DEPLOYMENT_TARGET is a vanilla cmake flag needed to compile to target macOS version
|
# CMAKE_OSX_DEPLOYMENT_TARGET is a vanilla cmake flag needed to compile to target macOS version
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
add_definitions("-DSFMT_MEXP=19937")
|
add_definitions("-DSFMT_MEXP=19937")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(Qt6 6.4 REQUIRED)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
# Determine 32 or 64 bit build
|
# Determine 32 or 64 bit build
|
||||||
|
|
@ -360,7 +362,6 @@ if(TEST)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(Qt6_FOUND AND Qt6_VERSION_MINOR GREATER_EQUAL 3)
|
if(Qt6_FOUND)
|
||||||
# Qt6.3+ requires project finalization to support translations
|
|
||||||
qt6_finalize_project()
|
qt6_finalize_project()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -221,13 +221,7 @@ bool CardPictureLoader::hasCustomArt()
|
||||||
// Check if there is at least one non-directory file in the pics path, other
|
// Check if there is at least one non-directory file in the pics path, other
|
||||||
// than in the "downloadedPics" subdirectory.
|
// than in the "downloadedPics" subdirectory.
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
|
|
||||||
QFileInfo dir(it.nextFileInfo());
|
QFileInfo dir(it.nextFileInfo());
|
||||||
#else
|
|
||||||
// nextFileInfo() is only available in Qt 6.3+, for previous versions, we build
|
|
||||||
// the QFileInfo from a QString which requires more system calls.
|
|
||||||
QFileInfo dir(it.next());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (it.fileName() == "downloadedPics")
|
if (it.fileName() == "downloadedPics")
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -1441,12 +1441,7 @@ MessagesSettingsPage::MessagesSettingsPage()
|
||||||
|
|
||||||
void MessagesSettingsPage::updateColor(const QString &value)
|
void MessagesSettingsPage::updateColor(const QString &value)
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
|
||||||
QColor colorToSet = QColor::fromString("#" + value);
|
QColor colorToSet = QColor::fromString("#" + value);
|
||||||
#else
|
|
||||||
QColor colorToSet;
|
|
||||||
colorToSet.setNamedColor("#" + value);
|
|
||||||
#endif
|
|
||||||
if (colorToSet.isValid()) {
|
if (colorToSet.isValid()) {
|
||||||
SettingsCache::instance().setChatMentionColor(value);
|
SettingsCache::instance().setChatMentionColor(value);
|
||||||
updateMentionPreview();
|
updateMentionPreview();
|
||||||
|
|
@ -1455,12 +1450,7 @@ void MessagesSettingsPage::updateColor(const QString &value)
|
||||||
|
|
||||||
void MessagesSettingsPage::updateHighlightColor(const QString &value)
|
void MessagesSettingsPage::updateHighlightColor(const QString &value)
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
|
||||||
QColor colorToSet = QColor::fromString("#" + value);
|
QColor colorToSet = QColor::fromString("#" + value);
|
||||||
#else
|
|
||||||
QColor colorToSet;
|
|
||||||
colorToSet.setNamedColor("#" + value);
|
|
||||||
#endif
|
|
||||||
if (colorToSet.isValid()) {
|
if (colorToSet.isValid()) {
|
||||||
SettingsCache::instance().setChatHighlightColor(value);
|
SettingsCache::instance().setChatHighlightColor(value);
|
||||||
updateHighlightPreview();
|
updateHighlightPreview();
|
||||||
|
|
|
||||||
|
|
@ -517,23 +517,13 @@ void ChatView::showSystemPopup(const QString &userName)
|
||||||
|
|
||||||
QColor ChatView::getCustomMentionColor()
|
QColor ChatView::getCustomMentionColor()
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
|
||||||
QColor customColor = QColor::fromString("#" + SettingsCache::instance().getChatMentionColor());
|
QColor customColor = QColor::fromString("#" + SettingsCache::instance().getChatMentionColor());
|
||||||
#else
|
|
||||||
QColor customColor;
|
|
||||||
customColor.setNamedColor("#" + SettingsCache::instance().getChatMentionColor());
|
|
||||||
#endif
|
|
||||||
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
|
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor ChatView::getCustomHighlightColor()
|
QColor ChatView::getCustomHighlightColor()
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
|
||||||
QColor customColor = QColor::fromString("#" + SettingsCache::instance().getChatMentionColor());
|
QColor customColor = QColor::fromString("#" + SettingsCache::instance().getChatMentionColor());
|
||||||
#else
|
|
||||||
QColor customColor;
|
|
||||||
customColor.setNamedColor("#" + SettingsCache::instance().getChatMentionColor());
|
|
||||||
#endif
|
|
||||||
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
|
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,11 +167,7 @@ bool QxtHmac::verify(const QByteArray& otherInner)
|
||||||
void QxtHmac::addData(const char* data, int length)
|
void QxtHmac::addData(const char* data, int length)
|
||||||
{
|
{
|
||||||
Q_ASSERT(qxt_d().opad.size());
|
Q_ASSERT(qxt_d().opad.size());
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
|
|
||||||
qxt_d().ihash->addData(QByteArrayView(data, length));
|
qxt_d().ihash->addData(QByteArrayView(data, length));
|
||||||
#else
|
|
||||||
qxt_d().ihash->addData(data, length);
|
|
||||||
#endif
|
|
||||||
qxt_d().result.clear();
|
qxt_d().result.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue