error in make qtdeclarative module



  • I get qtdeclarative module with

    git clone git://code.qt.io/qt/qtdeclarative.git -b 5.6
    

    when I make it ,I get error from qquickinput.cpp that cannot find

    #include <QtGui/private/qinputcontrol_p.h>
    

    I add qinputcontrol_p.h in QtGui/private :

    #ifndef QINPUTCONTROL_P_H
    
    #define QINPUTCONTROL_P_H
    
    //
    
    //  W A R N I N G
    
    //  -------------
    
    //
    
    // This file is not part of the Qt API. It exists purely as an
    
    // implementation detail. This header file may change from version to
    
    // version without notice, or even be removed.
    
    //
    
    // We mean it.
    
    //
    
    #include <QtCore/qobject.h>
    
    #include <QtGui/qtguiglobal.h>
    #include <QtGui/qevent.h>
    
    
    QT_BEGIN_NAMESPACE
    
    class QKeyEvent;
    
    class Q_GUI_EXPORT QInputControl : public QObject
    
    {
    
        Q_OBJECT
    
    public:
    
        enum Type {
    
            LineEdit,
    
            TextEdit
    
        };
    
        explicit QInputControl(Type type, QObject *parent = nullptr) : QObject(parent)
        , m_type(type)
    {}
    ;
    virtual ~GetResponse(){};
    
        bool isAcceptableInput(const QKeyEvent *event) const{
        const QString text = event->text();
        if (text.isEmpty())
            return false;
        const QChar c = text.at(0);
        // Formatting characters such as ZWNJ, ZWJ, RLM, etc. This needs to go before the
        // next test, since CTRL+SHIFT is sometimes used to input it on Windows.
        if (c.category() == QChar::Other_Format)
            return true;
        // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
        if (event->modifiers() == Qt::ControlModifier
                || event->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
            return false;
        }
        if (c.isPrint())
            return true;
        if (c.category() == QChar::Other_PrivateUse)
            return true;
        if (m_type == TextEdit && c == QLatin1Char('\t'))
            return true;
        return false;
    };
    
        static bool isCommonTextEditShortcut(const QKeyEvent *ke){
        if (ke->modifiers() == Qt::NoModifier
            || ke->modifiers() == Qt::ShiftModifier
            || ke->modifiers() == Qt::KeypadModifier) {
            if (ke->key() < Qt::Key_Escape) {
                return true;
            } else {
                switch (ke->key()) {
                    case Qt::Key_Return:
                    case Qt::Key_Enter:
                    case Qt::Key_Delete:
                    case Qt::Key_Home:
                    case Qt::Key_End:
                    case Qt::Key_Backspace:
                    case Qt::Key_Left:
                    case Qt::Key_Right:
                    case Qt::Key_Up:
                    case Qt::Key_Down:
                    case Qt::Key_Tab:
                    return true;
                default:
                    break;
                }
            }
    //#if QT_CONFIG(shortcut)
        } else if (ke->matches(QKeySequence::Copy)
                   || ke->matches(QKeySequence::Paste)
                   || ke->matches(QKeySequence::Cut)
                   || ke->matches(QKeySequence::Redo)
                   || ke->matches(QKeySequence::Undo)
                   || ke->matches(QKeySequence::MoveToNextWord)
                   || ke->matches(QKeySequence::MoveToPreviousWord)
                   || ke->matches(QKeySequence::MoveToStartOfDocument)
                   || ke->matches(QKeySequence::MoveToEndOfDocument)
                   || ke->matches(QKeySequence::SelectNextWord)
                   || ke->matches(QKeySequence::SelectPreviousWord)
                   || ke->matches(QKeySequence::SelectStartOfLine)
                   || ke->matches(QKeySequence::SelectEndOfLine)
                   || ke->matches(QKeySequence::SelectStartOfBlock)
                   || ke->matches(QKeySequence::SelectEndOfBlock)
                   || ke->matches(QKeySequence::SelectStartOfDocument)
                   || ke->matches(QKeySequence::SelectEndOfDocument)
                   || ke->matches(QKeySequence::SelectAll)
                  ) {
            return true;
    //#endif
        }
        return false;
    };
    
    protected:
    
        explicit QInputControl(Type type, QObjectPrivate &dd, QObject *parent = nullptr);
    
    private:
    
        const Type m_type;
    
    };
    
    QT_END_NAMESPACE
    
    #endif // QINPUTCONTROL_P_H
    

    Now I get this error below, how can I fix this?

    .obj/qquicktextinput.o:qquicktextinput.cpp:function QQuickTextInputPrivate::init(): error: undefined reference to 'QInputControl::QInputControl(QInputControl::Type, QObject*)'
    .obj/qquicktextinput.o:qquicktextinput.cpp:function QQuickTextInputPrivate::processKeyEvent(QKeyEvent*): error: undefined reference to 'QInputControl::isAcceptableInput(QKeyEvent const*) const'
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:function QQuickTextControl::~QQuickTextControl(): error: undefined reference to 'vtable for QInputControl'
    /root/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:function QQuickTextControl::~QQuickTextControl(): error: undefined reference to 'vtable for QInputControl'
    /root/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:function QQuickTextControl::qt_metacast(char const*): error: undefined reference to 'QInputControl::qt_metacast(char const*)'
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:function QQuickTextControl::QQuickTextControl(QTextDocument*, QObject*): error: undefined reference to 'QInputControl::QInputControl(QInputControl::Type, QObjectPrivate&, QObject*)'
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:function QQuickTextControlPrivate::keyPressEvent(QKeyEvent*): error: undefined reference to 'QInputControl::isAcceptableInput(QKeyEvent const*) const'
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:function QQuickTextControl::qt_metacall(QMetaObject::Call, int, void**): error: undefined reference to 'QInputControl::qt_metacall(QMetaObject::Call, int, void**)'
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:QQuickTextControl::staticMetaObject: error: undefined reference to 'QInputControl::staticMetaObject'
    .obj/qquicktextcontrol.o:qquicktextcontrol.cpp:typeinfo for QQuickTextControl: error: undefined reference to 'typeinfo for QInputControl'
    collect2: error: ld returned 1 exit status
    make[2]: *** [../../lib/libQt5Quick.so.5.6.4] Error 1
    make[2]: Leaving directory `/home/zp/qtdeclarative/src/quick'
    make[1]: *** [sub-quick-make_first-ordered] Error 2
    make[1]: Leaving directory `/home/zp/qtdeclarative/src'
    make: *** [sub-src-make_first] Error 2
    

  • Qt Champions 2017

    Hi @isan,

    • On which platform are you?
    • Against which Qt version do you want to compile qtdeclarative?
    • How did you obtain Qt, as binary or did you compile yourself?


  • I compile QT 5.6 form this link on linux 14.04
    Desktop QT 5.5.1 GCC 32bit


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.