Skip to content

Conversation

@lucydodo
Copy link
Member

This patch fixes issue #2434.

QAction* viewMenuPragmas = nullptr;

    // Add entries for toggling the visibility of main tabs
    for (QWidget* widget : {ui->structure, ui->browser, ui->pragmas, ui->query}) {
        QAction* action = ui->viewMenu->addAction(QIcon(":/icons/open_sql"), widget->accessibleName());
        action->setCheckable(true);
        // A few lines below are hidden because they are not needed for the review process.

        if (widget == ui->pragmas)
            viewMenuPragmas = action;
    }

I think it would be good to send the 'QTabWidget::tabCloseRequested' signal to the 'Edit Pragmas' tab for the above code, but after a few days of searching and finding out, I can't seem to do that. Therefore, when QAction is initalized, I modified the code to create and access a pointer variable pointing to QAction for 'Edit Pragmas'.

@mgrojo Please review the code if you possible. Thanks! 😄

@lucydodo lucydodo requested a review from mgrojo October 12, 2020 12:58
@lucydodo lucydodo self-assigned this Oct 12, 2020
@lucydodo lucydodo linked an issue Oct 12, 2020 that may be closed by this pull request
9 tasks
Copy link
Member

@mgrojo mgrojo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Take a look to these comments before merging.

@lucydodo
Copy link
Member Author

@mgrojo Thanks for the advice and reviews. I just modified and committed it. Since the existing viewMenuParams is a one-time variable, so accessed by findChild when necessary for conserve memory. 😄

@mgrojo mgrojo merged commit 9433601 into sqlitebrowser:master Oct 14, 2020
@mgrojo
Copy link
Member

mgrojo commented Oct 14, 2020

Perfect. The object name could be useful in the future to manipulate these actions.

@lucydodo lucydodo deleted the dev branch October 29, 2020 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Window Layout option does not work properly

2 participants