January 14, 2012

shankarraj shankarraj
Lab Rat
22 posts

not able to view progressbar

 

My parent widget is having Qt::FramelessWindowHint as windows flags. In this widget: I display logo in full screen[image set to a label control].Logo is displays with black background.I have a progressbar which is set with following stylesheet:

  1. QString("QProgressBar { border: 1px solid green; background: red; padding: 1px; text-align: left ; } ") +
  2.                              QString("QProgressBar::chunk:horizontal { background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 red, stop: 1 yellow); } ") +
  3.                              QString("QProgressBar::chunk:indeterminate { background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 red, stop: 1 yellow); }"));

Also: I set windows flags to progressbar as progressBar->setWindowFlags(Qt::WindowStaysOnTopHint);

But I am not able to view the progressbar in the widget when I run the program. Can somebody help.

3 replies

January 14, 2012

Rahul Das Rahul Das
Robot Herder
362 posts

can’t make out from the style sheet alone. After all, style sheet just tells us how it should look like when it is shown.

You could use @ tags so that , your code will be readable.

 Signature 

——————————-

    Rahul Das

——————————-

January 14, 2012

shankarraj shankarraj
Lab Rat
22 posts

I did not set any windows flags to my main widget. I have initially one label which covers entire widget[it has same width & height as main widget].That label contains logo. I will have to show progressbar in the middle of the widget. When I execute the program: I am able to view the logo. But progressbar is not shown. Can somebody assist to resolve this issue.

January 14, 2012

Rahul Das Rahul Das
Robot Herder
362 posts

The tags i meant is about posting your code in the forum. like this:

  1. QString(QProgressBar { border: 1px solid green; background: red; padding: 1px; text-align: left ;})

Okay, you have a Main Window, inside one full screen label too. Above this, about the center one progress bar which is not visible.

May be it is hidden , and have you tried QWidget::raise () [developer.qt.nokia.com]

Alternately you can use QProgressDialog too

 Signature 

——————————-

    Rahul Das

——————————-

 
  ‹‹ [SOLVED] need help with some container errors      [Solved] [Moved] cannot declare QDeclarativeView into stack ››

You must log in to post a reply. Not a member yet? Register here!