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. QDialog
Qt 6.11 is out! See what's new in the release blog

QDialog

Scheduled Pinned Locked Moved General and Desktop
qdialog
9 Posts 3 Posters 3.3k 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.
  • Lays147L Offline
    Lays147L Offline
    Lays147
    wrote on last edited by
    #1

    Hi folks!
    I'm having a problem with QDialog.
    The title bar of my window does not appear the 'X' option to close it. But it is loaded in the center of the screen.
    But when I do this set:
    l-> setWindowFlags (Qt :: Window);
    The window does not carry more in the center of the screen, but 'X' appears.
    Have any option that carries it to the center?
    thanks

    Lays Rodrigues
    Newby on Qt - Learning always!
    Using QT 5.7
    ArchLinux

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

      Hi,

      How are you constructing your dialog ? Which version of Qt are you using ? On which OS ?

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

      Lays147L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        How are you constructing your dialog ? Which version of Qt are you using ? On which OS ?

        Lays147L Offline
        Lays147L Offline
        Lays147
        wrote on last edited by
        #3

        @SGaist
        Qt5.5, Debian 8.
        Ui Class, and calling like this:

             Loading *l=new Loading();
             //l->setParent(this,Qt::Window);
             l->show();
        

        Lays Rodrigues
        Newby on Qt - Learning always!
        Using QT 5.7
        ArchLinux

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

          So Loading is a subclass of QDialog ? Can you show its initialization ?

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

          Lays147L 1 Reply Last reply
          0
          • SGaistS SGaist

            So Loading is a subclass of QDialog ? Can you show its initialization ?

            Lays147L Offline
            Lays147L Offline
            Lays147
            wrote on last edited by
            #5

            @SGaist

            #include "loading.h"
            #include "ui_loading.h"
            #include "brprint3d.h"
            
            Loading::Loading(QWidget *parent) :
                QDialog(parent), ui(new Ui::Loading)
            {
            
                ui->setupUi(this);
            
            }
            
            Loading::~Loading()
            {
                delete ui;
            }
            //Ignore
            void Loading::on_pushButton_clicked()
            {
                this->close();
            }
            
            

            Lays Rodrigues
            Newby on Qt - Learning always!
            Using QT 5.7
            ArchLinux

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

              Did you do any special configuration in Designer for that widget ?

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

              Lays147L 1 Reply Last reply
              0
              • SGaistS SGaist

                Did you do any special configuration in Designer for that widget ?

                Lays147L Offline
                Lays147L Offline
                Lays147
                wrote on last edited by
                #7

                @SGaist No, i just write a text and set a pixmap.

                Lays Rodrigues
                Newby on Qt - Learning always!
                Using QT 5.7
                ArchLinux

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

                  What desktop environment are you using ?

                  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
                  • R Offline
                    R Offline
                    ReinaldoJr
                    wrote on last edited by
                    #9

                    Hi,

                    void Loading::showEvent(QShowEvent *event)
                    {
                      QDialog::showEvent(event);
                    
                      setGeometry(QStyle::alignedRect(Qt::LeftToRight,Qt::AlignCenter,size(),QApplication::desktop()->availableGeometry()));
                    }
                    
                    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