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
Forum Updated to NodeBB v4.3 + New Features

Qt 5.14.1 on Linux,Dialog Close Card

Scheduled Pinned Locked Moved Unsolved General and Desktop
linux
6 Posts 2 Posters 717 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 2 Nov 2022, 00:17 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?

    J 1 Reply Last reply 2 Nov 2022, 08:40
    0
    • J jack reemoon
      2 Nov 2022, 00:17

      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?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 2 Nov 2022, 08:40 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 4 Nov 2022, 00:59 last edited by
        #3

        QQ图片20221104085805.jpg

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jack reemoon
          wrote on 4 Nov 2022, 01:28 last edited by
          #4

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

          J 1 Reply Last reply 4 Nov 2022, 06:19
          0
          • J jack reemoon
            4 Nov 2022, 01:28

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

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 4 Nov 2022, 06:19 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 5 Nov 2022, 01:09
            0
            • J jsulm
              4 Nov 2022, 06:19

              @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 5 Nov 2022, 01:09 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

              5/6

              4 Nov 2022, 06:19

              • Login

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