Qt5 on BeagleBone: windows have no title and border



  • Hardware: Beaglebone Black
    Linux: Linux 3.8 with opengl support
    Qt version : qt-everywhere-opensource-src-5.3.1

    Configure options: ./configure -release -force-debug-info -confirm-license -nomake tests -nomake examples -opensource -opengl es2 -device linux-beagleboard-g++ -device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -prefix /usr/qt5 -no-largefile -no-accessibility -no-openssl -no-pulseaudio -no-alsa -no-cups -no-pch -eglfs -directfb -linuxfb -no-xcb -make libs -I /home/tim/BB/archive/Graphics_SDK_5_01_01_01/include/OGLES2 -L /home/tim/BB/archive/Graphics_SDK_5_01_01_01/gfx_rel_es8.x -xplatform linux-beagleboard-g++ -skip webkit

    Configure result: http://paste.ubuntu.com/7857121/

    As result windows have no title bars and borders. I've tried to create simple app which shows message box and tried to use example from qtbase/widgets/mainwindows/application.

    Result:
    MessageBox: http://beta.hstor.org/files/7d6/d46/83a/7d6d4683a187483a98bdd095c5e649a3.jpg
    mainwindow app: http://beta.hstor.org/files/d8a/a6a/b34/d8aa6ab342e24ff29388c38344272de5.jpg

    I've tried different platforms (linuxfb, eglfs, minimal) and styles. Nothing helps.And only eglfs shows fullscreen app.
    Also, touchscreen works as Y coordinate is 3-5 mm lower, than it actually is. I should press touchscreen 3-5 mm under the button to press it.

    MessageBox and examples works good for Qt 4.8.

    How to fix this problems?



  • Hi;

    I have the same problem when I switch to Qt5.2.1. There is no problem when using Qt4.8.

    I have a custom hardware platform around Cortex-A8 and I'm suing 'linuxfb' as I don't use openGL.

    Any help would greatly be appreciated.



  • Hi;

    I have the same problem when I switch to Qt5.2.1. There is no problem when using Qt4.8.

    I have a custom hardware platform around Cortex-A8 and I'm suing 'linuxfb' as I don't use openGL.

    Any help would greatly be appreciated.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    With Qt 4.8 you had QWS which was doing the windowing and decoration. With Qt 5, if you want windowing you need to use e.g. wayland

    Hope it helps


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    With Qt 4.8 you had QWS which was doing the windowing and decoration. With Qt 5, if you want windowing you need to use e.g. wayland

    Hope it helps



  • Yes, like SGaist said, Qt 5 does not provide a built-in windowing system anymore. For most embedded projects this won't matter since they anyway use a custom UI better suited for these environments. Nonetheless, you can still implement your own window decorations, if you wish.

    Alternatively, you can use a real windowing system (although the available options may naturally be limited, depending on your platform), like Wayland or X11.

    That said, in general the best performing option is usually to go for Qt Quick with eglfs.



  • Yes, like SGaist said, Qt 5 does not provide a built-in windowing system anymore. For most embedded projects this won't matter since they anyway use a custom UI better suited for these environments. Nonetheless, you can still implement your own window decorations, if you wish.

    Alternatively, you can use a real windowing system (although the available options may naturally be limited, depending on your platform), like Wayland or X11.

    That said, in general the best performing option is usually to go for Qt Quick with eglfs.



  • I am using the same setup (BeagleBone Black with eglfs2, QT5.5) and found another solution that might work depending on how you want the title presented. In my case, the QT project is a customized touchscreen-only app that does need the classic window looking frame. I found out if I use QMessageBox::setText() it puts the text to the right of the icon. If I use QMessageBox::setInformativeText() it places the text in the center of the window as expected. QMessageBox::setWindowTitle() never shows up.
    So I wrote a derived class and overrode setWindowTitle() to call setText(). Made sure it was setup for Qt::AutoText so I could center and bold the title.
    I also overrode the static information, critical, question and alert methods so I wouldn't have to modify (too much) existing code written for qt 4.X.

    Source:

    MessageBox::MessageBox(QWidget *parent) : 
        QMessageBox(parent)
    {
        setTextFormat(Qt::AutoText);
    }
    
    
    MessageBox::~MessageBox()
    {
    }
    
    void MessageBox::setWindowTitle(QString titleStr)
    {
        setText("<center><b>" + titleStr + "</b></center>");
    }
    
    MessageBox::StandardButton MessageBox::messageBox(QWidget *parent, const QString &title,
             const QString &text, MessageBox::StandardButtons buttons, MessageBox::StandardButton defaultButton,
             QMessageBox::Icon icon)
    {
        MessageBox msgBox(parent);
        msgBox.setWindowTitle(title);
        msgBox.setInformativeText(text);
        msgBox.setIcon(icon);
        msgBox.setStandardButtons(buttons);
        msgBox.setDefaultButton(defaultButton);
        if (msgBox.exec() == -1)
            return QMessageBox::Cancel;
        return msgBox.standardButton(msgBox.clickedButton()); 
    }
    
    MessageBox::StandardButton MessageBox::information(QWidget *parent, const QString &title,
             const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
    {
        return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Information);
    }
    
    MessageBox::StandardButton MessageBox::question(QWidget *parent, const QString &title,
             const QString &text,MessageBox::StandardButtons buttons,MessageBox::StandardButton defaultButton)
    {
        return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Question);
    }
    
    MessageBox::StandardButton MessageBox::warning(QWidget *parent, const QString &title,
             const QString &text,MessageBox::StandardButtons buttons,MessageBox::StandardButton defaultButton)
    {
        return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Warning);
    }
    
    MessageBox::StandardButton MessageBox::critical(QWidget *parent, const QString &title,
             const QString &text,MessageBox::StandardButtons buttons,MessageBox::StandardButton defaultButton)
    {
        return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Critical);
    }
    

    Header:

    class MessageBox : public QMessageBox
    {
    public:
        MessageBox(QWidget *parent = NULL);
        ~MessageBox();
    
        void setWindowTitle(QString titleStr);
    
        static MessageBox::StandardButton information(QWidget *parent, const QString &title,
             const QString &text, MessageBox::StandardButtons buttons = Ok,
             MessageBox::StandardButton defaultButton = NoButton);
        static MessageBox::StandardButton question(QWidget *parent, const QString &title,
             const QString &text, MessageBox::StandardButtons buttons = MessageBox::StandardButtons(Yes | No),
             MessageBox::StandardButton defaultButton = NoButton);
        static MessageBox::StandardButton warning(QWidget *parent, const QString &title,
             const QString &text, MessageBox::StandardButtons buttons = Ok,
             MessageBox::StandardButton defaultButton = NoButton);
        static MessageBox::StandardButton critical(QWidget *parent, const QString &title,
             const QString &text, MessageBox::StandardButtons buttons = Ok,
             MessageBox::StandardButton defaultButton = NoButton);
    
    private:
         static MessageBox::StandardButton messageBox(QWidget *parent, const QString &title,
             const QString &text, MessageBox::StandardButtons buttons, MessageBox::StandardButton defaultButton,
             QMessageBox::Icon icon);
    };
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.