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. macos: [CATransaction synchronize] called within transaction
Forum Updated to NodeBB v4.3 + New Features

macos: [CATransaction synchronize] called within transaction

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 6 Posters 4.1k 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.
  • M Offline
    M Offline
    maccan
    wrote on last edited by
    #1

    Hi,

    I'm running macos Ventura 13.1 and my QT application reports the following warning/error: "[CATransaction synchronize] called within transaction".
    It occurs during statements like this:
    QString fileName = QFileDialog::getOpenFileName(this, "Load...", ".", "*.yaml");

    Apart from the warning/error, the code runs normally.
    My QT Version is 6.4.1

    Regards

    Any help would be great

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

      Hi and welcome to devnet,

      Can you provide a minimal compilable example that shows this behaviour ?

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

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Can you provide a minimal compilable example that shows this behaviour ?

        M Offline
        M Offline
        maccan
        wrote on last edited by
        #3

        @SGaist

        Just compile the code attached below and start it from the shell.
        I get:
        2023-01-02 09:41:07.471 test[97391:2850756] +[CATransaction synchronize] called within transaction


        #include <QApplication>
        #include <QFileDialog>

        int main(int argc, char argv[]) {
        QApplication a(argc, argv);
        QFileDialog f;
        QString fileName =
        f.getOpenFileName(0, "Select file...", ".", "
        .txt");
        return a.exec();
        }

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

          Can you check with 6.4.2 ?

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

          J M 3 Replies Last reply
          0
          • SGaistS SGaist

            Can you check with 6.4.2 ?

            J Offline
            J Offline
            jiayouzl
            wrote on last edited by
            #5

            @SGaist My system macos13.1, I also encountered this problem with Python 3.9.16, this problem is not available in macos12, it appeared after upgrading to macos13. my pyside version 6.4.2

            1 Reply Last reply
            0
            • SGaistS SGaist

              Can you check with 6.4.2 ?

              J Offline
              J Offline
              jiayouzl
              wrote on last edited by
              #6

              @SGaist

              my code

              资源文件选择按钮

              def selectResourceFile(self):
                  # 资源文件路径
                  resourceFile = QFileDialog.getOpenFileName(self, caption='选择资源文件', dir=os.getcwd(), filter='All Files (*)')
                  if resourceFile[0] not in ['', None]:
                      # 插入表格内容
                      self.ui.tableWidget.insertRow(0)  # 插入到第一行
                      self.setTable(0, 0, resourceFile[0])
                      self.setTable(0, 1, '.')
              
              1 Reply Last reply
              0
              • SGaistS SGaist

                Can you check with 6.4.2 ?

                M Offline
                M Offline
                maccan
                wrote on last edited by
                #7

                @SGaist
                Same result in 6.4.2!

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

                  Based on this thread of the Apple developer forum, it looks like an Apple issue.

                  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

                    Based on this thread of the Apple developer forum, it looks like an Apple issue.

                    R Offline
                    R Offline
                    Riccardo M. Bianchi
                    wrote on last edited by Riccardo M. Bianchi
                    #9

                    @maccan , @SGaist , all,

                    In my case, I could fix the problem by using the QFileDialog::DontUseNativeDialog option.

                    When using that option, the Apple native file dialog window is not used anymore, which seems to fix the problem in my application (on macOS Ventura and M1 Pro chip).

                    I hope that helps.

                    Best,
                    -- Riccardo.

                    C 1 Reply Last reply
                    0
                    • R Riccardo M. Bianchi

                      @maccan , @SGaist , all,

                      In my case, I could fix the problem by using the QFileDialog::DontUseNativeDialog option.

                      When using that option, the Apple native file dialog window is not used anymore, which seems to fix the problem in my application (on macOS Ventura and M1 Pro chip).

                      I hope that helps.

                      Best,
                      -- Riccardo.

                      C Offline
                      C Offline
                      Cael
                      wrote on last edited by
                      #10

                      @Riccardo-M-Bianchi

                      I am running into this same issue (Mac OS, Ventura, M1 chip, etc), but I am using QML and following the basic QT manual page for opening a QML folder dialogue: https://doc.qt.io/qt-6/qml-qt-labs-platform-folderdialog.html#:~:text=To show a folder dialog,made by accepting the dialog.

                      Does anyone know if there is a way to set the QFileDialog::Don'tUseNative option from within QML?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        ShineGalaxy
                        wrote on last edited by
                        #11
                            QStringList fileNames = QFileDialog::getOpenFileNames(
                                this, tr("Import File(Import tif files first)"), filePath,
                                "file (*.tiff *.tif *.png *.bmp)",0,QFileDialog::DontUseNativeDialog);
                        
                        QFileDialog::DontUseNativeDialog
                        

                        add up option,program could work,but way?

                        SGaistS 1 Reply Last reply
                        0
                        • S ShineGalaxy
                              QStringList fileNames = QFileDialog::getOpenFileNames(
                                  this, tr("Import File(Import tif files first)"), filePath,
                                  "file (*.tiff *.tif *.png *.bmp)",0,QFileDialog::DontUseNativeDialog);
                          
                          QFileDialog::DontUseNativeDialog
                          

                          add up option,program could work,but way?

                          SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @ShineGalaxy because then the native dialog is not used and thus does not trigger the message.

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

                          S 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            @ShineGalaxy because then the native dialog is not used and thus does not trigger the message.

                            S Offline
                            S Offline
                            ShineGalaxy
                            wrote on last edited by
                            #13

                            @SGaist add tifflib-4.5.1,then problem occurred. why?

                            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