0

OSX 10.6.8、Qt 4.7 で QFileDialog を使用しようとしています:

QFileDialog *dialog = new QFileDialog(0,tr("Load Band Recordings"),qbh,tr("Wave Files (*.wav)"));
dialog->setFileMode(QFileDialog::ExistingFiles);

if (dialog->exec())
{
QStringList fileNames;
    fileNames = dialog->selectedFiles();
    qs = fileNames[0];
}
else
{
    return(0);
}

動作しますが、多くのエラーがコンソールにダンプされます:

Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: CGSDeviceCreate: Invalid window
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: Failed to create window context device
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGWindowContextCreate: failed to create context delegate.
2012-05-13 11:03:41.445 SdrDx[18982:903] _initWithWindowNumber: error creating graphics ctxt object for ctxt:0x31197, window:0xffffffff
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextSaveGState: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextTranslateCTM: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextScaleCTM: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextAddRect: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: doClip: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextRestoreGState: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: CGSDeviceCreate: Invalid window
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: Failed to create window context device
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGWindowContextCreate: failed to create context delegate.
2012-05-13 11:03:41.533 SdrDx[18982:903] _initWithWindowNumber: error creating graphics ctxt object for ctxt:0x31197, window:0xffffffff
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextSaveGState: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextTranslateCTM: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextScaleCTM: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextAddRect: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: doClip: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextRestoreGState: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: CGSDeviceCreate: Invalid window
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: Failed to create window context device
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGWindowContextCreate: failed to create context delegate.
2012-05-13 11:03:41.576 SdrDx[18982:903] _initWithWindowNumber: error creating graphics ctxt object for ctxt:0x31197, window:0xffffffff
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextSaveGState: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextTranslateCTM: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextScaleCTM: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: CGContextAddRect: invalid context 0x0
Sun May 13 11:03:41 machine-mac-pro.local SdrDx[18982] <Error>: doClip: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextRestoreGState: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: CGSDeviceCreate: Invalid window
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: Failed to create window context device
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGWindowContextCreate: failed to create context delegate.
2012-05-13 11:03:41.616 SdrDx[18982:903] _initWithWindowNumber: error creating graphics ctxt object for ctxt:0x31197, window:0xffffffff
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextSaveGState: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextTranslateCTM: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextScaleCTM: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextAddRect: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: doClip: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextRestoreGState: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: kCGErrorIllegalArgument: CGSDeviceCreate: Invalid window
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: Failed to create window context device
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGWindowContextCreate: failed to create context delegate.
2012-05-13 11:03:41.638 SdrDx[18982:903] _initWithWindowNumber: error creating graphics ctxt object for ctxt:0x31197, window:0xffffffff
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextSaveGState: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextTranslateCTM: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextScaleCTM: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextAddRect: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: doClip: invalid context 0x0
Sun May 13 11:03:41 -mac-pro.local SdrDx[18982] <Error>: CGContextRestoreGState: invalid context 0x0

ドキュメントには、親ウィジェットを提供すると書かれています。関係ないようです。

OSXでQt 4.7 QFileDialogクラスを正しく使用して、コンソールにエラーを吐き出さないようにする方法を知っている人はいますか?

ところで、ファイルとディレクトリのダイアログの静的バージョンと構築バージョンの両方がこれを行います。Qt フォーラムで質問しましたが、回答がありませんでした。ここの誰かがそれを理解したことを願っています。

4

0 に答える 0