[PATCH 3/3] Add a slot to mainwindow but amend to use Q_SLOTS

Thiago Macieira thiago at macieira.org
Tue Apr 9 10:39:19 PDT 2013


On terça-feira, 9 de abril de 2013 10.13.38, Dirk Hohndel wrote:
> Thiago Macieira <thiago at macieira.org> writes:
> > On terça-feira, 9 de abril de 2013 06.53.20, Dirk Hohndel wrote:
> >> > +void MainWindow::on_actionNew_triggered()
> >> > +{
> >> > +    qDebug() << "actionNew";
> >> > +}
> >> > +
> >> 
> >> By the way: this is a part of C++ syntax that I really dislike... the
> >> whole streams thing is just ugly.
> > 
> > qDebug("actionNew") also works.
> > 
> > And qDebug() supports printf-style formatting.
> 
> BTW: where does qDebug write to on Windows? One of the things that are
> driving me bonkers on Windows is that we don't get to see stderr
> (without some weird manual steps to reclassify the executable)...

To where -- I'm told -- Windows developers expect it to go: the debug output 
(Qt uses the Win32 call OutputDebugStringW), to the detriment of many a 
helpgiver on IRC who often faces the dialog:

 <user> My function isnt called, I put a qDebug there and nothing!!!11one
 <helpgiver> Are you using Windows?

If you use Qt Creator or Visual Studio, they will capture the output and show 
it for you. If you don't use either of those tools, you should run 
dbgview.exe[1].

The advantage is that you do not need to set the application to console mode, 
since the output is not in stderr.

By the way, another must-have tool for Windows developers is depends.exe[2], 
the replacement for ldd and otool -L, the usual answer to "My application 
won't load on my friend's system" problem.

[1] http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
[2] http://www.dependencywalker.com/

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130409/09133502/attachment.sig>


More information about the subsurface mailing list