Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qstringlist
    Log in to post

    • UNSOLVED Easiest way to get substring from QString in Qt
      General and Desktop • c++ qstring qstringlist regex substring • • learnist  

      2
      0
      Votes
      2
      Posts
      260
      Views

      Hi, One possible way is to use QRegularExpression::match or since it looks like xml, you can use QXmlStreamReader.
    • SOLVED Limiting characters in PlainTextEdit field line by line using QStringList::iterator or QMutableStringListIterator - Always crashes at iteration 268
      General and Desktop • qstringlist iterator plaintextedit limit character line by line • • dante77  

      8
      0
      Votes
      8
      Posts
      413
      Views

      @kshegunov Is append() not safe to call while using an iterator on the same list? Nope. Append can (and often will) realloc to accommodate the new elements, so the old memory gets invalidated. Since you use a mutable iterator, can't you use that to append to the list? Thank you so much! I wasn't sure that was possible. I guess I missed that in the documentation. For those who might have the same problem or are looking to do the same thing with a TextEdit field: instead of using append, I used QMutableStringListIterator::insert().
    • SOLVED Problems with providing arguments to QProcess
      General and Desktop • qprocess desktop qt4 qstringlist • • Thanos  

      6
      0
      Votes
      6
      Posts
      5289
      Views

      @Thanos thanks for your feedback. So please mark this topic as SOLVED now.
    • SOLVED Getting QStringList text to line edit based on a string inserted on another line edit
      General and Desktop • qtcreator qstringlist line edit indexof • • Lasith  

      15
      0
      Votes
      15
      Posts
      3383
      Views

      @Lasith Your problems: You only once call the returning function of the index, and in the designer. (In fact, when ui->name text changes, the function should be called every time.) @Lasith said in Getting QStringList text to line edit based on a string inserted on another line edit: QString index; Name=ui->name->text(); for(int i=0;i<names.size();i++) { if(names[i]==Name){ index=i; } You want the string but in your cycle the 'i' of the integer. Why do not you pay attention to this(index = i)? Try compile the app? If yes, the compiler would inform you about it. From your profile it seems that you are using Qt too several months. But it does not seem to be at all. Do not try to conquer the peak, learn to walk first.
    • UNSOLVED runtime error terminate called after throwing an instance of 'std::bad_alloc'
      General and Desktop • qt creator qlist qstringlist runtime error • • Lasith  

      8
      0
      Votes
      8
      Posts
      5798
      Views

      @Lasith well std::bad_alloc often comes when out of memory. My guess is that <List1[0].size() is always true since you add to it for each loop and hence create an infinite loop. Did you try VRonin code? Update: If you just want list1 in [0] and list2 in[1] why all the loops then?
    • UNSOLVED Increasing QList<QStringList> contents twice!
      General and Desktop • qlist qstringlist loop • • Kushan  

      12
      0
      Votes
      12
      Posts
      2819
      Views

      @kshegunov said in increasing QList<QStringList> contents twice!: if it looks like a duck, swims like a duck, and quacks like a duck Slight thread derail, but I would say the op's question general is answered .
    • SOLVED Opening dynamically created buttons
      General and Desktop • button dynamic qstringlist click • • Kushan  

      11
      0
      Votes
      11
      Posts
      9672
      Views

      @jsulm thanx bro :)
    • UNSOLVED Getting database values into QStringList
      General and Desktop • qtcreator database qstringlist value • • Lasith  

      3
      0
      Votes
      3
      Posts
      2354
      Views

      Hi, To add to @dream_captain, in case of an error, at least print the error string from the query so you know what went wrong.
    • UNSOLVED Invalid parameter passed to C runtime function
      General and Desktop • qtcreator qstringlist runtime error • • Lasith  

      19
      0
      Votes
      19
      Posts
      8224
      Views

      @JNBarchan yeah they are nested for loops!
    • UNSOLVED Index out of range error
      General and Desktop • qstring qstringlist runtimeerror concatanation • • Lasith  

      5
      0
      Votes
      5
      Posts
      1099
      Views

      Hi Normally its the that can give "index out of range error" not when inserting ?
    • SOLVED QList<QStringList> elemen t not getting replaced!
      General and Desktop • qstringlist change value • • Kushan  

      3
      0
      Votes
      3
      Posts
      654
      Views

      @J.Hilk Thanx alot
    • SOLVED Using large data structure for storage!
      General and Desktop • qstringlist max size • • Kushan  

      22
      0
      Votes
      22
      Posts
      4752
      Views

      @jsulm Got it solved it was in the textfile that I used to read into the QList because the value I gave is more than the number of elements in the text file that I read!
    • SOLVED concatanating qtablewidget items into string incorrect
      General and Desktop • qtcreator qstring qstringlist concatanation • • Lasith  

      3
      0
      Votes
      3
      Posts
      829
      Views

      @SGaist Dman that was silly mistake :(
    • SOLVED Handling several QStringLists
      General and Desktop • qtcreator qstringlist datastructures • • Lasith  

      5
      0
      Votes
      5
      Posts
      1118
      Views

      @SGaist Thanx mate
    • SOLVED Image viewer - moving to previous image in directory
      General and Desktop • image qstringlist directory • • Avec  

      13
      0
      Votes
      13
      Posts
      4407
      Views

      @Avec Oh duh.. I should have thought of that as a potential reason. I just assumed that you were in the directory with the files as your current dir. Glad it's all solved. :)
    • UNSOLVED QML - How display a text file on ListView?
      General and Desktop • qml qt quick text qstringlist • • justlooking  

      3
      0
      Votes
      3
      Posts
      2785
      Views

      I can't say that I understood your code, but if you'll change the return value of your reading method (read(), I presume) to QStringList, then you can display it with ListView in QML like this: ListView { //Layout.preferredHeight: childrenRect.height model: myFile.read() delegate: Text { text: modelData } }
    • SOLVED ASSERT failure in QList<T>::at: "index out of range"
      General and Desktop • c++ qt 5.7 qlist qstringlist qurl • • Qjay  

      24
      0
      Votes
      24
      Posts
      19863
      Views

      I too was also thinking of full rewrite but i don't have much time for that right now :/ .
    • SOLVED Problem building QStringlist
      General and Desktop • qstringlist • • jocala  

      7
      0
      Votes
      7
      Posts
      1562
      Views

      I've got some reading to do :) Thanks @SGaist
    • SOLVED Problem with QList
      General and Desktop • qlist qstringlist • • shahriar25  

      5
      0
      Votes
      5
      Posts
      1717
      Views

      Hi, There's usually no need to allocate QList nor QStringList on the heap. Do you have any reasons to do that ?
    • SOLVED QString with taglib
      General and Desktop • qstringlist taglib • • shahriar25  

      6
      0
      Votes
      6
      Posts
      2328
      Views

      Thanks. It worked
    • Split hex encoded string
      General and Desktop • qstring qstringlist regex hex format • • azarubkin  

      2
      0
      Votes
      2
      Posts
      1178
      Views

      You can use a regular expression in a loop: QString s = "806982"; QRegExp re("([\\da-fA-F]{2})"); // exactly 2 hex digits QStringList l; int pos = 0; while ((pos = re.indexIn(s, pos)) != -1) { l << re.cap(1); pos += re.matchedLength(); }
    • adding item in qstringlist
      General and Desktop • qstringlist • • Lorence  

      4
      0
      Votes
      4
      Posts
      10942
      Views

      QStringList.append(String)
    • QPixmap - ładowanie ścieżek do plików z QStringList
      Polish • qpixmap qstringlist • • 2Kris  

      3
      0
      Votes
      3
      Posts
      1706
      Views

      Dzięki za szybką odpowiedź. Problem rozwiązany zamiast QPixmap, użyłem QImage i metody drawImage(). Nadal nie mam pojęcia dlaczego QPixmap nie działa. QStringList zawiera ścieżki, a obrazy są formatu .jpg