[Development] QValidator in QtCore

Konrad Rosenbaum konrad at silmor.de
Mon Sep 23 15:06:26 CEST 2013


Hi,

On Monday 23 September 2013 09:45:51 Olivier Goffart wrote:
> On Sunday 22 September 2013 16:25:25 Thiago Macieira wrote:
> > Right now, we allow them and I don't like the idea of forbidding forward
> > declarations.
> > 
> > Therefore, doing anything that breaks them is source-incompatible and
> > should not be permitted until Qt 6.
> 
> Yes, but as stated, using macro as it was done for QXmlStreamWriter does
> not break source or binary compatibility. Hence it is possible to move a
> class from one module to a lower module.

I beg to differ!

--snip: header--
class QXmlStreamWriter;

class MyClass
{
  public:
    MyClass();
//...etc.
  private:
    QXmlStreamWriter*m_output;
};
--snap: source--
#include <QXmlStreamWriter>

MyClass::MyClass()
  :m_output(new QXmlStreamWriter)
{}
--the end--

Before the change: the code worked as expected.

After the change: it does not compile because the forward-declaration declares 
a different class than what should have been used and the compiler fails with 
incompatible pointers.

I do this all the time to speed up my compiler. (You start to notice the  
compiler once you have more than just a couple of C++ files and you are 
limited to a small share of an already underperforming machine.)

In other words: broken source compatibility. Period.

Whenever that happens a certain Teutonic programmer forgets that little 
invention called "civilization", grabs his battle hammer and screams bloody 
murder... ;-)



    Konrad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130923/1595b6d6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130923/1595b6d6/attachment.sig>


More information about the Development mailing list