macos: [CATransaction synchronize] called within transaction
-
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.1Regards
Any help would be great
-
Hi and welcome to devnet,
Can you provide a minimal compilable example that shows this behaviour ?
-
Hi and welcome to devnet,
Can you provide a minimal compilable example that shows this behaviour ?
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();
} -
Can you check with 6.4.2 ?
-
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, '.') -
Based on this thread of the Apple developer forum, it looks like an Apple issue.
-
Based on this thread of the Apple developer forum, it looks like an Apple issue.
In my case, I could fix the problem by using the
QFileDialog::DontUseNativeDialogoption.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. -
In my case, I could fix the problem by using the
QFileDialog::DontUseNativeDialogoption.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.@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?
-
QStringList fileNames = QFileDialog::getOpenFileNames( this, tr("Import File(Import tif files first)"), filePath, "file (*.tiff *.tif *.png *.bmp)",0,QFileDialog::DontUseNativeDialog);QFileDialog::DontUseNativeDialogadd up option,program could work,but way?
-
QStringList fileNames = QFileDialog::getOpenFileNames( this, tr("Import File(Import tif files first)"), filePath, "file (*.tiff *.tif *.png *.bmp)",0,QFileDialog::DontUseNativeDialog);QFileDialog::DontUseNativeDialogadd up option,program could work,but way?
@ShineGalaxy because then the native dialog is not used and thus does not trigger the message.
-
@ShineGalaxy because then the native dialog is not used and thus does not trigger the message.
@SGaist add tifflib-4.5.1,then problem occurred. why?