diff --git a/rpcs3/rpcs3qt/custom_dock_widget.h b/rpcs3/rpcs3qt/custom_dock_widget.h index 2c54f30ce1..d24725d007 100644 --- a/rpcs3/rpcs3qt/custom_dock_widget.h +++ b/rpcs3/rpcs3qt/custom_dock_widget.h @@ -55,7 +55,7 @@ protected: if (isFloating()) { QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); return; diff --git a/rpcs3/rpcs3qt/debugger_frame.cpp b/rpcs3/rpcs3qt/debugger_frame.cpp index f7d2f4124e..0b66349c79 100644 --- a/rpcs3/rpcs3qt/debugger_frame.cpp +++ b/rpcs3/rpcs3qt/debugger_frame.cpp @@ -412,7 +412,7 @@ void debugger_frame::keyPressEvent(QKeyEvent* event) dlg.set_input_font(mono, false); dlg.set_clear_button_enabled(false); dlg.set_button_enabled(QDialogButtonBox::StandardButton::Ok, false); - dlg.set_validator(new QRegExpValidator(QRegExp("^[1-9][0-9]*$"))); + dlg.set_validator(new QRegularExpressionValidator(QRegularExpression("^[1-9][0-9]*$"))); u32 max = 0; @@ -1010,11 +1010,11 @@ void debugger_frame::ShowGotoAddressDialog() if (const auto thread = get_cpu(); !thread || thread->id_type() != 2) { - expression_input->setValidator(new QRegExpValidator(QRegExp("^(0[xX])?0*[a-fA-F0-9]{0,8}$"))); + expression_input->setValidator(new QRegularExpressionValidator(QRegularExpression("^(0[xX])?0*[a-fA-F0-9]{0,8}$"))); } else { - expression_input->setValidator(new QRegExpValidator(QRegExp("^(0[xX])?0*[a-fA-F0-9]{0,5}$"))); + expression_input->setValidator(new QRegularExpressionValidator(QRegularExpression("^(0[xX])?0*[a-fA-F0-9]{0,5}$"))); } // Ok/Cancel @@ -1058,8 +1058,8 @@ u64 debugger_frame::EvaluateExpression(const QString& expression) { bool ok = false; - // Parse expression(or at least used to, was nuked to remove the need for QtJsEngine) - const QString fixed_expression = QRegExp("^[A-Fa-f0-9]+$").exactMatch(expression) ? "0x" + expression : expression; + // Parse expression (or at least used to, was nuked to remove the need for QtJsEngine) + const QString fixed_expression = QRegularExpression(QRegularExpression::anchoredPattern("a .*|^[A-Fa-f0-9]+$")).match(expression).hasMatch() ? "0x" + expression : expression; const u64 res = static_cast(fixed_expression.toULong(&ok, 16)); if (ok) return res; diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 82886558bb..bb7cfa36ee 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -679,7 +679,7 @@ void main_window::InstallPackages(QStringList file_paths) const auto install_filetype = [&installed_rap_and_edat_count, &file_paths](const std::string extension) { const QString pattern = QString(".*\\.%1").arg(QString::fromStdString(extension)); - for (const auto& file : file_paths.filter(QRegExp(pattern, Qt::CaseInsensitive))) + for (const auto& file : file_paths.filter(QRegularExpression(pattern, QRegularExpression::PatternOption::CaseInsensitiveOption))) { const QFileInfo file_info(file); const std::string filename = sstr(file_info.fileName()); @@ -706,7 +706,7 @@ void main_window::InstallPackages(QStringList file_paths) } // Find remaining package files - file_paths = file_paths.filter(QRegExp(".*\\.pkg", Qt::CaseInsensitive)); + file_paths = file_paths.filter(QRegularExpression(".*\\.pkg", QRegularExpression::PatternOption::CaseInsensitiveOption)); if (!file_paths.isEmpty()) { @@ -1418,7 +1418,7 @@ void main_window::DecryptSPRXLibraries() dlg.set_input_font(mono, true, '0'); dlg.set_clear_button_enabled(false); dlg.set_button_enabled(QDialogButtonBox::StandardButton::Ok, false); - dlg.set_validator(new QRegExpValidator(QRegExp("^[a-fA-F0-9]*$"))); // HEX only + dlg.set_validator(new QRegularExpressionValidator(QRegularExpression("^[a-fA-F0-9]*$"))); // HEX only connect(&dlg, &input_dialog::text_changed, &dlg, [&dlg](const QString& text) { @@ -2885,8 +2885,7 @@ main_window::drop_type main_window::IsValidFile(const QMimeData& md, QStringList for (auto&& url : list) // check each file in url list for valid type { const QString path = url.toLocalFile(); // convert url to filepath - - const QFileInfo info = path; + const QFileInfo info(path); // check for directories first, only valid if all other paths led to directories until now. if (info.isDir()) diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index 6205ef277f..cf0ee68ee6 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -66,7 +66,6 @@ class main_window : public QMainWindow QWinThumbnailToolButton *m_thumb_playPause = nullptr; QWinThumbnailToolButton *m_thumb_stop = nullptr; QWinThumbnailToolButton *m_thumb_restart = nullptr; - QStringList m_vulkan_adapters; #endif enum class drop_type diff --git a/rpcs3/rpcs3qt/memory_viewer_panel.cpp b/rpcs3/rpcs3qt/memory_viewer_panel.cpp index 5bbc09a08e..d7018379c2 100644 --- a/rpcs3/rpcs3qt/memory_viewer_panel.cpp +++ b/rpcs3/rpcs3qt/memory_viewer_panel.cpp @@ -81,7 +81,7 @@ memory_viewer_panel::memory_viewer_panel(QWidget* parent, u32 addr, std::functio m_addr_line->setMaxLength(18); m_addr_line->setFixedWidth(75); m_addr_line->setFocus(); - m_addr_line->setValidator(new QRegExpValidator(QRegExp(m_type == thread_type::spu ? "^(0[xX])?0*[a-fA-F0-9]{0,5}$" : "^(0[xX])?0*[a-fA-F0-9]{0,8}$"))); + m_addr_line->setValidator(new QRegularExpressionValidator(QRegularExpression(m_type == thread_type::spu ? "^(0[xX])?0*[a-fA-F0-9]{0,5}$" : "^(0[xX])?0*[a-fA-F0-9]{0,8}$"))); hbox_tools_mem_addr->addWidget(m_addr_line); tools_mem_addr->setLayout(hbox_tools_mem_addr); diff --git a/rpcs3/rpcs3qt/osk_dialog_frame.cpp b/rpcs3/rpcs3qt/osk_dialog_frame.cpp index 4e33316c9a..989371c70f 100644 --- a/rpcs3/rpcs3qt/osk_dialog_frame.cpp +++ b/rpcs3/rpcs3qt/osk_dialog_frame.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include constexpr auto qstr = QString::fromStdString; @@ -70,7 +70,7 @@ void osk_dialog_frame::Create(const std::string& title, const std::u16string& me if (prohibit_flags & CELL_OSKDIALOG_NO_SPACE) { - input->setValidator(new QRegExpValidator(QRegExp("^\\S*$"), this)); + input->setValidator(new QRegularExpressionValidator(QRegularExpression("^\\S*$"), this)); } connect(input, &QLineEdit::textChanged, input_count_label, [input_count_label, charlimit, this](const QString& text) @@ -122,7 +122,7 @@ void osk_dialog_frame::Create(const std::string& title, const std::u16string& me if (prohibit_flags & CELL_OSKDIALOG_NO_SPACE) { int trim_len = text.length(); - text.remove(QRegExp("\\s+")); + text.remove(QRegularExpression("\\s+")); trim_len -= text.length(); cursor_pos -= trim_len; } diff --git a/rpcs3/rpcs3qt/patch_manager_dialog.cpp b/rpcs3/rpcs3qt/patch_manager_dialog.cpp index 6ced600e2b..61869f1089 100644 --- a/rpcs3/rpcs3qt/patch_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/patch_manager_dialog.cpp @@ -745,8 +745,8 @@ bool patch_manager_dialog::is_valid_file(const QMimeData& md, QStringList* drop_ for (auto&& url : list) // Check each file in url list for valid type { - const QString path = url.toLocalFile(); // Convert url to filepath - const QFileInfo info = path; + const QString path = url.toLocalFile(); // Convert url to filepath + const QFileInfo info(path); if (!info.fileName().endsWith("patch.yml")) { diff --git a/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp b/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp index a01acaaf9b..857de64182 100644 --- a/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include @@ -101,7 +101,7 @@ rpcn_account_dialog::rpcn_account_dialog(QWidget* parent) QLabel* label_npid = new QLabel(tr("NPID (username):")); m_edit_npid = new QLineEdit(); m_edit_npid->setMaxLength(16); - m_edit_npid->setValidator(new QRegExpValidator(QRegExp("^[a-zA-Z0-9_\\-]*$"), this)); + m_edit_npid->setValidator(new QRegularExpressionValidator(QRegularExpression("^[a-zA-Z0-9_\\-]*$"), this)); QLabel* label_pass = new QLabel(tr("Password:")); QPushButton* btn_chg_pass = new QPushButton(tr("Set Password")); QLabel* label_token = new QLabel(tr("Token:")); @@ -229,7 +229,7 @@ void rpcn_account_dialog::create_account() return; QString email; - const QRegExpValidator simple_email_validator(QRegExp("^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$")); + const QRegularExpressionValidator simple_email_validator(QRegularExpression("^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$")); while (true) { diff --git a/rpcs3/rpcs3qt/save_manager_dialog.cpp b/rpcs3/rpcs3qt/save_manager_dialog.cpp index 4d064edf12..2a245823a9 100644 --- a/rpcs3/rpcs3qt/save_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/save_manager_dialog.cpp @@ -33,10 +33,10 @@ namespace [[maybe_unused]] inline std::string sstr(const QString& _in) { return _in.toStdString(); } - QString FormatTimestamp(u64 time) + QString FormatTimestamp(s64 time) { QDateTime dateTime; - dateTime.setTime_t(time); + dateTime.setSecsSinceEpoch(time); return dateTime.toString("yyyy-MM-dd HH:mm:ss"); } diff --git a/rpcs3/rpcs3qt/skylander_dialog.cpp b/rpcs3/rpcs3qt/skylander_dialog.cpp index a13f1a960a..c994c549ab 100644 --- a/rpcs3/rpcs3qt/skylander_dialog.cpp +++ b/rpcs3/rpcs3qt/skylander_dialog.cpp @@ -563,12 +563,12 @@ skylander_creator_dialog::skylander_creator_dialog(QWidget* parent) line->setFrameShadow(QFrame::Sunken); vbox_panel->addWidget(line); - QHBoxLayout* hbox_idvar = new QHBoxLayout(); - QLabel* label_id = new QLabel(tr("ID:")); - QLabel* label_var = new QLabel(tr("Variant:")); - QLineEdit* edit_id = new QLineEdit("0"); - QLineEdit* edit_var = new QLineEdit("0"); - QRegExpValidator* rxv = new QRegExpValidator(QRegExp("\\d*"), this); + QHBoxLayout* hbox_idvar = new QHBoxLayout(); + QLabel* label_id = new QLabel(tr("ID:")); + QLabel* label_var = new QLabel(tr("Variant:")); + QLineEdit* edit_id = new QLineEdit("0"); + QLineEdit* edit_var = new QLineEdit("0"); + QRegularExpressionValidator* rxv = new QRegularExpressionValidator(QRegularExpression("\\d*"), this); edit_id->setValidator(rxv); edit_var->setValidator(rxv); hbox_idvar->addWidget(label_id); diff --git a/rpcs3/rpcs3qt/user_manager_dialog.cpp b/rpcs3/rpcs3qt/user_manager_dialog.cpp index bbbfe74a65..0ecf91da3c 100644 --- a/rpcs3/rpcs3qt/user_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/user_manager_dialog.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -250,7 +250,7 @@ bool user_manager_dialog::ValidateUsername(const QString& text_to_validate) { // "Entire string (^...$) must be between 3 and 16 characters // and only consist of letters, numbers, underscores, and hyphens." - const QRegExpValidator validator(QRegExp("^[A-Za-z0-9_-]{3,16}$")); + const QRegularExpressionValidator validator(QRegularExpression("^[A-Za-z0-9_-]{3,16}$")); int pos = 0; QString text = text_to_validate;