Qt warnings cleanup

This commit is contained in:
msuih 2019-08-10 14:24:14 +03:00 committed by Megamouse
parent f051f53e15
commit 8150095e8f
8 changed files with 26 additions and 18 deletions

View file

@ -70,8 +70,8 @@ void breakpoint_list::AddBreakpoint(u32 pc)
breakpointItemText.remove(10, 13);
QListWidgetItem* breakpointItem = new QListWidgetItem(breakpointItemText);
breakpointItem->setTextColor(m_text_color_bp);
breakpointItem->setBackgroundColor(m_color_bp);
breakpointItem->setForeground(m_text_color_bp);
breakpointItem->setBackground(m_color_bp);
QVariant pcVariant;
pcVariant.setValue(pc);
breakpointItem->setData(Qt::UserRole, pcVariant);

View file

@ -92,18 +92,18 @@ void debugger_list::ShowAddress(u32 addr)
if (cpu->is_paused() && m_pc == GetPc())
{
item(i)->setTextColor(m_text_color_pc);
item(i)->setBackgroundColor(m_color_pc);
item(i)->setForeground(m_text_color_pc);
item(i)->setBackground(m_color_pc);
}
else if (IsBreakpoint(m_pc))
{
item(i)->setTextColor(m_text_color_bp);
item(i)->setBackgroundColor(m_color_bp);
item(i)->setForeground(m_text_color_bp);
item(i)->setBackground(m_color_bp);
}
else
{
item(i)->setTextColor(palette().color(foregroundRole()));
item(i)->setBackgroundColor(palette().color(backgroundRole()));
item(i)->setForeground(palette().color(foregroundRole()));
item(i)->setBackground(palette().color(backgroundRole()));
}
}
}

View file

@ -35,6 +35,8 @@
#include <thread>
#include <QScreen>
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/Memory/vm.h"
@ -1593,7 +1595,7 @@ void main_window::ConfigureGuiFromSettings(bool configure_all)
{
// By default, set the window to 70% of the screen and the debugger frame is hidden.
m_debuggerFrame->hide();
resize(QDesktopWidget().availableGeometry().size() * 0.7);
resize(QGuiApplication::primaryScreen()->availableSize() * 0.7);
}
restoreState(guiSettings->GetValue(gui::mw_windowState).toByteArray());

View file

@ -8,6 +8,7 @@
#include <QMenu>
#include <QDesktopWidget>
#include <QApplication>
#include <QScreen>
constexpr auto qstr = QString::fromStdString;
@ -225,7 +226,7 @@ void save_data_list_dialog::UpdateList()
QSize preferredSize = minimumSize().expandedTo(sizeHint() - m_list->sizeHint() + tableSize);
QSize maxSize = QSize(preferredSize.width(), static_cast<int>(QApplication::desktop()->screenGeometry().height()*.6));
QSize maxSize = QSize(preferredSize.width(), static_cast<int>(QGuiApplication::primaryScreen()->geometry().height() * 0.6));
resize(preferredSize.boundedTo(maxSize));
}

View file

@ -19,6 +19,7 @@
#include <QUrl>
#include <QDesktopServices>
#include <QPainter>
#include <QScreen>
namespace
{
@ -181,7 +182,7 @@ void save_manager_dialog::Init(std::string dir)
m_list->sortByColumn(1, Qt::AscendingOrder);
if (restoreGeometry(m_gui_settings->GetValue(gui::sd_geometry).toByteArray()))
resize(size().expandedTo(QDesktopWidget().availableGeometry().size() * 0.5));
resize(size().expandedTo(QGuiApplication::primaryScreen()->availableSize() * 0.5));
// Connects and events
connect(push_close, &QAbstractButton::clicked, this, &save_manager_dialog::close);
@ -296,7 +297,7 @@ void save_manager_dialog::UpdateList()
QSize preferredSize = minimumSize().expandedTo(sizeHint() - m_list->sizeHint() + tableSize);
QSize maxSize = QSize(preferredSize.width(), static_cast<int>(QApplication::desktop()->screenGeometry().height()*.6));
QSize maxSize = QSize(preferredSize.width(), static_cast<int>(QGuiApplication::primaryScreen()->geometry().height() * 0.6));
resize(preferredSize.boundedTo(maxSize));
}
@ -395,7 +396,7 @@ void save_manager_dialog::OnEntriesRemove()
if (QMessageBox::question(this, tr("Delete Confirmation"), tr("Are you sure you want to delete these %1 items?").arg(selection.size()), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
{
qSort(selection.begin(), selection.end(), qGreater<QModelIndex>());
std::sort(selection.rbegin(), selection.rend());
for (QModelIndex index : selection)
{
QTableWidgetItem* item = m_list->item(index.row(), 1);

View file

@ -12,6 +12,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QTimer>
#include <QScreen>
#include "qt_utils.h"
#include "settings_dialog.h"
@ -1173,7 +1174,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std:
ui->gs_width->setEnabled(enableButtons);
ui->gs_height->setEnabled(enableButtons);
QRect screen = QApplication::desktop()->screenGeometry();
QRect screen = QGuiApplication::primaryScreen()->geometry();
int width = xgui_settings->GetValue(gui::gs_width).toInt();
int height = xgui_settings->GetValue(gui::gs_height).toInt();
ui->gs_width->setValue(std::min(width, screen.width()));
@ -1187,12 +1188,12 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std:
});
connect(ui->gs_width, &QSpinBox::editingFinished, [=]()
{
ui->gs_width->setValue(std::min(ui->gs_width->value(), QApplication::desktop()->screenGeometry().width()));
ui->gs_width->setValue(std::min(ui->gs_width->value(), QGuiApplication::primaryScreen()->size().width()));
xgui_settings->SetValue(gui::gs_width, ui->gs_width->value());
});
connect(ui->gs_height, &QSpinBox::editingFinished, [=]()
{
ui->gs_height->setValue(std::min(ui->gs_height->value(), QApplication::desktop()->screenGeometry().height()));
ui->gs_height->setValue(std::min(ui->gs_height->value(), QGuiApplication::primaryScreen()->size().height()));
xgui_settings->SetValue(gui::gs_height, ui->gs_height->value());
});
}

View file

@ -30,6 +30,8 @@
#include <QScrollBar>
#include <QWheelEvent>
#include <QProgressDialog>
#include <QGuiApplication>
#include <QScreen>
namespace
{
@ -431,7 +433,7 @@ void trophy_manager_dialog::RepaintUI(bool restore_layout)
if (restore_layout && !restoreGeometry(m_gui_settings->GetValue(gui::tr_geometry).toByteArray()))
{
resize(QDesktopWidget().availableGeometry().size() * 0.7);
resize(QGuiApplication::primaryScreen()->availableSize() * 0.7);
}
if (restore_layout && !m_splitter->restoreState(m_gui_settings->GetValue(gui::tr_splitterState).toByteArray()))

View file

@ -6,6 +6,7 @@
#include <QRegExpValidator>
#include <QInputDialog>
#include <QScreen>
namespace
{
@ -209,7 +210,7 @@ void user_manager_dialog::UpdateTable(bool mark_only)
m_table->horizontalHeader()->height() + m_table->verticalHeader()->length() + m_table->frameWidth() * 2);
QSize preferred_size = minimumSize().expandedTo(sizeHint() - m_table->sizeHint() + table_size).expandedTo(size());
QSize max_size = QSize(preferred_size.width(), static_cast<int>(QApplication::desktop()->screenGeometry().height()*.6));
QSize max_size = QSize(preferred_size.width(), static_cast<int>(QGuiApplication::primaryScreen()->size().height() * 0.6));
resize(preferred_size.boundedTo(max_size));
}