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. QDialog , title and frame are not set on embedding system
Forum Updated to NodeBB v4.3 + New Features

QDialog , title and frame are not set on embedding system

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 2 Posters 699 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    loup49
    wrote on last edited by
    #1

    Hello everyone

    I'm having hard times with QT Dialog on an embedded System. Apparently QT 5.15 have been loaded on the board , everything seems to work fine.

    The problem that i'm experiencing is quite strange. I'm able to create QDialog objects , even inherit from QDialog object but i'm unable to set windows Title.

    At first , i searched on google and i found that this code should generate a QDialog Modal with a title

    // hpp
    #ifndef QDIALOGBIDON_HPP
    #define QDIALOGBIDON_HPP

    #include <QDialog>
    #include <QPushButton>
    #include <QHBoxLayout>

    class QDialogBidon : public QDialog
    {
    Q_OBJECT
    public:
    explicit QDialogBidon(QWidget parent = nullptr);
    private:
    QHBoxLayout
    layout;
    };

    #endif // QDIALOGBIDON_HPP

    // cpp

    #include "qdialogbidon.hpp"
    #include <QTime>

    QDialogBidon::QDialogBidon(QWidget *parent) : QDialog(parent)
    {
    setWindowTitle("je suis une fleur");

    layout = new QHBoxLayout(this);
    
    for(int i = 0; i < 3; i++) {
        QPushButton* button = new QPushButton(QString::number(QTime::currentTime().msec()), this);
        layout->addWidget(button);
    }
    
    setLayout(layout);
    

    }

    // the call of the QDialog

    QDialogBidon *bidon = new QDialogBidon(this) ;
    bidon->setWindowFlags(Qt::Window | Qt::WindowTitleHint );
    bidon->setWindowTitle(" je suis le titre ");
    bidon->show();

    /****************************/

    I also tried to call a basic QDialog without using inheritance like this

    QDialog dialog;
    dialog.setWindowFlags(dialog.windowFlags() & ~Qt::FramelessWindowHint  | Qt::CustomizeWindowHint );
    // dialog.setWindowFlags(dialog.windowFlags() | Qt::CustomizeWindowHint);
    dialog.setWindowTitle("je suis le titre de la modale");
    QVBoxLayout layout(&dialog);
    QLabel label("Contenu de la modale", &dialog);
    layout.addWidget(&label);
    dialog.setLayout(&layout);
    dialog.exec();
    

    Again ,in both case (inherited and normal QDialog call) , i only have the content
    of the QDialog that is shown. But i've never been able to print the damned title , and frame of the QDialog.

    After this , i tried to look to the main.cpp file , i've searched for styles inside , i removed them , and still had
    the problem of no frame and no title. I tried every combination possible of flag , and always the same result.

    I precised that this embedded system is pretty large , so it's possible that the QApplication style had been overwritten
    but i cannot see where and how. Any Help would be appreciated. I'm ready to add further explanations of my problem but i didn't want this first post to be to big and overwhelming. Any help would be appreciated.

    SGaistS 1 Reply Last reply
    0
    • L loup49

      Hello everyone

      I'm having hard times with QT Dialog on an embedded System. Apparently QT 5.15 have been loaded on the board , everything seems to work fine.

      The problem that i'm experiencing is quite strange. I'm able to create QDialog objects , even inherit from QDialog object but i'm unable to set windows Title.

      At first , i searched on google and i found that this code should generate a QDialog Modal with a title

      // hpp
      #ifndef QDIALOGBIDON_HPP
      #define QDIALOGBIDON_HPP

      #include <QDialog>
      #include <QPushButton>
      #include <QHBoxLayout>

      class QDialogBidon : public QDialog
      {
      Q_OBJECT
      public:
      explicit QDialogBidon(QWidget parent = nullptr);
      private:
      QHBoxLayout
      layout;
      };

      #endif // QDIALOGBIDON_HPP

      // cpp

      #include "qdialogbidon.hpp"
      #include <QTime>

      QDialogBidon::QDialogBidon(QWidget *parent) : QDialog(parent)
      {
      setWindowTitle("je suis une fleur");

      layout = new QHBoxLayout(this);
      
      for(int i = 0; i < 3; i++) {
          QPushButton* button = new QPushButton(QString::number(QTime::currentTime().msec()), this);
          layout->addWidget(button);
      }
      
      setLayout(layout);
      

      }

      // the call of the QDialog

      QDialogBidon *bidon = new QDialogBidon(this) ;
      bidon->setWindowFlags(Qt::Window | Qt::WindowTitleHint );
      bidon->setWindowTitle(" je suis le titre ");
      bidon->show();

      /****************************/

      I also tried to call a basic QDialog without using inheritance like this

      QDialog dialog;
      dialog.setWindowFlags(dialog.windowFlags() & ~Qt::FramelessWindowHint  | Qt::CustomizeWindowHint );
      // dialog.setWindowFlags(dialog.windowFlags() | Qt::CustomizeWindowHint);
      dialog.setWindowTitle("je suis le titre de la modale");
      QVBoxLayout layout(&dialog);
      QLabel label("Contenu de la modale", &dialog);
      layout.addWidget(&label);
      dialog.setLayout(&layout);
      dialog.exec();
      

      Again ,in both case (inherited and normal QDialog call) , i only have the content
      of the QDialog that is shown. But i've never been able to print the damned title , and frame of the QDialog.

      After this , i tried to look to the main.cpp file , i've searched for styles inside , i removed them , and still had
      the problem of no frame and no title. I tried every combination possible of flag , and always the same result.

      I precised that this embedded system is pretty large , so it's possible that the QApplication style had been overwritten
      but i cannot see where and how. Any Help would be appreciated. I'm ready to add further explanations of my problem but i didn't want this first post to be to big and overwhelming. Any help would be appreciated.

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Which backend are you using on that device ?
      Unless it's Wayland, they don't have any window manager so there's no window decoration.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 2 Replies Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Which backend are you using on that device ?
        Unless it's Wayland, they don't have any window manager so there's no window decoration.

        L Offline
        L Offline
        loup49
        wrote on last edited by loup49
        #3

        @SGaist Hello

        I know that the plugin used is LinuxFB . There was no Wayland on the embedded system , so i think you're right. I'm trying to add Wayland to the compile chain , and i will notify you if it works. Thanks for your quick response ! I will post the solution if it works.

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Which backend are you using on that device ?
          Unless it's Wayland, they don't have any window manager so there's no window decoration.

          L Offline
          L Offline
          loup49
          wrote on last edited by loup49
          #4

          @SGaist

          I've installed Wayland , but i really don't know how to add Window Manager , could you provide a documentation that tells how to do that on LinuxFB ? Or is Wayland handle window managment (i've red the doc , but i'm still confused) ?

          SGaistS 1 Reply Last reply
          0
          • L loup49

            @SGaist

            I've installed Wayland , but i really don't know how to add Window Manager , could you provide a documentation that tells how to do that on LinuxFB ? Or is Wayland handle window managment (i've red the doc , but i'm still confused) ?

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Wayland provides the backend. You can then use the QtWayland module to use that backend.

            Did you already read Wayland and Qt ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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