Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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

    Hi!

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

    dialogwidget.h

    signals:
        void WidgetClosed(bool);
    

    dialogwidget.cpp:

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

    mainwindow.h

    private:
        dialogwidget *usure = new dialogwidget(this);
    

    mainwindow.cpp

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

Log in to reply