PDA

View Full Version : Pth to input files



game
18th December 2012, 09:07
Dear Forum supervisors and users,

I just started using Qt and this forum too.

Currently, i want to write a program which depend on Qt which later on let us to develop GUI easily.
For now I am just using input/output console to view the results and use other softwares for visualization,

My Current difficult is how to read files by definining PATH to the file directory.

I am using the opencascade libraries to read the file!
And I am using the following code to read my file at the defined directory.

IGESControl_Controller::Init();
IGESControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile("/home/de052/Desktop/cd/original/KCS_simman.igs");

Now I want the user to defined the directory not like above static.

How can i do that in Qt programming environment, mind i don't need GUI for now!

I want the user will define the path.

Any help please

Santosh Reddy
18th December 2012, 11:08
Do you mean user will enter the path at run time? Can you use C++ Basic IO (http://www.cplusplus.com/doc/tutorial/basic_io/)

Not sure if I understood your Q

amleto
18th December 2012, 12:30
as there is no Qt in code, you can continue to not use Qt and get user input using std::cout and std::cin.

Since there is no Qt question here, it is a bit strange that you came to this forum.

game
18th December 2012, 13:19
Yes You got my idea!

How i can use it,
String Driectory;

cout<<" Enter the directory of your file";
cin>>filename;

IGESControl_Controller::Init();
IGESControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile(filename);

It doesn't work like this

What is the problem

wysota
18th December 2012, 13:57
What do you mean by "it doesn't work"?

amleto
19th December 2012, 00:31
Yes You got my idea!

How i can use it,
String Driectory;

cout<<" Enter the directory of your file";
cin>>filename;

IGESControl_Controller::Init();
IGESControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile(filename);

It doesn't work like this

What is the problem

The problem is you didn't write compilable c++.