Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QStringList : Can't access to member functions
QtWS25 Last Chance

QStringList : Can't access to member functions

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lio2609
    wrote on last edited by
    #1

    Hi everyone,
    I don't know why, i can't access to the member functions of QStringList but i can access to all the inherited functions...

    Do you have an idea?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's a bit vague as a question. What member function can't you access ?

      By the way, what version of Qt are you using ?
      On what platform ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        That's a bit vague as a question. What member function can't you access ?

        By the way, what version of Qt are you using ?
        On what platform ?

        L Offline
        L Offline
        Lio2609
        wrote on last edited by Lio2609
        #3

        @SGaist

        Thank you for your answer,

        i can't access any public functions of QStringList like sort() or removeDuplicates() , only the ones inherited from QList.

        I'm using Qt 5.10

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you show a sample code that triggers this as well as the exact error message ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          L 1 Reply Last reply
          0
          • SGaistS SGaist

            Can you show a sample code that triggers this as well as the exact error message ?

            L Offline
            L Offline
            Lio2609
            wrote on last edited by Lio2609
            #5

            @SGaist
            (Sorry if my english is bad, it's not my mother language)

            void FenServeur::recuperationPseudo(const QString &message, client *emetteur)
            {
                QRegularExpression patternPseudo(">(.+)<");
                QRegularExpressionMatch match = patternPseudo.match(message);
            
                if (match.hasMatch())
                {
                    const QString matched = match.captured(1); // matched == "pseudo"
                    emetteur->setPseudo(matched);
                    pseudosListe << matched;        
                    pseudosListe.sort();
                    pseudosListe.removeDuplicates();
                }
            }
            

            There is no error, it compile...
            it's just , that do nothing.

            in Qt when you start to type a function it show you a list of functions that you can use, the public functions of QStringList are not in.

            and of course if i write the entire name of the function it's not colored so i presume it's not recognized.

            but when i run minGW there is no warning, error etc but the function don't work at the execution like sort() don't sort the list.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              If it compiles then there's no problem code wise.

              The fact that is "doesn't do anything" is highly suggestive. How do you know it "doesn't do anything" ? How do you know the list is not sorted ? What does message contain ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • L Offline
                L Offline
                Lio2609
                wrote on last edited by Lio2609
                #7

                I know it because i can see it in a QTextEdit at the axecution that it is not sorted.
                "Message" contain the name and message comming from a client.
                The code that i have wrote is in the server code.
                This code take the name from the message and put it in a QStringList.

                Edit: You were right, i am a big idiot, the list is sorted i'm confused.
                Thank you for wasting your time on this !

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved