PDA

View Full Version : How to work with files



artt
23rd March 2015, 01:46
I am newbie to Qt. So I would like to ask how create the app that would display (indx) the file system (or some directory). Then it should write this file to XML (with name, size etc). This app should also has capability to search for file. So I want to one how to create such application, what components of Qt I should use, where I can refere for similar examples, especially for this 3 issues and creating such interface. How much work it needs and how many files I should create?

DoomerDan
23rd March 2015, 11:34
Sounds like homework. What have you done so far?

d_stranz
23rd March 2015, 17:30
Sounds like homework.

No! Someone wouldn't actually post a homework problem here and expect us to feed them the solution, would they?

wysota
23rd March 2015, 17:42
I don't think they would. Everybody knows rules of this forum forbid to post solutions to homework. :)

artt
24th March 2015, 00:27
Really I can do it at home, at library. But it is not the homework, but the presupposition for the potential employment. But I am familiar with C++ just theoretically, and now I need to write this app even in unnnown for me, Qt (now I just try to free the space for Qt installation). So I would like to have some help here -- at least theoretically. How much files (.cpp, .ui, .h) I should create here, what components for the UI I need use, and how they should be connected with the code itself. What IDE I need- f.e. Codeblocks or Qtcreator. And the main--how to index the file system in the whole or locally (in some directory), how transfer this file description to xml, and search it (by name probably)? So I do not ask to do it for me, but theoretically as far as possible to explain and refer to most appropriate similar code --as I have just few days for it and it is very important for me.

stampede
24th March 2015, 00:46
But I am familiar with C++ just theoretically
Sorry, but I think it will be almost impossible to use Qt if you don't have any practical experience with C++.

Anyway, as for the IDE, I'd choose QtCreator.
First I'd try to get familiar with Qt by studying some simple examples, you will have plenty of them in your Qt installation folder.
As for your main task, here are some useful classes: QDir (http://doc-snapshots.qt.io/4.8/qdir.html), QFileInfo (http://doc-snapshots.qt.io/4.8/qfileinfo.html), QFileDialog (http://doc-snapshots.qt.io/4.8/qfiledialog.html), QFileSystemModel (http://doc.qt.io/qt-4.8/QFileSystemModel.html), QXmlStreamWriter (http://doc.qt.io/qt-4.8/QXmlStreamWriter.html).
Regarding the ui, I'd start with something very simple, like having just single button to browse for existing folder and tree view to display the folder contents, and then you can build more complicated functionality based on that.

artt
24th March 2015, 02:11
http://het.as.utexas.edu/HET/O_M/Operations/html/xmlpatterns-filetree.html -- Can such files be some patterns for the app structure? Or this-- http://doc.qt.digia.com/qt-5.2/qtxmlpatterns-xmlpatterns-filetree-example.html -- for the displaying file system? I think the indxing should be done in some simple way or it need some particular file? Then I need QXml probably with QFileInfo function. And as far as I know it superficially the search should be done by Xqueries as I did not found any information on search in qt files.Then I need the outlook of my UI -- probably the button for the indeexing, converting to xml, and the field for the search and field for the results for thee tasks (at least for the last one). Then the structure of app is also important except the code itself as I was tasked that such app should be relatively easy in Qt?

artt
24th March 2015, 12:38
Any suggestions? Would show any framework for this app, at list nessesary functions, then I would handle it be myself?

d_stranz
24th March 2015, 17:24
Your Qt installation comes with a whole slew of examples. Look at the DirView, File System, and maybe the XML Schema Validation examples. There is a Getting Started with Qt Widget tutorial, also installed with your Qt distro.

artt
24th March 2015, 18:37
But what the indexing of file system means -- how I should do it exactly? Should I do some DB of all files of disk or directory -- or directory files should be dislayed in some UI window with some files pictograms as usual windows?
And I have recently seen that search aslo could be done by QFileInfo, despite it has such attributes as size, path of files.
What main fuctions I should use: funct1 (Q...1), func2 (Q..2) XML, func3 (Q..2) search?
If I use Qcreator -- how connect it with the code? And the important questions is shoudl I use a lot of signals or slots as this constructions is new for me?
So the first task--hwo to index the file system ...then it would be more understandable for me as to do evrything else

stampede
24th March 2015, 19:49
What main fuctions I should use: funct1 (Q...1), func2 (Q..2) XML, func3 (Q..2) search?
If I use Qcreator -- how connect it with the code? And the important questions is shoudl I use a lot of signals or slots as this constructions is new for me?
With your lack of experience in Qt I suggest you to start with something basic, like selecting a file and displaying its stats (name, size, creation date etc) in a simple widget. You know, "Rome was not built in a day."

artt
24th March 2015, 21:17
So what is indxing? If I need to use such attribute as path then I should present all the files (It is something like QSystemModel with List or TreeView?). And I do not understand what to "write file to xml" -- the content or its name., path etc? If in aforementioned tutorial there is xml widget.ui, so I understand that these ones should written as some property with these attributes in one list(file). So I need some input for the name of file system or the selector of disk C,D,F at the beginning.
As the result the simple examples are in books and tutorials but I need to know the concept of the application with the main qt parts. For example you mentioned the Qtdesigner but it does not have no code extractor so what is the sense of it. And another issue -- does Qt have no exception hadling, as it do very complex the applications? For example during the inputing the disk name or file for the search that is so important in java.

Added after 25 minutes:

So what is indxing? If I need to use such attribute as path then I should present all the files (It is something like QSystemModel with List or TreeView?). And I do not understand what to "write file to xml" -- the content or its name., path etc? If in aforementioned tutorial there is xml widget.ui, so I understand that these ones should written as some property with these attributes in one list(file). So I need some input for the name of file system or the selector of disk C,D,F at the beginning.
As the result the simple examples are in books and tutorials but I need to know the concept of the application with the main qt parts. For example you mentioned the Qtdesigner but it does not have no code extractor so what is the sense of it. And another issue -- does Qt have no exception hadling, as it do very complex the applications? For example during the inputing the disk name or file for the search that is so important in java.

artt
25th March 2015, 14:41
Let it be. The Qt designer has the code viewer. But when I compile it the widget.ui transforms in widget.h. But How I can extract this last one--and what is difference between widget.h and widget.cpp.
After the readinf several books on Qt development I undestand that I should use here the file listing that should be indexing.
The finction Qdir that has ::disks method that view the content of disk then by use if (isdirectory) list this to the files, if it is the file show its attribute: name, size, path -- with Qfielinfo. So it should be like TreeView --that I should place in one window. So I should use the splitter for listed (indexed file). Then I should convert it in XML (probably DOM). But should I show the list of XML in particular window or just have the button--"write to xml"? Then I should use the search ability in XML (that is possible to some book) and display it in particular windows. So here I should have the textfield for entering the filename for search and label field for the dislaying the results. But should I convert the searched file from the xml to the list view. So here my more cleared vision of teh apps. The additional question is should I use the Q_Assert instead the exception handling?

Why we need so detailed .h (and what to include) in addition to .cpp file, and how to convert the listed file system to xml is the main two issues just now for me?
Is possible to use Qcreator for it?
People I need your help as task is diffciult, but also too important for me.

d_stranz
25th March 2015, 17:03
The problem we have with what you're asking is that you know so little about C++ and Qt that we have nowhere to start. We can point you to example and tutorial code, but we can't write the code for you. And the questions you are asking are so unfocused that it is impossible to answer them. You're trying to run when you aren't far enough along to even crawl yet.

As for what you write to XML - I am certain that the goal is not to write the contents of the files to XML. That's nearly impossible given the infinite variety of file contents and the fact that for most of them you have no idea how the content is formatted. Almost certainly, the requirement is to reproduce the hierarchy of the file system as XML. So you will need XML elements for "directory", "file" and maybe "symbolic link". For directories, you'll need attributes for number of files and directories contained within them. For all three, you'll need an attribute which describes the file system permissions attached to the object: read only, writable, executable, system, hidden, etc. and a creation / modified date attribute. For Files, you'll need to add file size, file type, and other attributes.

To select the directory to get this started, use QFileDialog, and restrict it to look at directories only. Once you have a directory name, use QFileSystemModel and its setRootPath method to load it. Whether you choose to display the model on screen or not (use QTreeView if you do) isn't particularly relevant unless the problem calls for it. There is no Qt class that I am aware of that will traverse a QFileSystemModel so you can serialize it somewhere. QTreeView does this, but it will do that with any tree-structure QAbstractItemModel and has no clue what the model contents mean.

You then need to write a class that takes this model, traverses the hierarchy and writes it to an XML document (use QXmlStreamWriter or QDomDocument and related classes). There is no XML schema that describes this - you'll have to design one - basically using the ideas I stated above. You'll use the QFileInfo provided by the QFileSystemModel for whatever index you're looking at to extract the information about the node in the file system tree.

Good luck.

artt
25th March 2015, 18:13
Thanks for clarification. The problem is that untill now I did not used Qcreator --maybe it could simplify significially this task?, as well as I am using Qt4 (CodeBlocks) that frequently emits the error -- such as QHBox is not supported or so. Really I did not written the real applications in C++, so I need to know main components and the potential size of application (how many strings about is also very interesting!). What about the last commnet I think that I need to show the file tree (list) to make visible that I indexed the file system. Then I should make pushbutton "write to XML" (I think this results also should be visible in some way, despite the files should be in a very big amount) -- But at this stage I would like to know how simply link the files properties (name, size) with the DOM-XML classes and functions. And the last task -- to search -- it also would be relevant to show how search the file name and display it correctly. In this vein I think that the parent classs QHBOX will be appropriate to use but it seems not supoported in Qt4.
And of course the structure of app is also unknown for me -- could I use just .cpp file, if not what I should write in.h file?

Lesiok
25th March 2015, 19:14
artt, You are trying to build a nuclear reactor without knowing the basics of physics and mathematics. Do You understand the allusion ?

artt
25th March 2015, 20:26
You probably overestimate the issue for me. I ask here the algorithm not code. I see my task that I should make one window with button to index the files or select the drive. Near that button I see the display of file tree. But it is gui. But what I should use in Qt for the file description – the some structure (or list) with the fields of number, name, size, and path? Then it should be written in some file. Then I write this file to xml in some way where properties of every item should be (converted from) name, size, and path. Then I write xml to another file. Then I make the field for the search of file name and the sub-window for displaying the results (and code for the function that search the file name in properties of file). That is my vision – if I am grossly incorrect you can show it. I write it everything as it is very difficult for me but it determines in some way the further experience as programmer// If it is better to write such app in sharp or java, it could be the option. If it is possible to make a lot of things in qcreator (as it was said at the beginning) I would do it as now has the problem with the msvcp100.dll despite copied it to bin and system folder. And I do not understand why I cannot write private messages.

Added after 7 minutes:

You probably overestimate the issue for me. I ask here the algorithm not code. I see my task that I should make one window with button to index the files or select the drive. Near that button I see the display of file tree. But it is gui. But what I should use in Qt for the file description – the some structure (or list) with the fields of number, name, size, and path? Then it should be written in some file. Then I write this file to xml in some way where properties of every item should be (converted from) name, size, and path. Then I write xml to another file. Then I make the field for the search of file name and the sub-window for displaying the results (and code for the function that search the file name in properties of file). That is my vision – if I am grossly incorrect you can show it. I write it everything as it is very difficult for me but it determines in some way the further experience as programmer// If it is better to write such app in sharp or java, it could be the option. If it is possible to make a lot of things in qcreator (as it was said at the beginning) I would do it as now has the problem with the msvcp100.dll despite copied it to bin and system folder. And I do not understand why I cannot write private messages.

wysota
25th March 2015, 20:38
You probably overestimate the issue for me. I ask here the algorithm not code.
The algorithm for what?


I see my task that I should make one window with button to index the files or select the drive. Near that button I see the display of file tree. But it is gui. But what I should use in Qt for the file description – the some structure (or list) with the fields of number, name, size, and path?
So... if you get the job and you get a task to do similar to this one, are you going to be asking at forums what data structures to use to solve that task?


That is my vision – if I am grossly incorrect you can show it. I write it everything as it is very difficult for me but it determines in some way the further experience as programmer// If it is better to write such app in sharp or java, it could be the option. If it is possible to make a lot of things in qcreator (as it was said at the beginning) I would do it as now has the problem with the msvcp100.dll despite copied it to bin and system folder.
The language doesn't matter. You can write the same program using asembly, C++, Python or whatever other general purpose programming language there is. I think the point of the task is to come up with a usable approach to indexing files. Whatever the author of the task meant by "indexing". Usually that means to generate a register allowing quick lookup in a large data set (just like an index in a book). I can also say there are many data structures useful for storing indexes. Which one to choose depends on a particular use-case and the underlying storage.


And I do not understand why I cannot write private messages.
I might be able to help you with that one if you tell me (e.g. using the Feedback forum) what error message you get or what else is wrong.

artt
25th March 2015, 22:02
So what structures I should use for indexing? As I have read the Qt has a 400 classes and tenfold of function of it. What about private messages -- when I send it the lsit of send messages is left with 0 ones (empty). Maybe its is due to not very big time at forum or a few messages. And what about work -- this task is the supposition for potential employment and that would be the realization of my university study.

stampede
25th March 2015, 22:59
As I wrote in the private message - please just start coding already. Show us that you have played around with examples, try to create something simple, something basic first and then move on to more complicated stuff.
You keep asking about "linking the code to ui" - just open any example in :widgets: section in Qt installation, try to change the code, compile and test, observe the behaviour and draw conclusions.
You can't solve this problem without getting your hands dirty.
Leave the "indexing" issue aside for now, try to create a simple app to display the file stats in a widget. I think this is the best way to know new library or framework, by creating more and more complicated stuff from basic "building blocks".

artt
26th March 2015, 00:00
i have some suggestions for my code. But After making the view of files in treeview or something else I do not know how or in what to write the information about file (Qfileinfo->name, Qfileinfo->size...) --In Qlist or in simple C++ structure? The next is how to transfer the such property as size or path to XML entity (and what entity it should be)--The structure (DOM)I see FILE SYSTEM--FILE--1) NAme 2) SIZe ...I written the Qlist to File then Open and written in XML--with what way or function correctly transfer the size field of Qlist to size property of XML File (as item of file system)? And for example I have Button Index that travers all files of File system in tree or list view. Can I simply transfer the code for such Window to see the index in such way as Number--Name--Size--Path?

Added after 6 minutes:

And about one thought: how vegin the traverse of files from first to last one. With while loop? For example I want to make the list of files (qlist). How to start the cycle in a code and and from what?

wysota
26th March 2015, 06:26
So what structures I should use for indexing? As I have read the Qt has a 400 classes and tenfold of function of it.
There is no QFileIndexForMyEmploymentTestTask class in Qt. Use your favourite web search engine to search for data structures to be used for storing indexes (e.g. in databases). Then when you have read about those structures, choose the one that best fits your purpose.


But After making the view of files in treeview or something else I do not know how or in what to write the information about file (Qfileinfo->name, Qfileinfo->size...) --In Qlist or in simple C++ structure?
Don't you think you should start with actually gathering information about the files?


And about one thought: how vegin the traverse of files from first to last one. With while loop? For example I want to make the list of files (qlist). How to start the cycle in a code and and from what?
QDirIterator could be a good place to start.

artt
26th March 2015, 14:30
If to use the DB it should be really difficult task. The problem is that I use Qt4 in CodeBlocks and the code emits such errors as Qdir or Qfileinfo is missing as librrary in include statements --so i do not understand is it deficiemncy of qt 4.8. libbrary or it is so bad linkage of Qt with Code Blocks as it frequently even make error on "Include <Qapplication>". The next issue is msvcp100.dll when launching Qcreator. I copied it to Bin and System32 folder but I couldnot register as it is connected with other dll in set. I could not see the dll properties in Total Commander as it in F3 command show the files such as .dat, .com but not dll.
But what is the starting file for iterator?
And I think that there should be some apps on the net that should be the pattern for me?

d_stranz
26th March 2015, 16:33
You know artt, you aren't listening to anything that anyone is telling you here. I gave you a list of Qt classes that will give you a hierarchical list of the files and directories starting at any point in the file system. I suggested some XML elements and attributes you might use to turn that hierarchy into an XML representation, and gave you Qt classes that would do that. Others have done the same.

The Qt Widgets examples (that I and others also referred you to) contain source code that will show you how to get the list of files in a directory, how to display those in a tree on screen, and how to extract information from the file system model. Other examples will show you how to make XML-based documents and files. If you choose to use a DBMS, there are examples and tutorials for that too.

Stop wasting your time and ours with questions, and start reading the documentation and exploring the examples and tutorials in your Qt installation. If you are getting errors in your use of CodeBlocks, then don't use it. Use Qt Creator instead. When you install the Qt full distribution, it will install Qt Creator and figure out where you have Qt installed so that the right headers and libraries are pulled into your build.

Once you have Qt Creator configured to point to your Qt install, open one of the example projects and simply build it. See what it does, look at the source code and learn how it does it.

wysota
26th March 2015, 17:04
If to use the DB it should be really difficult task.
I didn't tell you to use a database. Read my post again.

Lesiok
26th March 2015, 17:12
msvcp100.dll is a part of Microsoft Visual C++ 2012 Redistributable package. Get it from Microsoft page and install.

artt
26th March 2015, 18:59
I have this .dll but it is connected with other dll-s, and I do not know with which ones?
It is not very efficient to download the whole package.
I have read one tip about not workable Qdir -- "g++ seems not find the Qt include files" --taht should be so. Cause when I
installed the whole Qt it showed that g++ is found at C:\MinGw, despite the mingw folder was in C:\CodeBlocks\...MinGW, that I noted during the instllation. So really I need to check this one and its workability, as I creted all programs in CodeBlocks even OpenGl. Moreover the Qcreator is not working.

jefftee
26th March 2015, 19:08
Clearly you have a bastardized/broken installation of Qt and Qt Creator. I would recommend you start from scratch and download a copy of Qt from here:

https://www.qt.io/download/

You should at least verify a working Qt library / Qt Creator setup before you continue to try to use Code::Blocks. i.e. If you can't get Qt Creator to work with a fresh install, then you're wasting your time trying to get Code::Blocks working with the same broken install.

artt
26th March 2015, 19:29
Here is code: from the html-help:
#include <QDir>
#include <iostream>

int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QDir dir;
dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
dir.setSorting(QDir::Size | QDir::Reversed);

QFileInfoList list = dir.entryInfoList();
std::cout << "Bytes Filename" << std::endl;
for (int i = 0; i < list.size(); ++i) {
QFileInfo fileInfo = list.at(i);
std::cout << qPrintable(QString("%1 %2").arg(fileInfo.size(), 10)
.arg(fileInfo.fileName()));
std::cout << std::endl;
}
return 0;
}
///To begin with processing the disk it should be
added such piece of code at the beginning.
foreach (QFileInfo drive, QDir::drives ()) {qDebug()}<<"Drive: " << drive.absolutePath();
QDir dir = drive.dir();
dir.setFilter (QDir::Dirs);
//But to roll up the directory to conating files I need to include something like that: if (fileino==isDirectory) and for loop.
And I do not understand what means the "args(fileinfo..)".
But it is the way to display such list, but what about to write it to some structure like that
struct { int num; char* name; double size; char* ablolutepath}.
And I would like to place combo-box in UI to choose the disk -- but if it is not appropriate can aforementioned code sort the files by name in one list from all disk?

Added after 9 minutes:

"Clearly you have a bastardized/broken installation of Qt and Qt Creator" -- I used the installation from arhive of official site. Qt4-because my codeblock just have Qt4 pane. I really think that the problem is in the linkage of compiler (g++). But it is really funny that during install it found MinGw in absent folder on the very C disk, despite the folder was at C:\CodeBlocks\MinGw.

jefftee
26th March 2015, 19:49
You need to add QDir::Dirs or QDir::AllDirs if you want dir.entryInfoList() to return directories as well as files.

Did you look at the documentation for QString to see what the QString::arg() method does?

Your example code seems very confusing to me. QDir::entryInfoList is used to return a QFileInfoList, which is a list containing a QFileInfo for every file and/or directory matched by the filters you set. A basic example of what I *think* you are trying to accomplish is:



void process_dir(QString path)
{
QDir dir(path);

if (!dir.exists())
{
qDebug("Directory does not exist: %s", qPrintable(path));
return;
}

dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks | QDir::AllDirs);
dir.setNameFilers({"*.*"});
dir.setSorting(QDir::Size | QDir::Reversed);
QFileInfoList list = dir.entryInfoList();

for (int i = 0; i < list.count(); i++)
{
QFileInfo fi = list.at(i);
if (fi.isDir())
{
process_dir(fi.absolutePath()); // if this QFileInfo is a directory, descend into the directory recursively to traverse all files/directories
}
else if (fi.isFile())
{
// if you get here, the QFileInfo is for a regular file, so do whatever processing you need to do for a file
}
}

return;
}

When you first call the process_dir method above, pass it the root of the file system you want to process (i.e. "C:/" or whatever).

Hope that helps.

artt
26th March 2015, 20:11
What do means the function arg () -- I can not find in internet --some (string) formatter?
Can the passing root folder to lead to showing the whole file system? (maybe pass something upper then disks or "all directories"). What about my code -- it is from the help of qt installation. But really without workable Qcreator and codeblock it is difficult to teach something (maybe the latest Codeblock with Qt5 would be helpful).
Moreover here also such stipulation -- the interface should be no-locking so I understand that I need to use the threads here?
What about your code I hope it help -- but could you reformat this code to write in this loop this qfileinfo in structure {} INDEXER of kind I refered above -- that would be part of some Qlist (QVector)<INDEXER> fi; fi.append (Qfileinfo.name, Qfileinfo.size...). Then to write to the file and translate Qlist items into XML?

jefftee
26th March 2015, 20:19
What do means the function arg () -- I can not find in internet --some (string) formatter?
Did you click on the link in my prior post? It links directly to the QString:arg() documentation. Why you would waste your time searching for arg WITHIN THE ENTIRE INTERNET when I gave you a link for the documentation is incomprehensible to me.

And sorry to disappoint you, but if you think you are going to be able to wrap your head around implementing this using threads given the general lack of understanding you have demonstrated throughout this forum thread, I'd say your odds of success are slim and none and slim just left... :)

Learn to crawl, then walk, then and only then should you attempt to run...

P.S. Stop cobbling together code from google search mashups if you don't have any idea what the code is doing.

Edit: Sorry for multiple edits, but still finding nuggets in your response I did not address... No, I will not rewrite the code for you. I've given you a simple example that should be enough to get you started if you have any programming abilities at all. If you can't start with the example I gave you and accomplish what you want, then I am afraid I can't help you any more.

artt
26th March 2015, 23:05
Sorry but arg() is not very important.
You asked code I delivered it.It is not code from internet no mine --it is from qt installation examples help.
So we have make more clearer the first task of indexing. So I asked could we write this file properties (Qfileinfo) in Qlist and the context of the code you delivered? Then I need write it to the File so due to the examples in internet I should overload the operator>> in qt. then when Opening the file for XML conversion i should probably made the type-cast to appropriate type when reading from file.
Is I am not correct? Or maybe for writing to XML I need create the DOM-Tree that I do not suppose how to do (except to do it in the same loop but by adding such as "xml tag" = Qstring Qfileinfo.name). Can I directly to convert tree-view to DOM, or write by nyself all qfileinfo into XML file, despite the esiest way is to use QXMLStreamWriter?
Anyway without workable Qcreator or CodeBlock it doesnt matter. You can help if download the dll and connected ones for msvcp100 from VS, and make tip for me how to correct the g++ linkage in QT installation - there should be some customize function for Qt? And talking about code -- I need this snipet as without workable compiler it is important, and even in my app I should not preesent too workable one, but I need probably show my vision and skillts to code, despite my expreience is confined to small programs incomparble to this one.

artt
27th March 2015, 09:44
You can see this posts as rambling but what can I do - but what to do if no codeblock no qcreator works. Then I really could not see even the structure of ordinary qt file. Should I have here the project file? Should .h files to be confined to declaration of main classes. How many .cpp files i can have here or can I include all code to main window? What about code I would like to know whether I can make the similar cycle for converting qfileinfo to xml tags? Despite I have in my task to write the file to xml. <file system> <file> <name> lessons<name/> <size> 700 kb<size/> <path> E:\folder1 <path/> <file/> and next file tag ? <file1> or also <file>...<file system/>

anda_skoa
27th March 2015, 10:01
These posts are not rambling, they are trolling.

You are not actually interested in any help, you just try to see how long you can keep people replying to repetitions of the same content.

I have to commend the other posters who are giving you the benefit of the doubt despite the obviousness of the trolling attempt.
Or maybe they are reverse trolling and want to see how long it take before you become bored of trolling :)

Cheers,
_

artt
27th March 2015, 14:10
I even do not know what means "commend" (not native english speaking), as well as trolling. The last means that I do not use it anyway and anywhere. If my qcreator do not work I even cannot see what is the real structure of qt apps. Really, I do not know how create .pro file, what exactly should be .h files except class declaration. So I induce other ones to suggest me. If I ask code I ask it to design my apps (despite even through several pieces) at least theoretically. If I do know about how index the files, then I need to know how create the whole structure of this data (some class) and how write and then read from the file. But there is sample of it in the i-net. But how wright it to xml -- I have not examples. Through I need it as it is the first app for me. And of course the gui for every stage of this action is also interwsting for me -- and how to connect it with code -- with the slots and signals? So that is all question for me at this moment.

Added after 4 minutes:

If questions for the code is irrelevant for the forum -- the forumers could help with why I cannot link qt classes in Codeblocks--if there is such pane--I think it should be workable for the CB. Despite I have Dev C++, and maybe are other ide that would work with qt and properly. So https://netbeans.org/kb/74/cnd/qt-applications.html?print=yes -- such resourses could have some tips how resolve the qt issue in CB -- in this instance the inclusion of MinGW folder to environment path -- but you could propose other suggestions.

d_stranz
27th March 2015, 15:32
My last post in this thread.

Artt:

1 - Install a new, fresh, COMPLETE version of Qt. DO NOT CONTINUE TO USE YOUR BROKEN, OLD, COPIES OF Qt and Code::Blocks. Why do you stubbornly stick to the same thing when it doesn't work???

2 - Once that is done, start Qt Creator, load one of the existing example projects, configure it, build it, and run it.

3 - Once that is done, look at the example source code, read the Qt documentation and work through the tutorials.

By the time you have successfully completed these three SIMPLE steps, maybe you will have learned enough about C++ and Qt to make an attempt at doing the project you have in mind.

But, I must tell you, with the attitude you have shown in your posts, your unwillingness to listen to anything we are telling you, and your stubbornness in trying to chase this confused goal of yours without the knowledge needed to do it, you are going to fail. If you do apply for a job in this area, your lack of skills and unwillingness to learn from others will be obvious.

artt
27th March 2015, 19:58
It is not the stubborness -- it is the nessesity to do it despite no time no Compilers do not afford it. Yes I will install cb 12 or 13 version, try to install qt5 despite it size is twice as qt4, and new creator. Or try to use with "dev cplus". But if that do not help ... Maybe i need to use qt3 as the problem with qt5 is common as seen on the net. But I think it is the issue with mimgw (g ). And from your side you could download the msvcp100.dll with related ones. Anyway maybe the any separate installation require this dll if no VS on system. So I think to change a lot is not the way out as it has probably far more easy way...If I have knowledge then I ask it. So how to translate qfileinfo.name/size to the tags <name> / <size> is relatively too difficult to me at that moment. So I need to see as it looks like. As well as about classes. Should I create separate classes for indexing, xml translating and searching in separate .cpp and .h files as I am accustomized that in java several classes could be included in some general class. And last one: could I use just one thread in that app if no: how many it could be?

It is not the stubborness -- it is the nessesity to do it despite no time no Compilers do not afford it. Yes I will install cb 12 or 13 version, try to install qt5 despite it size is twice as qt4, and new creator. Or try to use with "dev cplus". But if that do not help ... Maybe i need to use qt3 as the problem with qt5 is common as seen on the net. But I think it is the issue with mimgw (g++). And from your side you could download the msvcp100.dll with related ones. Anyway maybe the any separate installation require this dll if no VS on system. So I think to change a lot is not the way out as it has probably far more easy way...If I have knowledge then I ask it. So how to translate qfileinfo.name/size to the tags <name> / <size> is relatively too difficult to me at that moment. So I need to see as it looks like. As well as about classes. Should I create separate classes for indexing, xml translating and searching in separate .cpp and .h files as I am accustomized that in java several classess could be included in one general class. And the last one: can I use just one thread in this app, if no: for what purposes I need additional threads to make app non-blocking?

Added after 4 minutes:

It is not the stubborness -- it is the nessesity to do it despite no time no Compilers do not afford it. Yes I will install cb 12 or 13 version, try to install qt5 despite it size is twice as qt4, and new creator. Or try to use with "dev cplus". But if that do not help ... Maybe i need to use qt3 as the problem with qt5 is common as seen on the net. But I think it is the issue with mimgw (g++). And from your side you could download the msvcp100.dll with related ones. Anyway maybe the any separate installation require this dll if no VS on system. So I think to change a lot is not the way out as it has probably far more easy way...If I have knowledge then I ask it. So how to translate qfileinfo.name/size to the tags <name> / <size> is relatively too difficult to me at that moment. So I need to see as it looks like. As well as about classes. Should I create separate classes for indexing, xml translating and searching in separate .cpp and .h files as I am accustomized that in java several classes could be placed in one general class. And the last one: can I use jus 1 thread in this app-if no- for which additional purposes I need create additional thread to make app non-blocking?

wysota
27th March 2015, 20:48
It is not the stubborness
What is it then? You have been told many time what to do and yet you decide to do something else. Even in your post that I quote below you decide to do something else than people are telling you to do.


it is the nessesity to do it
No, it is not necessity. Necessity is to eat, drink and breathe. Getting a job as a professional programmer is not a necessity.


despite no time
You don't have time to learn and you expect us to have time to give you advice you are going to ignore?


no Compilers do not afford it
All the tools you need are free (as in "free beer").


Yes I will install cb 12 or 13 version
That will not work for you again.


try to install qt5 despite it size is twice as qt4, and new creator.
Just click this link and start the installaton process: http://download.qt.io/official_releases/online_installers/qt-opensource-windows-x86-online.exe

Make sure the latest version of Qt is checked as well as the MinGW compiler (both should be checked by default so there is a good chance you can just keep clicking "Next"). You don't need to copy any libraries anywhere. When the installation completes, just click Qt Creator's icon in your Start menu (or equivalent). Then follow what others have already said regarding learning Qt.


Maybe i need to use qt3
Sure. Just remember that Qt3 for Windows is not available without a commercial license probably nobody sells anymore. And Qt3 probably won't run on anything newer than Windows XP (or even 2k).

Yeah, I can keep reverse trolling for a bit more :)

artt
28th March 2015, 12:56
Sorry for three the posts in one but it is due it was send from phone, where itwas not visible that they were delivered.
It is not stubborness. Moreover I hust seen that for my Qt 4.8.(3) I need the MinGw 4.4, despite actual codeblcok have 3.8 --s o during the installation it was seen it at C disk despite it was in Cb folder (so maybe it is the sign of brokeness) -- and the message was about the absence of the very g++ (compiler). So I need just to install 4.4 v. and show this folder for Qt as the simplest way -- and list to check this moment -- despite it is very interesting that Qdir, Qcoreapplication, Qfileinfo is not found, but the QtApplication, QtWidget is supported in CB.
And I also installed new Qtcreator but not fully-- but it was evoked as it the first case (that I forgot to mention) the "error during installation process (org.qtproject.qtcreator.application);
Execution failed (Unexpected exit code:1601): "D:\Qt2\lib\vcredist_msvc2010\vcredist_x86 /norestart /q" -- this instance of Qtcreator show the same msvcp100.dll error? I saw in the net the portable version of Qtcreator so maybe it is could be the way out -- but it was in pfaff extension file or so.

artt
28th March 2015, 19:27
It is not easy as it seems. Now I tried to install Qt5 where the Qcreator is essential -- the error appeared again. But when there were 79% of installation (MinGW) there appeared such error (at the atachment of image)-- so the installation apperead not disfunctional. And I understand that I probably cannot install Qt5 for my pc. So I need to reinstall Qt4. Error of QtCreator is stipulated due to the inability to install the VS redistributable pacckage (where is msvcp100.dll). It is because My Windows XP do not support, alot of time, the native MS installer -- so the only way out is to send installed package to me (through the private or so)-- where would be this and other dll. Or I will try to use the portable QtCreator from the internet. And there is such thing in Qt5 install.There is prebuild MinGW 4.8 that is checked, and MinGW 4.8 toolchain. So I understand I need also check MinGw toolchain (that is unchecked at the beginning) that is the compiler itself -but the error as seen the image is stipulated by one of MINGW part??

Lesiok
29th March 2015, 10:54
Using a computer with a damaged operating system is a bad idea. Start from repair (perhaps reinstallation) of the operating system.

artt
29th March 2015, 11:40
It is not big issue. The qtcreator now works after copying to bin folder 2 dll. The same situation is with qt libraries. The qt5 is baddly installed on my pc, so I need reisntall qt4, and with already installed minGW (despite there is MSYS--I do not know is it essential) I hope it would work.

wysota
29th March 2015, 22:47
It is not big issue. The qtcreator now works after copying to bin folder 2 dll. The same situation is with qt libraries. The qt5 is baddly installed on my pc, so I need reisntall qt4, and with already installed minGW (despite there is MSYS--I do not know is it essential) I hope it would work.

When you get your computer problems sorted out then come back and ask your questions. As for now there is nothing we can help you with. We're not dealing with fixing broken Windows installations.

artt
30th March 2015, 01:09
Really the problems are big. Despite it unlike connected directly with WIN XP.Despite creator opens --the profiel is not correctlyn installed -- so i do not know what install --just qmake or the whole QT. Then on COde block no including the GLOBAL variable, no additional defined folder in compiler oprtions do not help to launch and absolve--"Qdir is not found".

wysota
30th March 2015, 06:02
Fix your installation. Then choose an IDE you want to use. If you decide to use Code::blocks then you have to learn qmake first to manage your project manually. In this case you don't have to install Qt Creator, just the libraries, a compiler and whatever other tools you need. If you decide you don't want to spend time on fixing non-working things and would rather go directly to coding, install and use Qt with Qt Creator included which will also install and configure a working compiler.