Results 1 to 8 of 8

Thread: Is this a known bug in moc?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Is this a known bug in moc?

    I wanted to use the following signal
    Qt Code:
    1. void QNetworkAccessManager::sslErrors (QNetworkReply * reply, const QList<QSslError> & errors ) [signal]
    To copy to clipboard, switch view to plain text mode 
    so I wrote this
    Qt Code:
    1. QObject::connect(nam, SIGNAL(sslErrors(QNetworkReply*, QList<QSslError> const &)), this, SLOT(ssl(QNetworkReply *)));
    To copy to clipboard, switch view to plain text mode 
    and got an error about non-existen signal... Changing above to
    Qt Code:
    1. QObject::connect(nam, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> &)), this, SLOT(ssl(QNetworkReply *)));
    To copy to clipboard, switch view to plain text mode 
    solved the problem.

    Is this a known bug in moc?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,626
    Thanks
    13
    Thanked 1,592 Times in 1,520 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is this a known bug in moc?

    Seems like you are describing correct operation. The slot parameter signature of your working option matches the definition of the signal i.e. the QMetaObject::normalizedSignature method returns that string exactly for the slot. The other doesn't.

  3. #3
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is this a known bug in moc?

    Could you clarify, please?
    Do you agree this is a bug or not?

  4. #4
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is this a known bug in moc?

    Quote Originally Posted by ChrisW67 View Post
    Seems like you are describing correct operation. The slot parameter signature of your working option matches the definition of the signal i.e. the QMetaObject::normalizedSignature method returns that string exactly for the slot. The other doesn't.
    But in the end, the meaning of both signatures is equivalent. I guess that is what Piotr wanted to point out. I'd say this is a bug, then.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is this a known bug in moc?

    If at all then not in moc but rather in QMetaObject::normalizedSignature(). But in general this should work, maybe the problem is somewhere else?

    If it's known - that I do not know but you can check that yourself using the task-tracker.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is this a known bug in moc?

    Quote Originally Posted by wysota View Post
    If at all then not in moc but rather in QMetaObject::normalizedSignature().
    Yep.

    Quote Originally Posted by wysota View Post
    But in general this should work, maybe the problem is somewhere else?
    It should work but it doesn't work. We have two identical (from C++ pov) signatures and one is treated differently by moc than the other. Isn't this clearly a bug?
    What do you mean by maybe the problem is somewhere else?

    Quote Originally Posted by wysota View Post
    If it's known - that I do not know but you can check that yourself using the task-tracker.
    There were a couple of tickets about moc and signatures, all fixed.
    I created a ticket for this.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is this a known bug in moc?

    Quote Originally Posted by piotr.dobrogost View Post
    It should work but it doesn't work. We have two identical (from C++ pov) signatures and one is treated differently by moc than the other. Isn't this clearly a bug?
    The documentation gives an example almost identical to yours (it uses a pointer and not a reference), so I assume they checked that it works. You might check if changing the reference to a pointer makes it work.

    What do you mean by maybe the problem is somewhere else?
    In some other part of the code or because of some non-printable character. I'm just guessing, it's simply hard to believe the example from the docs doesn't work.

    There were a couple of tickets about moc and signatures, all fixed.
    But moc has nothing to do with this...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is this a known bug in moc?

    Quote Originally Posted by wysota View Post
    I'm just guessing, it's simply hard to believe the example from the docs doesn't work.
    What I presented in my op is not the example from the docs but my code. I only copied and pasted signal declaration directly from the docs to show it's part of qt and not mine.

    Quote Originally Posted by wysota View Post
    But moc has nothing to do with this...
    In the most narrow sense moc is only a compiler but in a broader sense it's name of whole concept, system (name it as you like) which this compiler is only one part of. When using moc in the second sense QMetaObject::normalizedSignature() is vital part of moc.
    On the other hand, if we agree moc is only a compiler than how should we call the whole system of meta information in qt?

Similar Threads

  1. Invoking MOC w/MSVS + Qt Visual Integration
    By WinchellChung in forum Newbie
    Replies: 4
    Last Post: 10th August 2010, 22:56
  2. Replies: 12
    Last Post: 7th July 2009, 17:32
  3. Compilation error with MSVC: Wrong MOC version
    By vuakko in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2009, 09:59
  4. How to avoid creation of MOC files on each compilation
    By nileshsince1980 in forum Qt Programming
    Replies: 4
    Last Post: 29th May 2009, 08:00
  5. moc with same file names?
    By cjhuitt in forum Qt Programming
    Replies: 9
    Last Post: 27th April 2007, 20:36

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.