Important: Please read the Qt Code of Conduct -

Touchscreen: QDialog with Qt::FramelessWindowHint faulty

  • OS: FriendlyDesktop with X Window (based on Ubuntu 18.04 64bit)
    Device: NanoPi NEO4
    Qt Version: 5.10.0


    I just want to use my QApplication with a touchscreen. My MainWindow is on fullscreen and works perfectly with around 10 different buttons.
    If I open a new QDialog with the Window Flag "Qt::FramelessWindowHint" the buttons on the QDialog are not working in at least 80% of all cases (not pressable, no highlighting,...). I enabled the cursor to see if the touchscreen works => works fine. I connected with VNC to press the button with a mouse => works fine.

    If I don't use "Qt::FramelessWindowHint" everything is working, too. The problem is, that the buttons on the titlebar have to be disabled! f.e.: If I press minimize, the QDialog goes into the background and I can't do anything on the MainWindow anymore, which is kind of a bottleneck, because then I can't even shutdown the device with just the touchscreen ...
    I found no working solution to disable the buttons in the titlebar for linux. Either the entire title bar is deactivated or nothing at all...

    I think my application isn't out of ordinary so there has to be a solution.

    Thank you!

  • Update: It looks like the buttons on the QDialog are just moved sometimes...annoying

    This happend just with "Qt::FramelessWindowHint"!

  • Update: Now I just use a QWidget instead of a QDialog and everything is working fine...


        void WidgetClosed(bool);


    void deletewindowusurewidget::on_btnabort_clicked()
        emit WidgetClosed(false);
    void deletewindowusurewidget::on_btnok_clicked()
        emit WidgetClosed(true);


        dialogwidget *usure = new dialogwidget(this);


        connect(usure, SIGNAL(WidgetClosed(bool)), this, SLOT(dialogwidgetclosed(bool)));
        //start dialog
        usure->setWindowFlags(Qt::Tool | Qt::Dialog | Qt::FramelessWindowHint);
        usure->move(this->rect().center() - usure->rect().center());
        //finished signal
        void MainWindow::deletewindowusureclosed(bool deleteall)
                 //btnok pressed
                 //btnabort pressed

Log in to reply