LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-03-2008, 05:26 AM   #1
sai_tejas
LQ Newbie
 
Registered: May 2008
Posts: 23

Rep: Reputation: 15
ProgressBar in Qt


Hiii friends..

i ve been trying to use progress bar in Q but without any luck.
Hope Someone of u will help me.
Well the problem is
Iam trying to copy a big file using scp in Qt prgm.
and i have to show a progrees bar or status of copying and iam unable to do it.


Example:
scp -r /xyz 10.133.453:/root

As the file iam copying is huge ,i want to make use of a progress bar to show the progress...

Thank you in advance..



Bybye
 
Old 07-03-2008, 11:25 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
There is a QProgressBar class in QT, but you need to set the minimum and maximum values, and then as your long-running task runs, call the setValue appropriately. So the question is not really about QT - the question is:
Quote:
Originally Posted by the real question
How can I programatically get the minimum, maximum and progress values from scp as it runs?
Right?
 
Old 07-04-2008, 12:05 PM   #3
sai_tejas
LQ Newbie
 
Registered: May 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Hey..i am exactly right...u got me wrong..


its iam using system("scp xxxxx")in a qt graphical application fior coopying some stuff on to the remote machine...
and i wanted to set a progress bar during this time

How tro set a progress bar when some task is processing
 
Old 07-04-2008, 04:12 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
You want to have a tty embedded in your app?
 
Old 07-06-2008, 04:41 AM   #5
sai_tejas
LQ Newbie
 
Registered: May 2008
Posts: 23

Original Poster
Rep: Reputation: 15
What r u saying....
I guess you didnt get my question..
Why do i need a tty?
system("scp xxxxxxxx"); works in qt program...



Thnks
 
Old 07-06-2008, 04:54 AM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Using system to call scp may work, but the progress bar it displays is printed to standard output using tty control codes to draw the progress bar (e.g. moving the cursor back to the beginning of the line when updating the output).

If you want to see the text-mode progress bar which scp displays, you will need a terminal to display it, or to get your program to parse the raw output of scp to determine the progress, and somehow display the progress yourself.

To use a terminal, just modify your system call so it runs the command in a terminal:
Code:
system("xterm -e scp ...");
 
Old 07-07-2008, 05:16 AM   #7
sai_tejas
LQ Newbie
 
Registered: May 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Thanx mite...Will try that..
But i need a solution for graphical progress bar ...



And hey...i have a pdf file ,how to take a print out using Qt..
The only option i have is using
system(lp .........);
Any other way...
Do tell me buddy
 
Old 07-07-2008, 05:21 AM   #8
sai_tejas
LQ Newbie
 
Registered: May 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Will try it..
Any other way to hsow a graphical progress bar...????


And hey..
i also have another doubt..i have a pdf file in certain location
and i need to take a print out of it
with my own push button
Right now i ve just connected the button to a slot which is something similar to
slot()
{
system(lp source dest)
}
Any easy way to print using QPrint class.....

If u know it can u just reply me with the code u reckon..

Thanks
 
Old 07-07-2008, 05:47 AM   #9
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Quote:
Originally Posted by sai_tejas View Post
Will try it..
Any other way to hsow a graphical progress bar...????
The possibilities are limitless, but you would probably do best to use a QProgressBar.

Quote:
And hey..
i also have another doubt..i have a pdf file in certain location
and i need to take a print out of it
with my own push button
Right now i ve just connected the button to a slot which is something similar to
slot()
{
system(lp source dest)
}
Any easy way to print using QPrint class.....

If u know it can u just reply me with the code u reckon..

Thanks
Using lp would probably work, although it's not portable to windows, and it's not going to give you good feedback on errors. To insulate you from platform-specific details like lp, you should use the QT printing system. Having said that, I've not used it so I cannot advise on this. You should browse the QT documentation.
 
Old 07-07-2008, 06:04 AM   #10
sai_tejas
LQ Newbie
 
Registered: May 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Well the main idea behind the progress bar is te report generation...

Will explain it to you clearly.

Iam using Jasper reports for report generation and java is the back bone for jasper,
as iam using qt and c++ prg IN LINUX for my prjoect ,iam calling a shell script ,which inturn calls a java code and generates the report.

its similar to below code..
QPushButton pb;
connect(signal(pb)slot(xya());
xyz()
{
system(sh /root/generatereport);
}
generatereport is a ashell script i.e(it calls a java source code)
it takes some time to generate a report as it check the database and pdf is generated.]

dURING THIS TIME I NEED A PROGRESS BAR
 
Old 07-07-2008, 06:23 AM   #11
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
QT is not magic, it must have some sort of input which tells it how must is complete.

Does Jasper reports produce some output which can be used for this (I have not used Jasper reports, so you will have to tell me).
 
Old 07-08-2008, 08:40 AM   #12
sai_tejas
LQ Newbie
 
Registered: May 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Hey.it takes input from database and size of the database changes dynamically...
If it seriously requires Jasper produced output , i dont think it will work out for me..
I just know that java code is called ,it checks the database and all thsese database table's data is taken as input for forms.
These forms are filled and Report(pdf) is generated
 
Old 07-08-2008, 08:48 AM   #13
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Well, QT is a fine framework, but like I said, it is not magic. To display progress of a process which has been called from your QT program, the QT program must be able to get access to some progress information somehow.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
progressbar munna_dude Linux - General 3 06-22-2007 05:44 AM
BASH progressbar TheSpork Linux - General 2 10-09-2005 11:15 PM
bootsplash OK but progressbar not working sigeberht Slackware 4 06-27-2004 07:51 AM
where can find out a progressbar like this quietheart Linux - General 1 02-22-2004 07:11 AM
bootsplash progressbar bugyugo Red Hat 0 12-08-2003 07:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration