Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CornerButton example bug - error on touchscreen #3

Open
poltpolt opened this issue Aug 19, 2023 · 1 comment
Open

CornerButton example bug - error on touchscreen #3

poltpolt opened this issue Aug 19, 2023 · 1 comment

Comments

@poltpolt
Copy link

poltpolt commented Aug 19, 2023

When using a touchscreen all works fine if I pick any of the 2 actions added.

But if I open the BurgerMenu popup ,then decide that I don't want to choose any of the actions in the CornerButton so I click elsewhere in the app or click the CornerButton again to close the popup . Then touchscreen stops working in the app at all.

interestingly enough this mod I have made (being a beginner), works :

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    button = BurgerButton::addButtonToCorner(this);
    auto action = new QAction("About KDAB", this);
    this->addAction(action);

    action = new QAction("Help", this);
    this->addAction(action);
    contextMenu.addAction(action);
    connect(button,&BurgerButton::clicked,this, &MainWindow::myAction);
}

void MainWindow::myAction()
{
    qDebug()<<"myAction";
    QPoint globalPos = button->mapToGlobal(button->rect().bottomLeft());
    QAction* selectedAction = contextMenu.exec(globalPos);
}
@jesperkdab
Copy link

That is indeed peculiar. I'm doing nothing special in this code, besides calling:
setPopupMode(QToolButton::InstantPopup);

So my subspecies is that some state inside Qt isn't properly cleared when touching outside.

Feel free to use the example to file a bug with Qt.

Cheers
Jesper.

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

No branches or pull requests

2 participants