You are not logged in.

Kris

Unregistered

1

Saturday, May 7th 2005, 10:09am

statusbar

Hello, i want to show a status if i click a button.But dont works:

void Form1::createStatusBar()
{
statusBar()->message( "Ready", 2000 );

}

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

2

Saturday, May 7th 2005, 10:38am

RE: statusbar

It does work for Qt examples. If it doesn't in your case, then something's wrong in the rest of the program. It's hard to tell what without seeing the program.

Just one thing that may help: Does

Source code

1
Form1::createStatusBar()
return to the event loop in your code? How exactly do you know it doesn't work?

kris

Unregistered

3

Saturday, May 7th 2005, 10:40am

RE: statusbar

i have forgothen the class for <qstatusbtar.h>

thanks

kris

Unregistered

4

Saturday, May 7th 2005, 10:54am

RE: statusbar

but in the main.cpp dont work!

#include <qapplication.h>
#include <qsound.h>
#include "form1.h"
#include <qstatusbar.h>
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
Form1 w;
// w.show();
w.showMaximized();
QSound::play("sounds/refuge.wav");
statusBar()->message( "Ready", 1000 );
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}

blue death

Beginner

  • "blue death" is male

Posts: 51

Location: somewhere in space and time

Occupation: cs-student

  • Send private message

5

Saturday, May 7th 2005, 11:49am

try setting the statusbar message in the Form, not in the main.
im not sure, but i think it won't get displayed if called from main because Qt hasn't yet initialized and drawn the main window.
don't dream, if you want your dreams to become true

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

6

Saturday, May 7th 2005, 12:06pm

RE: statusbar

Quoted

Originally posted by kris
i have forgothen the class for <qstatusbtar.h>

Do you mean it was a compile-time problem???

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

7

Saturday, May 7th 2005, 12:07pm

RE: statusbar

Quoted

Originally posted by kris
but in the main.cpp dont work!

Is this a compile-time or a run-time problem?

kris

Unregistered

8

Saturday, May 7th 2005, 12:11pm

ERROR: ->message musst show to a class

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

9

Saturday, May 7th 2005, 1:18pm

Quoted

Originally posted by kris
ERROR: ->message musst show to a class

Is the error message? Please copy/paste so that we can see the complete and exact error message, not an approximate transcritption of it.