Skip to content

Commit

Permalink
Qt: use setAttribute(AA_DisableWindowContextHelpButton) instead of flags
Browse files Browse the repository at this point in the history
probably needs Qt 5.10.1 to work propery
  • Loading branch information
Megamouse authored and Nekotekina committed Feb 21, 2018
1 parent ae7e275 commit cf1c45d
Show file tree
Hide file tree
Showing 21 changed files with 2 additions and 25 deletions.
1 change: 1 addition & 0 deletions rpcs3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ int main(int argc, char** argv)
#endif

QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);

s_init.post();
s_qt_mutex.wait();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/about_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_
connect(ui->patreon, &QAbstractButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.patreon.com/Nekotekina")); });
connect(ui->close, &QAbstractButton::clicked, this, &QWidget::close);

setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
layout()->setSizeConstraint(QLayout::SetFixedSize);
}

Expand Down
2 changes: 0 additions & 2 deletions rpcs3/rpcs3qt/auto_pause_settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ constexpr auto qstr = QString::fromStdString;

auto_pause_settings_dialog::auto_pause_settings_dialog(QWidget *parent) : QDialog(parent)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

QLabel *description = new QLabel(tr("To use auto pause: enter the ID(s) of a function or a system call.\nRestart of the game is required to apply. You can enable/disable this in the settings."), this);

pauseList = new QTableWidget(this);
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/find_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
find_dialog::find_dialog(QTextEdit* edit, QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), m_text_edit(edit)
{
setWindowTitle(tr("Find string"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

m_find_bar = new QLineEdit();
m_find_bar->setPlaceholderText(tr("Search..."));
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/gamepads_settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ gamepads_settings_dialog::gamepads_settings_dialog(QWidget* parent)
json_file.open(QIODevice::ReadOnly | QIODevice::Text);
QJsonObject json_input = QJsonDocument::fromJson(json_file.readAll()).object().value("input").toObject();
json_file.close();
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

QVBoxLayout *dialog_layout = new QVBoxLayout();
QHBoxLayout *all_players = new QHBoxLayout();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/gui_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ void gui_settings::ShowInfoBox(const gui_save& entry, const QString& title, cons
{
QCheckBox* cb = new QCheckBox(tr("Don't show again"));
QMessageBox* mb = new QMessageBox(QMessageBox::Information, title, text, QMessageBox::Ok, parent);
mb->setWindowFlags(mb->windowFlags() & ~Qt::WindowContextHelpButtonHint);
mb->setCheckBox(cb);
mb->deleteLater();
mb->exec();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/instruction_editor_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ instruction_editor_dialog::instruction_editor_dialog(QWidget *parent, u32 _pc, c
{
setWindowTitle(tr("Edit instruction"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setMinimumSize(300, sizeHint().height());

const auto cpu = _cpu.get();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/kernel_explorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ kernel_explorer::kernel_explorer(QWidget* parent) : QDialog(parent)
setWindowTitle(tr("Kernel Explorer"));
setObjectName("kernel_explorer");
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setMinimumSize(QSize(700, 450));

QVBoxLayout* vbox_panel = new QVBoxLayout();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/memory_string_searcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ memory_string_searcher::memory_string_searcher(QWidget* parent)
{
setWindowTitle(tr("String Searcher"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

m_addr_line = new QLineEdit(this);
m_addr_line->setFixedWidth(QLabel("This is the very length of the lineedit due to hidpi reasons.").sizeHint().width());
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/memory_viewer_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ memory_viewer_panel::memory_viewer_panel(QWidget* parent)
setWindowTitle(tr("Memory Viewer"));
setObjectName("memory_viewer");
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
exit = false;
m_addr = 0;
m_colcount = 16;
Expand Down
2 changes: 0 additions & 2 deletions rpcs3/rpcs3qt/msg_dialog_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void msg_dialog_frame::Create(const std::string& msg)

m_dialog = new custom_dialog(type.disable_cancel);
m_dialog->setWindowTitle(type.se_normal ? "Normal dialog" : "Error dialog");
m_dialog->setWindowFlags(m_dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_dialog->setWindowOpacity(type.bg_invisible ? 1. : 0.75);

m_text = new QLabel(qstr(msg));
Expand Down Expand Up @@ -246,7 +245,6 @@ void msg_dialog_frame::CreateOsk(const std::string& msg, char16_t* osk_text, u32

//Title
m_osk_dialog->setWindowTitle(qstr(msg));
m_osk_dialog->setWindowFlags(m_osk_dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);

//Text Input
QLineEdit* input = new QLineEdit(m_osk_dialog);
Expand Down
2 changes: 0 additions & 2 deletions rpcs3/rpcs3qt/pad_settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ pad_settings_dialog::pad_settings_dialog(const std::string& device, const std::s
{
ui->setupUi(this);

setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

ui->b_cancel->setDefault(true);
connect(ui->b_cancel, &QAbstractButton::clicked, this, &QWidget::close);

Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/register_editor_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ register_editor_dialog::register_editor_dialog(QWidget *parent, u32 _pc, const s
{
setWindowTitle(tr("Edit registers"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

QVBoxLayout* vbox_panel = new QVBoxLayout();
QHBoxLayout* hbox_panel = new QHBoxLayout();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/rsx_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ rsx_debugger::rsx_debugger(QWidget* parent)
{
setWindowTitle(tr("RSX Debugger"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

//Fonts and Colors
QFont mono = QFontDatabase::systemFont(QFontDatabase::FixedFont);
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/save_data_info_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ constexpr auto qstr = QString::fromStdString;
save_data_info_dialog::save_data_info_dialog(const SaveDataEntry& save, QWidget* parent)
: QDialog(parent), m_entry(save)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Save Data Information"));

// Table
Expand Down
2 changes: 0 additions & 2 deletions rpcs3/rpcs3qt/save_data_list_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ constexpr auto qstr = QString::fromStdString;
save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& entries, s32 focusedEntry, u32 op, vm::ptr<CellSaveDataListSet> listSet, QWidget* parent)
: QDialog(parent), m_save_entries(entries), m_entry(selection_code::new_save), m_entry_label(nullptr)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

if (op >= 8)
{
setWindowTitle(tr("Save Data Interface (Delete)"));
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/save_manager_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ namespace
save_manager_dialog::save_manager_dialog(std::shared_ptr<gui_settings> gui_settings, std::string dir, QWidget* parent)
: QDialog(parent), m_save_entries(), m_dir(dir), m_sort_column(1), m_sort_ascending(true), m_gui_settings(gui_settings)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Save Manager"));
setMinimumSize(QSize(400, 400));

Expand Down
2 changes: 0 additions & 2 deletions rpcs3/rpcs3qt/settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ inline std::string sstr(const QVariant& _in) { return sstr(_in.toString()); }
settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std::shared_ptr<emu_settings> emuSettings, const int& tabIndex, QWidget *parent, const GameInfo* game)
: QDialog(parent), xgui_settings(guiSettings), xemu_settings(emuSettings), ui(new Ui::settings_dialog), m_tab_Index(tabIndex)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

ui->setupUi(this);
ui->cancelButton->setFocus();
ui->tabWidget->setUsesScrollButtons(false);
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/trophy_manager_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ trophy_manager_dialog::trophy_manager_dialog(std::shared_ptr<gui_settings> gui_s
: QWidget(), m_sort_column(0), m_col_sort_order(Qt::AscendingOrder), m_gui_settings(gui_settings)
{
// Nonspecific widget settings
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Trophy Manager"));

m_icon_height = m_gui_settings->GetValue(gui::tr_icon_height).toInt();
Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/vfs_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,4 @@ vfs_dialog::vfs_dialog(std::shared_ptr<gui_settings> guiSettings, std::shared_pt

setLayout(vbox);
setWindowTitle(tr("Virtual File System"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}
2 changes: 1 addition & 1 deletion rpcs3/rpcs3qt/welcome_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ welcome_dialog::welcome_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::we
{
ui->setupUi(this);

setWindowFlags(windowFlags() & Qt::WindowTitleHint & ~Qt::WindowContextHelpButtonHint);
setWindowFlags(windowFlags() & Qt::WindowTitleHint);

gui_settings* settings = new gui_settings(this);

Expand Down

0 comments on commit cf1c45d

Please sign in to comment.