build: Fix compiling citra-qt for iOS. (#6983)
* build: Fix compiling citra-qt for iOS. * Update src/citra_qt/configuration/configure_general.cpp Co-authored-by: Tobias <thm.frey@gmail.com> --------- Co-authored-by: Tobias <thm.frey@gmail.com>
This commit is contained in:
@@ -292,7 +292,11 @@ public:
|
||||
if (GetWindowSystemType() == Frontend::WindowSystemType::Wayland) {
|
||||
setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
windowHandle()->setSurfaceType(QWindow::MetalSurface);
|
||||
#else
|
||||
windowHandle()->setSurfaceType(QWindow::VulkanSurface);
|
||||
#endif
|
||||
}
|
||||
|
||||
QPaintEngine* paintEngine() const override {
|
||||
|
@@ -31,7 +31,8 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
||||
|
||||
// Set a minimum width for the label to prevent the slider from changing size.
|
||||
// This scales across DPIs, and is acceptable for uncapitalized strings.
|
||||
ui->emulation_speed_display_label->setMinimumWidth(tr("unthrottled").size() * 6);
|
||||
const auto width = static_cast<int>(tr("unthrottled").size() * 6);
|
||||
ui->emulation_speed_display_label->setMinimumWidth(width);
|
||||
ui->emulation_speed_combo->setVisible(!Settings::IsConfiguringGlobal());
|
||||
ui->screenshot_combo->setVisible(!Settings::IsConfiguringGlobal());
|
||||
ui->updateBox->setVisible(UISettings::values.updater_found);
|
||||
|
@@ -285,12 +285,12 @@ void ConfigureSystem::SetConfiguration() {
|
||||
date_time.setSecsSinceEpoch(Settings::values.init_time.GetValue());
|
||||
ui->edit_init_time->setDateTime(date_time);
|
||||
|
||||
long long init_time_offset = Settings::values.init_time_offset.GetValue();
|
||||
long long days_offset = init_time_offset / 86400;
|
||||
s64 init_time_offset = Settings::values.init_time_offset.GetValue();
|
||||
int days_offset = static_cast<int>(init_time_offset / 86400);
|
||||
ui->edit_init_time_offset_days->setValue(days_offset);
|
||||
|
||||
unsigned long long time_offset = std::abs(init_time_offset) - std::abs(days_offset * 86400);
|
||||
QTime time = QTime::fromMSecsSinceStartOfDay(time_offset * 1000);
|
||||
u64 time_offset = std::abs(init_time_offset) - std::abs(days_offset * 86400);
|
||||
QTime time = QTime::fromMSecsSinceStartOfDay(static_cast<int>(time_offset * 1000));
|
||||
ui->edit_init_time_offset_time->setTime(time);
|
||||
|
||||
if (!enabled) {
|
||||
|
@@ -180,9 +180,10 @@ void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size
|
||||
}
|
||||
const auto eta_mseconds = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
rolling_average * (total - value));
|
||||
const auto limited_mseconds = std::max<long>(eta_mseconds.count(), 1000);
|
||||
estimate = tr("Estimated Time %1")
|
||||
.arg(QTime(0, 0, 0, 0)
|
||||
.addMSecs(std::max<long>(eta_mseconds.count(), 1000))
|
||||
.addMSecs(static_cast<int>(limited_mseconds))
|
||||
.toString(QStringLiteral("mm:ss")));
|
||||
}
|
||||
|
||||
|
@@ -125,8 +125,8 @@ void MoviePlayDialog::UpdateUIDisplay() {
|
||||
} else {
|
||||
const u64 msecs = Service::HID::Module::pad_update_ticks * metadata.input_count * 1000 /
|
||||
BASE_CLOCK_RATE_ARM11;
|
||||
ui->lengthLineEdit->setText(
|
||||
QTime::fromMSecsSinceStartOfDay(msecs).toString(QStringLiteral("hh:mm:ss.zzz")));
|
||||
ui->lengthLineEdit->setText(QTime::fromMSecsSinceStartOfDay(static_cast<int>(msecs))
|
||||
.toString(QStringLiteral("hh:mm:ss.zzz")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -284,7 +284,7 @@ bool LobbyFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& s
|
||||
// filter by empty rooms
|
||||
if (filter_empty) {
|
||||
QModelIndex member_list = sourceModel()->index(sourceRow, Column::MEMBER, sourceParent);
|
||||
const int player_count =
|
||||
const qsizetype player_count =
|
||||
sourceModel()->data(member_list, LobbyItemMemberList::MemberListRole).toList().size();
|
||||
if (player_count == 0) {
|
||||
return false;
|
||||
@@ -294,7 +294,7 @@ bool LobbyFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& s
|
||||
// filter by filled rooms
|
||||
if (filter_full) {
|
||||
QModelIndex member_list = sourceModel()->index(sourceRow, Column::MEMBER, sourceParent);
|
||||
const int player_count =
|
||||
const qsizetype player_count =
|
||||
sourceModel()->data(member_list, LobbyItemMemberList::MemberListRole).toList().size();
|
||||
const int max_players =
|
||||
sourceModel()->data(member_list, LobbyItemMemberList::MaxPlayerRole).toInt();
|
||||
|
@@ -198,8 +198,8 @@ public:
|
||||
|
||||
bool operator<(const QStandardItem& other) const override {
|
||||
// sort by rooms that have the most players
|
||||
int left_members = data(MemberListRole).toList().size();
|
||||
int right_members = other.data(MemberListRole).toList().size();
|
||||
qsizetype left_members = data(MemberListRole).toList().size();
|
||||
qsizetype right_members = other.data(MemberListRole).toList().size();
|
||||
return left_members < right_members;
|
||||
}
|
||||
};
|
||||
|
@@ -194,7 +194,7 @@ QString CSpinBox::TextFromValue() {
|
||||
}
|
||||
|
||||
qint64 CSpinBox::ValueFromText() {
|
||||
unsigned strpos = prefix.length();
|
||||
qsizetype strpos = prefix.length();
|
||||
|
||||
QString num_string = text().mid(strpos, text().length() - strpos - suffix.length());
|
||||
return num_string.toLongLong(nullptr, base);
|
||||
@@ -216,7 +216,7 @@ QValidator::State CSpinBox::validate(QString& input, int& pos) const {
|
||||
if (!prefix.isEmpty() && input.left(prefix.length()) != prefix)
|
||||
return QValidator::Invalid;
|
||||
|
||||
int strpos = prefix.length();
|
||||
qsizetype strpos = prefix.length();
|
||||
|
||||
// Empty "numbers" allowed as intermediate values
|
||||
if (strpos >= input.length() - HasSign() - suffix.length())
|
||||
@@ -245,7 +245,7 @@ QValidator::State CSpinBox::validate(QString& input, int& pos) const {
|
||||
|
||||
// Match string
|
||||
QRegularExpression num_regexp(QRegularExpression::anchoredPattern(regexp));
|
||||
int num_pos = strpos;
|
||||
qsizetype num_pos = strpos;
|
||||
QString sub_input = input.mid(strpos, input.length() - strpos - suffix.length());
|
||||
|
||||
auto match = num_regexp.match(sub_input);
|
||||
|
Reference in New Issue
Block a user