Qt: use setAttribute(AA_DisableWindowContextHelpButton) instead of flags

probably needs Qt 5.10.1 to work propery
This commit is contained in:
Megamouse 2018-02-12 13:30:12 +01:00 committed by Ivan
parent ae7e275a9d
commit cf1c45dfe8
21 changed files with 2 additions and 25 deletions

View file

@ -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();

View file

@ -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);
}

View file

@ -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);

View file

@ -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..."));

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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());

View file

@ -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;

View file

@ -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));
@ -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);

View file

@ -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);

View file

@ -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();

View file

@ -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);

View file

@ -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

View file

@ -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)"));

View file

@ -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));

View file

@ -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);

View file

@ -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();

View file

@ -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);
}

View file

@ -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);