FAQ Database Discussion Community


check if a file extension is part of a given list

qt,file-extension,qlist,qfileinfo
I am trying to make a simple widget which contains a lineedit which shows the file name and a button to open a filedialog. and now I want to check if the file-extension is valid, in this case, a image file ending with jpg, png or bmp. I solved this...

segfault accessing qlist element through an iterator

c++,iterator,qlist
I get a segfault while iterating over a QList. I don't understand what I am doing wrong. I have a QList of Conversation. Inside a Conversation I have a QList of Msg. Below are the class description : Msg class : class Msg { public: Msg(); Msg(const Msg& other); Msg&...

Cleaning up QList and QGraphicsScene to avoid memory leaks

c++,qt,pointers,qgraphicsscene,qlist
I want to be thorough and clean up to avoid memory and object leaks. I had the misunderstanding that Qt cleans automatically objects that go out of scope, except pointers need to be deleted manually. In my code I have a number of QList... example: void someFunction() { QList<int> x...

Can't create QList with custom class

c++,qt,qlist
I'm trying to create QList of custom class objects, but I got error: error: C2923: 'QList' : 'Read' is not a valid template type argument for parameter 'T' My code (User header): #ifndef USER_H #define USER_H #include <QString> #include <QList> #include "read.h" class User { protected: int id; QString username;...