Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-13558

autocomplete signal / slot does not work for connect Qt5 style

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • Qt Creator 4.14.0-beta1
    • Qt Creator 3.3.0-rc1, Qt Creator 4.7.0, Qt Creator 4.14.0-beta2
    • C/C++/Obj-C++ Support
    • None
    • Windows VS2013 64bit
    • a79b0c6558ef8b9ca1a0f5ae553c9cf73acccc82 (qt-creator/qt-creator/master)

    Description

      When editing a connect() the NEW Qt5 Style, the autocompletion does not limit the signal element to reals signals. Any member method is proposed... not just signals. The same holds for slots. This is not helpful for the novice user.

      E.g. when entering:

      connect(textEdit->document(), &QTextDocument::[cursor blinks here]) // now use CTRL+SPACE for autocomplete

      every method of QTextDocument is shown... not just the signals.

      But this is the case for the OLD connect style:

      connect(textEdit->document(), SIGNAL(cursor blinks here])) // now CTRL+SPACE

      only the signals are offered.

      So: The old way is very convinient and less error prone..

      As a side note:
      The new QT5 style does compile even for stupid things like:

      connect(textEdit->document(), &QTextDocument::adjustSize, this, &MainWindow::activateWindow);

      At runtime you will have:

      QObject::connect: signal not found in QTextDocument

      which is not very informative .... which signal was not found, where is this wrong connect ???

      For the OLD style you get for

      connect(textEdit->document(), SIGNAL(adjustSize()),this, SLOT(activateWindow()));

      an runtime warning:

      QObject::connect: No such signal QTextDocument::adjustSize() in mainwindow.cpp:149

      With a source line number and you can click on the warning and you will be at the right spot !!
      Perfect

      This looks error prone to me..

      Attachments

        Issue Links

          Activity

            People

              kandeler Christian Kandeler
              moellney Michael Möllney
              Votes:
              8 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: