mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-22 12:39:52 +00:00
Qt: Replace some deprecated Qt5 stuff
This commit is contained in:
parent
e9af0bb72b
commit
8d781a737b
@ -55,7 +55,7 @@ protected:
|
|||||||
if (isFloating())
|
if (isFloating())
|
||||||
{
|
{
|
||||||
QStyleOption opt;
|
QStyleOption opt;
|
||||||
opt.init(this);
|
opt.initFrom(this);
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
return;
|
return;
|
||||||
|
@ -412,7 +412,7 @@ void debugger_frame::keyPressEvent(QKeyEvent* event)
|
|||||||
dlg.set_input_font(mono, false);
|
dlg.set_input_font(mono, false);
|
||||||
dlg.set_clear_button_enabled(false);
|
dlg.set_clear_button_enabled(false);
|
||||||
dlg.set_button_enabled(QDialogButtonBox::StandardButton::Ok, 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;
|
u32 max = 0;
|
||||||
|
|
||||||
@ -1010,11 +1010,11 @@ void debugger_frame::ShowGotoAddressDialog()
|
|||||||
|
|
||||||
if (const auto thread = get_cpu(); !thread || thread->id_type() != 2)
|
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
|
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
|
// Ok/Cancel
|
||||||
@ -1059,7 +1059,7 @@ u64 debugger_frame::EvaluateExpression(const QString& expression)
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
// Parse expression (or at least used to, was nuked to remove the need for QtJsEngine)
|
// 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;
|
const QString fixed_expression = QRegularExpression(QRegularExpression::anchoredPattern("a .*|^[A-Fa-f0-9]+$")).match(expression).hasMatch() ? "0x" + expression : expression;
|
||||||
const u64 res = static_cast<u64>(fixed_expression.toULong(&ok, 16));
|
const u64 res = static_cast<u64>(fixed_expression.toULong(&ok, 16));
|
||||||
|
|
||||||
if (ok) return res;
|
if (ok) return res;
|
||||||
|
@ -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 auto install_filetype = [&installed_rap_and_edat_count, &file_paths](const std::string extension)
|
||||||
{
|
{
|
||||||
const QString pattern = QString(".*\\.%1").arg(QString::fromStdString(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 QFileInfo file_info(file);
|
||||||
const std::string filename = sstr(file_info.fileName());
|
const std::string filename = sstr(file_info.fileName());
|
||||||
@ -706,7 +706,7 @@ void main_window::InstallPackages(QStringList file_paths)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find remaining package files
|
// 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())
|
if (!file_paths.isEmpty())
|
||||||
{
|
{
|
||||||
@ -1418,7 +1418,7 @@ void main_window::DecryptSPRXLibraries()
|
|||||||
dlg.set_input_font(mono, true, '0');
|
dlg.set_input_font(mono, true, '0');
|
||||||
dlg.set_clear_button_enabled(false);
|
dlg.set_clear_button_enabled(false);
|
||||||
dlg.set_button_enabled(QDialogButtonBox::StandardButton::Ok, 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)
|
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
|
for (auto&& url : list) // check each file in url list for valid type
|
||||||
{
|
{
|
||||||
const QString path = url.toLocalFile(); // convert url to filepath
|
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.
|
// check for directories first, only valid if all other paths led to directories until now.
|
||||||
if (info.isDir())
|
if (info.isDir())
|
||||||
|
@ -66,7 +66,6 @@ class main_window : public QMainWindow
|
|||||||
QWinThumbnailToolButton *m_thumb_playPause = nullptr;
|
QWinThumbnailToolButton *m_thumb_playPause = nullptr;
|
||||||
QWinThumbnailToolButton *m_thumb_stop = nullptr;
|
QWinThumbnailToolButton *m_thumb_stop = nullptr;
|
||||||
QWinThumbnailToolButton *m_thumb_restart = nullptr;
|
QWinThumbnailToolButton *m_thumb_restart = nullptr;
|
||||||
QStringList m_vulkan_adapters;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum class drop_type
|
enum class drop_type
|
||||||
|
@ -81,7 +81,7 @@ memory_viewer_panel::memory_viewer_panel(QWidget* parent, u32 addr, std::functio
|
|||||||
m_addr_line->setMaxLength(18);
|
m_addr_line->setMaxLength(18);
|
||||||
m_addr_line->setFixedWidth(75);
|
m_addr_line->setFixedWidth(75);
|
||||||
m_addr_line->setFocus();
|
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);
|
hbox_tools_mem_addr->addWidget(m_addr_line);
|
||||||
tools_mem_addr->setLayout(hbox_tools_mem_addr);
|
tools_mem_addr->setLayout(hbox_tools_mem_addr);
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QRegExpValidator>
|
#include <QRegularExpressionValidator>
|
||||||
|
|
||||||
constexpr auto qstr = QString::fromStdString;
|
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)
|
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)
|
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)
|
if (prohibit_flags & CELL_OSKDIALOG_NO_SPACE)
|
||||||
{
|
{
|
||||||
int trim_len = text.length();
|
int trim_len = text.length();
|
||||||
text.remove(QRegExp("\\s+"));
|
text.remove(QRegularExpression("\\s+"));
|
||||||
trim_len -= text.length();
|
trim_len -= text.length();
|
||||||
cursor_pos -= trim_len;
|
cursor_pos -= trim_len;
|
||||||
}
|
}
|
||||||
|
@ -746,7 +746,7 @@ 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
|
for (auto&& url : list) // Check each file in url list for valid type
|
||||||
{
|
{
|
||||||
const QString path = url.toLocalFile(); // Convert url to filepath
|
const QString path = url.toLocalFile(); // Convert url to filepath
|
||||||
const QFileInfo info = path;
|
const QFileInfo info(path);
|
||||||
|
|
||||||
if (!info.fileName().endsWith("patch.yml"))
|
if (!info.fileName().endsWith("patch.yml"))
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QRegExpValidator>
|
#include <QRegularExpressionValidator>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@ -101,7 +101,7 @@ rpcn_account_dialog::rpcn_account_dialog(QWidget* parent)
|
|||||||
QLabel* label_npid = new QLabel(tr("NPID (username):"));
|
QLabel* label_npid = new QLabel(tr("NPID (username):"));
|
||||||
m_edit_npid = new QLineEdit();
|
m_edit_npid = new QLineEdit();
|
||||||
m_edit_npid->setMaxLength(16);
|
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:"));
|
QLabel* label_pass = new QLabel(tr("Password:"));
|
||||||
QPushButton* btn_chg_pass = new QPushButton(tr("Set Password"));
|
QPushButton* btn_chg_pass = new QPushButton(tr("Set Password"));
|
||||||
QLabel* label_token = new QLabel(tr("Token:"));
|
QLabel* label_token = new QLabel(tr("Token:"));
|
||||||
@ -229,7 +229,7 @@ void rpcn_account_dialog::create_account()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QString email;
|
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)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -33,10 +33,10 @@ namespace
|
|||||||
|
|
||||||
[[maybe_unused]] inline std::string sstr(const QString& _in) { return _in.toStdString(); }
|
[[maybe_unused]] inline std::string sstr(const QString& _in) { return _in.toStdString(); }
|
||||||
|
|
||||||
QString FormatTimestamp(u64 time)
|
QString FormatTimestamp(s64 time)
|
||||||
{
|
{
|
||||||
QDateTime dateTime;
|
QDateTime dateTime;
|
||||||
dateTime.setTime_t(time);
|
dateTime.setSecsSinceEpoch(time);
|
||||||
return dateTime.toString("yyyy-MM-dd HH:mm:ss");
|
return dateTime.toString("yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -568,7 +568,7 @@ skylander_creator_dialog::skylander_creator_dialog(QWidget* parent)
|
|||||||
QLabel* label_var = new QLabel(tr("Variant:"));
|
QLabel* label_var = new QLabel(tr("Variant:"));
|
||||||
QLineEdit* edit_id = new QLineEdit("0");
|
QLineEdit* edit_id = new QLineEdit("0");
|
||||||
QLineEdit* edit_var = new QLineEdit("0");
|
QLineEdit* edit_var = new QLineEdit("0");
|
||||||
QRegExpValidator* rxv = new QRegExpValidator(QRegExp("\\d*"), this);
|
QRegularExpressionValidator* rxv = new QRegularExpressionValidator(QRegularExpression("\\d*"), this);
|
||||||
edit_id->setValidator(rxv);
|
edit_id->setValidator(rxv);
|
||||||
edit_var->setValidator(rxv);
|
edit_var->setValidator(rxv);
|
||||||
hbox_idvar->addWidget(label_id);
|
hbox_idvar->addWidget(label_id);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <QRegExpValidator>
|
#include <QRegularExpressionValidator>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
@ -250,7 +250,7 @@ bool user_manager_dialog::ValidateUsername(const QString& text_to_validate)
|
|||||||
{
|
{
|
||||||
// "Entire string (^...$) must be between 3 and 16 characters
|
// "Entire string (^...$) must be between 3 and 16 characters
|
||||||
// and only consist of letters, numbers, underscores, and hyphens."
|
// 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;
|
int pos = 0;
|
||||||
QString text = text_to_validate;
|
QString text = text_to_validate;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user