Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qInputDialog make visible unity taskbar and title bar in fullscreen applications
Forum Updated to NodeBB v4.3 + New Features

qInputDialog make visible unity taskbar and title bar in fullscreen applications

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 341 Views 2 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.
  • R Offline
    R Offline
    rokk
    wrote on last edited by
    #1

    I'm trying to ask for a password the user in order to access a particular section, my application is fullscreen. The problem is that when the qInputDialog appears also the unity taskbar and the application titlebar appears. I want to avoid this and keep my application fullscreen. I'm using Qt 5.12.3 on Ubuntu 16.04

    Take a look at this minimal example:

    main.cpp

    #include "mainwindow.h"
    #include <QApplication>
    
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.showFullScreen();
    
        return a.exec();
    }
    

    Mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    #include <QInputDialog>
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    void MainWindow::on_pushButton_clicked()
    {
        bool ok;
        QString text = QInputDialog::getText(this, tr("Restriscted"),
                                             tr("Password:"), QLineEdit::Password,"",&ok, Qt::FramelessWindowHint);
        if (ok && text=="pass")
        {
            ui->label->setText("ok");
        }
    }
    
    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      I never found a way to avoid that. At least not with XFCE windows manager.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        One alternative could be to implement your own input widget and use for example QStackedWidget to show it in place of your central widget when you need to login and once done, you switch back to your standard central widget.

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

        R 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          One alternative could be to implement your own input widget and use for example QStackedWidget to show it in place of your central widget when you need to login and once done, you switch back to your standard central widget.

          R Offline
          R Offline
          rokk
          wrote on last edited by
          #4

          @SGaist That's what I did in the end. thank you for the suggestion.

          1 Reply Last reply
          1

          • Login

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