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. Qt 5.14.1 on Linux,Dialog Close Card

Qt 5.14.1 on Linux,Dialog Close Card

Scheduled Pinned Locked Moved Unsolved General and Desktop
linux
6 Posts 2 Posters 632 Views
  • 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.
  • J Offline
    J Offline
    jack reemoon
    wrote on last edited by
    #1

    Dialog calls the close function when the button is pressed, and it will be stuck for 2 or 3 seconds, but the built-in close button in the upper right corner will not get stuck. The more controls on the form, the more stuck. What is the reason?

    jsulmJ 1 Reply Last reply
    0
    • J jack reemoon

      Dialog calls the close function when the button is pressed, and it will be stuck for 2 or 3 seconds, but the built-in close button in the upper right corner will not get stuck. The more controls on the form, the more stuck. What is the reason?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @jack-reemoon said in Qt 5.14.1 on Linux,Dialog Close Card:

      What is the reason?

      Impossible to say based on the information you provided!

      • What are you doing in the destructor of your dialog?
      • Are any other actions triggered when this button is pressed?

      You can also show relevant code to help others to help you.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jack reemoon
        wrote on last edited by
        #3

        QQ图片20221104085805.jpg

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jack reemoon
          wrote on last edited by
          #4

          The destructor only has the delete UI, and the button only calls this.close

          jsulmJ 1 Reply Last reply
          0
          • J jack reemoon

            The destructor only has the delete UI, and the button only calls this.close

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @jack-reemoon Please post code as text, not screen-shots!
            Please try to debug and/or profile your app to find out where it spends so much time. From what you posted others can only guess.
            What you also can do: create a small app which reproduces this issue and post the code.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            J 1 Reply Last reply
            0
            • jsulmJ jsulm

              @jack-reemoon Please post code as text, not screen-shots!
              Please try to debug and/or profile your app to find out where it spends so much time. From what you posted others can only guess.
              What you also can do: create a small app which reproduces this issue and post the code.

              J Offline
              J Offline
              jack reemoon
              wrote on last edited by
              #6

              @jsulm
              void MainWindow::on_pushButton_clicked()
              {
              TestDialog *test = new TestDialog ();
              test->setAttribute(Qt::WA_DeleteOnClose);
              test->show();
              }

              #include "testdialog.h"
              #include "ui_testdialog.h"

              TestDialog::TestDialog(QWidget *parent) :
              QDialog(parent),
              ui(new Ui::TestDialog)
              {
              ui->setupUi(this);
              connect(ui->pushButton_2,&QPushButton::clicked,this,&TestDialog::pushButton_2_clicked);
              }

              TestDialog::~TestDialog()
              {
              delete ui;
              }

              void TestDialog::closeEvent(QCloseEvent *event)
              {
              event->accept();
              }

              void TestDialog::pushButton_2_clicked()
              {
              this->close();
              }
              Does qt have requirements for computers? Computers with high configuration will not get stuck.

              1 Reply Last reply
              0

              • Login

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