Question

I'm developping a Qt GUI application.

My problem is that I use the console for another thread (it write his comunication in it), and the main problem is that when I create a QFileDialog (in order to select a script file), KDE is wrinting useless informations (for me at least).

Is there a way to remove all possibility from my QFileDialog to write anything into the consolethat ? Is there a trick to switch main output to another (useless) target ?

My code (but I don't think it's really gonna help you) :

void MyGUI::setPathWithFileExplorer()
{
  QFileDialog dlg;
  dlg.resize(320,240);
  QString fileName = dlg.getOpenFileName(this, tr("Open script file"), "~/", tr("Script Files (*.js)"));

  if(fileName != "")
    ui->editScriptPath->setText(fileName);
}

Output :

kded(21003) Mollet::KioSlaveNotifier::onDirectoryEntered: "trash:/" kded(21003) Mollet::KioSlaveNotifier::onDirectoryLeft: "trash:/" kded(21003) Mollet::KioSlaveNotifier::onDirectoryEntered: "file://[PATH TO MY USER FOLDER]" kded(21003) Mollet::KioSlaveNotifier::onDirectoryLeft: "file://[PATH TO MY USER FOLDER]" kded(21003) Mollet::KioSlaveNotifier::onDirectoryEntered: "file://[PATH TO MY USER FOLDER]" kfilemodule(21676) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf Loaded services file OK. WARNING: The setting 'security=ads' should NOT be combined with the 'password server' parameter. (by default Samba will discover the correct DC to contact automatically). WARNING: You have some share names that are longer than 12 characters. These may not be accessible to some older clients. (Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.) " QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: Permission non accordée QFileSystemWatcher: failed to add paths: /var/lib/samba/usershares

Was it helpful?

Solution

I would suggest using kdebugdialog and then Deselect All. Here you can see an inline screenshot on my machine.

enter image description here

Failing that, you could always use QFile to log your output into a dedicated file, and then monitor that in a separate prompt or application.

If you go down that way, you could even take a look at the logger functionality added in 5.2 if you happen to be able to use that version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top