Partage
  • Partager sur Facebook
  • Partager sur Twitter

[Qt] Qt Prompt me donne une erreur que je ne comprend pas

Sujet résolu
    5 avril 2008 à 21:54:08

    Bonsoir,
    bon voilà j'ai une erreur avec Qt Prompt qui est la suivante :

    Citation : Qt Prompt

    C:\programmations\>qmake -project

    C:\programmations\>qmake

    C:\programmations>make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/programmations/'
    g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS
    _QMAIN -I"d:\QT\include\QtCore" -I"d:\QT\include\QtCore" -I"d:\QT\include\QtGui"
    -I"d:\QT\include\QtGui" -I"d:\QT\include" -I"." -I"d:\QT\include\ActiveQt" -I"r
    elease" -I"." -I"d:\QT\mkspecs\win32-g++" -o release\a_tab_intensite.o alternati
    f\a_intensite\a_tab_intensite.cpp
    alternatif\a_intensite\a_tab_intensite.cpp: In constructor `a_TabIntensite::a_Ta
    bIntensite(QWidget*)':
    alternatif\a_intensite\a_tab_intensite.cpp:17: error: ambiguous overload for 'op
    erator+' in 'QChar(966) + ")"'
    d:/QT/include/QtCore/../../src/corelib/tools/qstring.h:931: note: candidates are
    : const QString operator+(const QString&, const QString&)
    d:/QT/include/QtCore/../../src/corelib/tools/qstring.h:933: note:
    const QString operator+(const QString&, QChar) <near match>
    d:/QT/include/QtCore/../../src/corelib/tools/qstring.h:935: note:
    const QString operator+(QChar, const QString&)
    d:/QT/include/QtCore/../../src/corelib/tools/qstring.h:938: note:
    const QString operator+(const QString&, const char*)
    d:/QT/include/QtCore/../../src/corelib/tools/qstring.h:944: note:
    const QString operator+(const QString&, char) <near match>
    d:/QT/include/QtCore/../../src/corelib/tools/qstring.h:948: note:
    const QString operator+(const QString&, const QByteArray&)
    mingw32-make[1]: *** [release\a_tab_intensite.o] Error 1
    mingw32-make[1]: Leaving directory `C:/programmations/'
    mingw32-make: *** [release] Error 2



    voici le code :
    label_puissance = new QLabel("<font style=\"font-size: 14px;\">Puissance active (P) : </span>");
            m_puissance     = new QLineEdit("0");
            label_watt      = new QLabel("W");
            
            label_cosPhi = new QLabel("<font style=\"font-size: 14px;\">Facteur de puissance (cos "+QString(QChar(966))+") : </span>");
            m_cosPhi     = new QLineEdit("0.000");
            
            m_calculer = new QPushButton(tr("Calculer"));
            connect(m_calculer, SIGNAL(clicked()), this, SLOT(calculIP_U_cos()));
    


    Si vous pouvez m'aider à comprendre... C'est super bizzare non?

    Merci :)
    • Partager sur Facebook
    • Partager sur Twitter
    :)
      5 avril 2008 à 22:06:26

      salut,

      ton 0 n'est pas une chaine de caractère, enlève les guillemet et ça devrait marcher.

      a+
      hedi07
      • Partager sur Facebook
      • Partager sur Twitter
        5 avril 2008 à 22:07:55

        Ce n'est pas ça le soucis j'ai déjà compiler avec un autre QLineEdit avec un zéro mis en string.
        Bref ce n'ets pas ça qui pose le problème
        • Partager sur Facebook
        • Partager sur Twitter
        :)
          5 avril 2008 à 22:25:36

          d'après la doc:

          1. QLineEdit::QLineEdit ( const QString & contents, QWidget * parent = 0 );
          2. QLineEdit::QLineEdit ( QWidget * parent = 0 )


          d'après ce que je comprend de la doc', tu peut passer un QString, mais il faut après la référence vers le parent.

          a+
          hedi07
          • Partager sur Facebook
          • Partager sur Twitter
            5 avril 2008 à 23:15:25

            pas besoin car si on ne met rien c'est le zéro qui est prit en compte (les paramètres par défaut d'une fonction)
            Bref mon erreur je l'ai déjà trouvé et elle était toute bête..
            • Partager sur Facebook
            • Partager sur Twitter
            :)

            [Qt] Qt Prompt me donne une erreur que je ne comprend pas

            × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
            × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
            • Editeur
            • Markdown