QDialog , title and frame are not set on embedding system
-
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. -
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.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. -
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.@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.
-
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. -
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) ?
Wayland provides the backend. You can then use the QtWayland module to use that backend.
Did you already read Wayland and Qt ?