You are not logged in.

1

Wednesday, June 15th 2005, 9:46am

disable Toolbar

Hello,

I want to click a button and disable the ToolBar.


I have try:

ToolBar->enable(false);


ERROR: ToolBar not declared
The left Part of ->enable have to show to a class.


my ToolBar name is ToolBar.What is wrong?



Thanks
believe in yourself

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

2

Wednesday, June 15th 2005, 9:49am

RE: disable Toolbar

Where did you put that code? In what function? Where did you declare that ToolBar variable?

Lord Palf

Trainee

  • "Lord Palf" is male

Posts: 81

Location: The Netherlands

  • Send private message

3

Wednesday, June 15th 2005, 10:24am

RE: disable Toolbar

Is the QToolbar variable Toolbar? Or is the QObject member name "ToolBar".

By the way, there is no function enabled(bool), I guess you mean setEnabled(bool). Try something like this:

Source code

1
2
QToolBar * ToolBar = new QToolBar(...);
ToolBar->setEnabled(false);


Don't forget to include <qtoolbar.h>
Debian/Qt3.3.4 + WinXP/Qt4

This post has been edited 1 times, last edit by "Lord Palf" (Jun 15th 2005, 10:25am)


4

Wednesday, June 15th 2005, 11:43am

"ToolBar" is the name of my object. Yes i have included the qtoolbar.h class

Like that i havent error but it not set false.Why?

QTollBar *ToolBar = new QToolBar();
ToolBar->setEnabled(false);
believe in yourself

5

Wednesday, June 15th 2005, 11:56am

I have in my widget 2 buttons and 1 ToolBar.


If i want to disable the 2. button it works.But i cant disable the ToolBar!

button2->setEnabled(false); //It works

"button2 is the name from the Object"
believe in yourself

6

Wednesday, June 15th 2005, 11:58am

Sorry it works like That:

Toolbar->setEnabled(false);
not ToolBar!!


Thanks
believe in yourself