diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 26 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_camera.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_camera.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_advanced.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/direct_connect.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/validation.h | 16 |
9 files changed, 56 insertions, 14 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index adad36221..0aa109dd3 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -295,7 +295,7 @@ if (APPLE) | |||
| 295 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) | 295 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) |
| 296 | elseif(WIN32) | 296 | elseif(WIN32) |
| 297 | # compile as a win32 gui application instead of a console application | 297 | # compile as a win32 gui application instead of a console application |
| 298 | if (QT_VERSION VERSION_GREATER 6) | 298 | if (QT_VERSION VERSION_GREATER_EQUAL 6) |
| 299 | target_link_libraries(yuzu PRIVATE Qt6::EntryPointPrivate) | 299 | target_link_libraries(yuzu PRIVATE Qt6::EntryPointPrivate) |
| 300 | else() | 300 | else() |
| 301 | target_link_libraries(yuzu PRIVATE Qt5::WinMain) | 301 | target_link_libraries(yuzu PRIVATE Qt5::WinMain) |
| @@ -311,15 +311,15 @@ endif() | |||
| 311 | create_target_directory_groups(yuzu) | 311 | create_target_directory_groups(yuzu) |
| 312 | 312 | ||
| 313 | target_link_libraries(yuzu PRIVATE common core input_common network video_core) | 313 | target_link_libraries(yuzu PRIVATE common core input_common network video_core) |
| 314 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt::Widgets Qt::Multimedia) | 314 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt${QT_MAJOR_VERSION}::Widgets) |
| 315 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) | 315 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) |
| 316 | 316 | ||
| 317 | target_include_directories(yuzu PRIVATE ../../externals/Vulkan-Headers/include) | 317 | target_include_directories(yuzu PRIVATE ../../externals/Vulkan-Headers/include) |
| 318 | if (NOT WIN32) | 318 | if (NOT WIN32) |
| 319 | target_include_directories(yuzu PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) | 319 | target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}) |
| 320 | endif() | 320 | endif() |
| 321 | if (UNIX AND NOT APPLE) | 321 | if (UNIX AND NOT APPLE) |
| 322 | target_link_libraries(yuzu PRIVATE Qt::DBus) | 322 | target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus) |
| 323 | endif() | 323 | endif() |
| 324 | 324 | ||
| 325 | target_compile_definitions(yuzu PRIVATE | 325 | target_compile_definitions(yuzu PRIVATE |
| @@ -358,8 +358,13 @@ if (ENABLE_WEB_SERVICE) | |||
| 358 | target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE) | 358 | target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE) |
| 359 | endif() | 359 | endif() |
| 360 | 360 | ||
| 361 | if (YUZU_USE_QT_MULTIMEDIA) | ||
| 362 | target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::Multimedia) | ||
| 363 | target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_MULTIMEDIA) | ||
| 364 | endif () | ||
| 365 | |||
| 361 | if (YUZU_USE_QT_WEB_ENGINE) | 366 | if (YUZU_USE_QT_WEB_ENGINE) |
| 362 | target_link_libraries(yuzu PRIVATE Qt::WebEngineCore Qt::WebEngineWidgets) | 367 | target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::WebEngineCore Qt${QT_MAJOR_VERSION}::WebEngineWidgets) |
| 363 | target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE) | 368 | target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE) |
| 364 | endif () | 369 | endif () |
| 365 | 370 | ||
| @@ -367,7 +372,16 @@ if(UNIX AND NOT APPLE) | |||
| 367 | install(TARGETS yuzu) | 372 | install(TARGETS yuzu) |
| 368 | endif() | 373 | endif() |
| 369 | 374 | ||
| 370 | if (YUZU_USE_BUNDLED_QT) | 375 | if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6) |
| 376 | if (MSVC AND NOT ${CMAKE_GENERATOR} STREQUAL "Ninja") | ||
| 377 | set(YUZU_EXE_DIR "${CMAKE_BINARY_DIR}/bin/$<CONFIG>") | ||
| 378 | else() | ||
| 379 | set(YUZU_EXE_DIR "${CMAKE_BINARY_DIR}/bin") | ||
| 380 | endif() | ||
| 381 | add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/yuzu.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0) | ||
| 382 | endif() | ||
| 383 | |||
| 384 | if (YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_LESS 6) | ||
| 371 | include(CopyYuzuQt5Deps) | 385 | include(CopyYuzuQt5Deps) |
| 372 | copy_yuzu_Qt5_deps(yuzu) | 386 | copy_yuzu_Qt5_deps(yuzu) |
| 373 | endif() | 387 | endif() |
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index d88efacd7..c934069dd 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -4,8 +4,10 @@ | |||
| 4 | #include <glad/glad.h> | 4 | #include <glad/glad.h> |
| 5 | 5 | ||
| 6 | #include <QApplication> | 6 | #include <QApplication> |
| 7 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 7 | #include <QCameraImageCapture> | 8 | #include <QCameraImageCapture> |
| 8 | #include <QCameraInfo> | 9 | #include <QCameraInfo> |
| 10 | #endif | ||
| 9 | #include <QHBoxLayout> | 11 | #include <QHBoxLayout> |
| 10 | #include <QMessageBox> | 12 | #include <QMessageBox> |
| 11 | #include <QPainter> | 13 | #include <QPainter> |
| @@ -707,6 +709,7 @@ void GRenderWindow::TouchEndEvent() { | |||
| 707 | } | 709 | } |
| 708 | 710 | ||
| 709 | void GRenderWindow::InitializeCamera() { | 711 | void GRenderWindow::InitializeCamera() { |
| 712 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 710 | constexpr auto camera_update_ms = std::chrono::milliseconds{50}; // (50ms, 20Hz) | 713 | constexpr auto camera_update_ms = std::chrono::milliseconds{50}; // (50ms, 20Hz) |
| 711 | if (!Settings::values.enable_ir_sensor) { | 714 | if (!Settings::values.enable_ir_sensor) { |
| 712 | return; | 715 | return; |
| @@ -760,18 +763,22 @@ void GRenderWindow::InitializeCamera() { | |||
| 760 | connect(camera_timer.get(), &QTimer::timeout, [this] { RequestCameraCapture(); }); | 763 | connect(camera_timer.get(), &QTimer::timeout, [this] { RequestCameraCapture(); }); |
| 761 | // This timer should be dependent of camera resolution 5ms for every 100 pixels | 764 | // This timer should be dependent of camera resolution 5ms for every 100 pixels |
| 762 | camera_timer->start(camera_update_ms); | 765 | camera_timer->start(camera_update_ms); |
| 766 | #endif | ||
| 763 | } | 767 | } |
| 764 | 768 | ||
| 765 | void GRenderWindow::FinalizeCamera() { | 769 | void GRenderWindow::FinalizeCamera() { |
| 770 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 766 | if (camera_timer) { | 771 | if (camera_timer) { |
| 767 | camera_timer->stop(); | 772 | camera_timer->stop(); |
| 768 | } | 773 | } |
| 769 | if (camera) { | 774 | if (camera) { |
| 770 | camera->unload(); | 775 | camera->unload(); |
| 771 | } | 776 | } |
| 777 | #endif | ||
| 772 | } | 778 | } |
| 773 | 779 | ||
| 774 | void GRenderWindow::RequestCameraCapture() { | 780 | void GRenderWindow::RequestCameraCapture() { |
| 781 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 775 | if (!Settings::values.enable_ir_sensor) { | 782 | if (!Settings::values.enable_ir_sensor) { |
| 776 | return; | 783 | return; |
| 777 | } | 784 | } |
| @@ -788,6 +795,7 @@ void GRenderWindow::RequestCameraCapture() { | |||
| 788 | 795 | ||
| 789 | pending_camera_snapshots++; | 796 | pending_camera_snapshots++; |
| 790 | camera_capture->capture(); | 797 | camera_capture->capture(); |
| 798 | #endif | ||
| 791 | } | 799 | } |
| 792 | 800 | ||
| 793 | void GRenderWindow::OnCameraCapture(int requestId, const QImage& img) { | 801 | void GRenderWindow::OnCameraCapture(int requestId, const QImage& img) { |
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index c45ebf1a2..4a01481cd 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h | |||
| @@ -241,8 +241,10 @@ private: | |||
| 241 | 241 | ||
| 242 | bool is_virtual_camera; | 242 | bool is_virtual_camera; |
| 243 | int pending_camera_snapshots; | 243 | int pending_camera_snapshots; |
| 244 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 244 | std::unique_ptr<QCamera> camera; | 245 | std::unique_ptr<QCamera> camera; |
| 245 | std::unique_ptr<QCameraImageCapture> camera_capture; | 246 | std::unique_ptr<QCameraImageCapture> camera_capture; |
| 247 | #endif | ||
| 246 | std::unique_ptr<QTimer> camera_timer; | 248 | std::unique_ptr<QTimer> camera_timer; |
| 247 | 249 | ||
| 248 | Core::System& system; | 250 | Core::System& system; |
diff --git a/src/yuzu/configuration/configure_camera.cpp b/src/yuzu/configuration/configure_camera.cpp index 2a61de2a1..d95e96696 100644 --- a/src/yuzu/configuration/configure_camera.cpp +++ b/src/yuzu/configuration/configure_camera.cpp | |||
| @@ -2,8 +2,11 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | 2 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 3 | 3 | ||
| 4 | #include <memory> | 4 | #include <memory> |
| 5 | #include <QtCore> | ||
| 6 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 5 | #include <QCameraImageCapture> | 7 | #include <QCameraImageCapture> |
| 6 | #include <QCameraInfo> | 8 | #include <QCameraInfo> |
| 9 | #endif | ||
| 7 | #include <QStandardItemModel> | 10 | #include <QStandardItemModel> |
| 8 | #include <QTimer> | 11 | #include <QTimer> |
| 9 | 12 | ||
| @@ -33,6 +36,7 @@ ConfigureCamera::ConfigureCamera(QWidget* parent, InputCommon::InputSubsystem* i | |||
| 33 | ConfigureCamera::~ConfigureCamera() = default; | 36 | ConfigureCamera::~ConfigureCamera() = default; |
| 34 | 37 | ||
| 35 | void ConfigureCamera::PreviewCamera() { | 38 | void ConfigureCamera::PreviewCamera() { |
| 39 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 36 | const auto index = ui->ir_sensor_combo_box->currentIndex(); | 40 | const auto index = ui->ir_sensor_combo_box->currentIndex(); |
| 37 | bool camera_found = false; | 41 | bool camera_found = false; |
| 38 | const QList<QCameraInfo> cameras = QCameraInfo::availableCameras(); | 42 | const QList<QCameraInfo> cameras = QCameraInfo::availableCameras(); |
| @@ -101,6 +105,7 @@ void ConfigureCamera::PreviewCamera() { | |||
| 101 | }); | 105 | }); |
| 102 | 106 | ||
| 103 | camera_timer->start(250); | 107 | camera_timer->start(250); |
| 108 | #endif | ||
| 104 | } | 109 | } |
| 105 | 110 | ||
| 106 | void ConfigureCamera::DisplayCapturedFrame(int requestId, const QImage& img) { | 111 | void ConfigureCamera::DisplayCapturedFrame(int requestId, const QImage& img) { |
| @@ -133,11 +138,13 @@ void ConfigureCamera::LoadConfiguration() { | |||
| 133 | ui->ir_sensor_combo_box->clear(); | 138 | ui->ir_sensor_combo_box->clear(); |
| 134 | input_devices.push_back("Auto"); | 139 | input_devices.push_back("Auto"); |
| 135 | ui->ir_sensor_combo_box->addItem(tr("Auto")); | 140 | ui->ir_sensor_combo_box->addItem(tr("Auto")); |
| 141 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 136 | const auto cameras = QCameraInfo::availableCameras(); | 142 | const auto cameras = QCameraInfo::availableCameras(); |
| 137 | for (const QCameraInfo& cameraInfo : cameras) { | 143 | for (const QCameraInfo& cameraInfo : cameras) { |
| 138 | input_devices.push_back(cameraInfo.deviceName().toStdString()); | 144 | input_devices.push_back(cameraInfo.deviceName().toStdString()); |
| 139 | ui->ir_sensor_combo_box->addItem(cameraInfo.description()); | 145 | ui->ir_sensor_combo_box->addItem(cameraInfo.description()); |
| 140 | } | 146 | } |
| 147 | #endif | ||
| 141 | 148 | ||
| 142 | const auto current_device = Settings::values.ir_sensor_device.GetValue(); | 149 | const auto current_device = Settings::values.ir_sensor_device.GetValue(); |
| 143 | 150 | ||
diff --git a/src/yuzu/configuration/configure_camera.h b/src/yuzu/configuration/configure_camera.h index db9833b5c..9a90512b3 100644 --- a/src/yuzu/configuration/configure_camera.h +++ b/src/yuzu/configuration/configure_camera.h | |||
| @@ -46,8 +46,10 @@ private: | |||
| 46 | 46 | ||
| 47 | bool is_virtual_camera; | 47 | bool is_virtual_camera; |
| 48 | int pending_snapshots; | 48 | int pending_snapshots; |
| 49 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA | ||
| 49 | std::unique_ptr<QCamera> camera; | 50 | std::unique_ptr<QCamera> camera; |
| 50 | std::unique_ptr<QCameraImageCapture> camera_capture; | 51 | std::unique_ptr<QCameraImageCapture> camera_capture; |
| 52 | #endif | ||
| 51 | std::unique_ptr<QTimer> camera_timer; | 53 | std::unique_ptr<QTimer> camera_timer; |
| 52 | std::vector<std::string> input_devices; | 54 | std::vector<std::string> input_devices; |
| 53 | std::unique_ptr<Ui::ConfigureCamera> ui; | 55 | std::unique_ptr<Ui::ConfigureCamera> ui; |
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index 10f841b98..235b813d9 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp | |||
| @@ -194,4 +194,8 @@ void ConfigureInputAdvanced::UpdateUIEnabled() { | |||
| 194 | ui->mouse_panning->setEnabled(!ui->mouse_enabled->isChecked()); | 194 | ui->mouse_panning->setEnabled(!ui->mouse_enabled->isChecked()); |
| 195 | ui->mouse_panning_sensitivity->setEnabled(!ui->mouse_enabled->isChecked()); | 195 | ui->mouse_panning_sensitivity->setEnabled(!ui->mouse_enabled->isChecked()); |
| 196 | ui->ring_controller_configure->setEnabled(ui->enable_ring_controller->isChecked()); | 196 | ui->ring_controller_configure->setEnabled(ui->enable_ring_controller->isChecked()); |
| 197 | #if QT_VERSION > QT_VERSION_CHECK(6, 0, 0) || !defined(YUZU_USE_QT_MULTIMEDIA) | ||
| 198 | ui->enable_ir_sensor->setEnabled(false); | ||
| 199 | ui->camera_configure->setEnabled(false); | ||
| 200 | #endif | ||
| 197 | } | 201 | } |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4081af391..2aae746f0 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -237,6 +237,7 @@ static void LogRuntimes() { | |||
| 237 | LOG_INFO(Frontend, "Unable to inspect {}", runtime_dll_name); | 237 | LOG_INFO(Frontend, "Unable to inspect {}", runtime_dll_name); |
| 238 | } | 238 | } |
| 239 | #endif | 239 | #endif |
| 240 | LOG_INFO(Frontend, "Qt Compile: {} Runtime: {}", QT_VERSION_STR, qVersion()); | ||
| 240 | } | 241 | } |
| 241 | 242 | ||
| 242 | static QString PrettyProductName() { | 243 | static QString PrettyProductName() { |
| @@ -4217,10 +4218,12 @@ int main(int argc, char* argv[]) { | |||
| 4217 | // so we can see if we get \u3008 instead | 4218 | // so we can see if we get \u3008 instead |
| 4218 | // TL;DR all other number formats are consecutive in unicode code points | 4219 | // TL;DR all other number formats are consecutive in unicode code points |
| 4219 | // This bug is fixed in Qt6, specifically 6.0.0-alpha1 | 4220 | // This bug is fixed in Qt6, specifically 6.0.0-alpha1 |
| 4221 | #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) | ||
| 4220 | const QLocale locale = QLocale::system(); | 4222 | const QLocale locale = QLocale::system(); |
| 4221 | if (QStringLiteral("\u3008") == locale.toString(1)) { | 4223 | if (QStringLiteral("\u3008") == locale.toString(1)) { |
| 4222 | QLocale::setDefault(QLocale::system().name()); | 4224 | QLocale::setDefault(QLocale::system().name()); |
| 4223 | } | 4225 | } |
| 4226 | #endif | ||
| 4224 | 4227 | ||
| 4225 | // Qt changes the locale and causes issues in float conversion using std::to_string() when | 4228 | // Qt changes the locale and causes issues in float conversion using std::to_string() when |
| 4226 | // generating shaders | 4229 | // generating shaders |
diff --git a/src/yuzu/multiplayer/direct_connect.cpp b/src/yuzu/multiplayer/direct_connect.cpp index 10bf0a4fb..cbd52da85 100644 --- a/src/yuzu/multiplayer/direct_connect.cpp +++ b/src/yuzu/multiplayer/direct_connect.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <QComboBox> | 4 | #include <QComboBox> |
| 5 | #include <QFuture> | 5 | #include <QFuture> |
| 6 | #include <QIntValidator> | 6 | #include <QIntValidator> |
| 7 | #include <QRegExpValidator> | 7 | #include <QRegularExpressionValidator> |
| 8 | #include <QString> | 8 | #include <QString> |
| 9 | #include <QtConcurrent/QtConcurrentRun> | 9 | #include <QtConcurrent/QtConcurrentRun> |
| 10 | #include "common/settings.h" | 10 | #include "common/settings.h" |
diff --git a/src/yuzu/multiplayer/validation.h b/src/yuzu/multiplayer/validation.h index dabf860be..dd25af280 100644 --- a/src/yuzu/multiplayer/validation.h +++ b/src/yuzu/multiplayer/validation.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <QRegExp> | 6 | #include <QRegularExpression> |
| 7 | #include <QString> | 7 | #include <QString> |
| 8 | #include <QValidator> | 8 | #include <QValidator> |
| 9 | 9 | ||
| @@ -29,19 +29,21 @@ public: | |||
| 29 | 29 | ||
| 30 | private: | 30 | private: |
| 31 | /// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 | 31 | /// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 |
| 32 | QRegExp room_name_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); | 32 | QRegularExpression room_name_regex = |
| 33 | QRegExpValidator room_name; | 33 | QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); |
| 34 | QRegularExpressionValidator room_name; | ||
| 34 | 35 | ||
| 35 | /// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 | 36 | /// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 |
| 36 | QRegExp nickname_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); | 37 | const QRegularExpression nickname_regex = |
| 37 | QRegExpValidator nickname; | 38 | QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); |
| 39 | QRegularExpressionValidator nickname; | ||
| 38 | 40 | ||
| 39 | /// ipv4 address only | 41 | /// ipv4 address only |
| 40 | // TODO remove this when we support hostnames in direct connect | 42 | // TODO remove this when we support hostnames in direct connect |
| 41 | QRegExp ip_regex = QRegExp(QStringLiteral( | 43 | QRegularExpression ip_regex = QRegularExpression(QStringLiteral( |
| 42 | "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|" | 44 | "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|" |
| 43 | "2[0-4][0-9]|25[0-5])")); | 45 | "2[0-4][0-9]|25[0-5])")); |
| 44 | QRegExpValidator ip; | 46 | QRegularExpressionValidator ip; |
| 45 | 47 | ||
| 46 | /// port must be between 0 and 65535 | 48 | /// port must be between 0 and 65535 |
| 47 | QIntValidator port; | 49 | QIntValidator port; |