Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Touchscreen: QDialog with Qt::FramelessWindowHint faulty
Forum Updated to NodeBB v4.3 + New Features

Touchscreen: QDialog with Qt::FramelessWindowHint faulty

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 1 Posters 874 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Error404
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Error404
      wrote on last edited by
      #2

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

      This happend just with "Qt::FramelessWindowHint"!

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Error404
        wrote on last edited by
        #3

        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
                 }
        
            }
        
        
        
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved