Sorry, I didn't understand. Realise what? You mean how can it be implemented?
// class declaration
class MainWindow : public ...
{
public:
...
private:
QToolBar* toolbar_but;
// <--- a member variable };
// class declaration
class MainWindow : public ...
{
public:
...
private:
QToolBar* toolbar_but; // <--- a member variable
};
To copy to clipboard, switch view to plain text mode
// class implementation
void MainWindow::addToolBar()
{
// store the toolbar as a member variable for later usage
toolbar_but
= new QToolBar("Open puctures",
this, DockLeft ,
TRUE ,
0);
}
void MainWindow::addButton()
{
// use the member variable here
}
// class implementation
void MainWindow::addToolBar()
{
// store the toolbar as a member variable for later usage
toolbar_but = new QToolBar("Open puctures",this, DockLeft , TRUE ,0);
}
void MainWindow::addButton()
{
// use the member variable here
btnpix = new QToolButton(toolbar_but, "");
}
To copy to clipboard, switch view to plain text mode
Bookmarks