Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QDialog

    General and Desktop
    qdialog
    3
    9
    2703
    Loading More Posts
    • 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.
    • Lays147
      Lays147 last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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

        Lays147 1 Reply Last reply Reply Quote 0
        • Lays147
          Lays147 @SGaist last edited by

          @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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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

            Lays147 1 Reply Last reply Reply Quote 0
            • Lays147
              Lays147 @SGaist last edited by

              @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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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

                Lays147 1 Reply Last reply Reply Quote 0
                • Lays147
                  Lays147 @SGaist last edited by

                  @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 Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    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 Reply Quote 0
                    • R
                      ReinaldoJr last edited by

                      Hi,

                      void Loading::showEvent(QShowEvent *event)
                      {
                        QDialog::showEvent(event);
                      
                        setGeometry(QStyle::alignedRect(Qt::LeftToRight,Qt::AlignCenter,size(),QApplication::desktop()->availableGeometry()));
                      }
                      
                      1 Reply Last reply Reply Quote 1
                      • First post
                        Last post