How to hide ubuntu title bar while opening new window on top of main window



  • I am building an app in which application window should be always fullscreen.Main window is fullscreen with no problem.But when I open a new window inside constructor of main window it shows top bar of Ubuntu which contain battery,wifi information etc.
    My Question is how to get rid of that title bar while popping up new QWidget.
    Here is link to screenshot:
    http://ibin.co/2S3nRGxEezwz
    This is code snippet:
    mpd.cpp // mainwindow class
    #include "mpd.h"
    #include "ui_mpd.h"
    #include "header.h"
    mpd::mpd(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::mpd)
    {
    ui->setupUi(this);
    select_route = new route_selection;
    select_route->setWindowFlags(Qt::Widget | Qt::FramelessWindowHint);
    select_route->show();
    }

    mpd::~mpd()
    {
    delete ui;
    }
    route_selection::route_selection(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::route_selection)
    {
    ui->setupUi(this);
    train_selection_keyboard = new keyboard(this);
    ui->stackedWidget->addWidget(train_selection_keyboard);
    ui->stackedWidget->setCurrentWidget(train_selection_keyboard);
    this->setGeometry(100,200,this->width(),this->height());
    this->setWindowFlags(Qt::FramelessWindowHint);


  • Qt Champions 2016

    hi
    if you give full screen as parent , does it still do this ?
    select_route = new route_selection;
    -->
    select_route = new route_selection(this);



  • I changed
    select_route = new route_selection(this);
    but still showing same behaviour.


  • Qt Champions 2016

    @guru007
    could you also try
    route_selection->setWindowFlags(Qt::WindowStaysOnTopHint);
    (for test)



  • Thanks @mrjj My problem is solved with setWindowFlags(Qt::WindowStaysOnTopHint);


  • Qt Champions 2016

    @guru007
    ok super so that keeps ubuntu from re-showing the status bar.
    Happy coding.


Log in to reply
 

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