Hello!
How can I attach to dockwidget the toolbar?
This code don't resolve this problem^
ReliefGraphics
::ReliefGraphics(QWidget *parent
): toolBar
(0), settings
(0){
toolBar
= new QToolBar(this,
"toolBar");
toolBar
-> setObjectName
(QString::fromUtf8("toolBar"));
toolBar -> setToolButtonStyle(Qt::ToolButtonIconOnly);
toolBar -> setAllowedAreas(Qt::LeftToolBarArea);
toolBar -> setOrientation(Qt::Vertical);
addIconToolbar();
settings = new PlotSettings();
}
ReliefGraphics::~ReliefGraphics()
{
if(toolBar) delete toolBar;
if(settings) delete settings;
}
void ReliefGraphics::addIconToolbar()
{
toolBar
-> addAction
(QIcon("./Images/save.png"), text
);
text = "Repair";
toolBar
-> addAction
(QIcon("./Images/repair.png"), text
);
toolBar -> addSeparator();
}
ReliefGraphics::ReliefGraphics(QWidget *parent): toolBar(0), settings(0)
{
toolBar = new QToolBar(this, "toolBar");
toolBar -> setObjectName(QString::fromUtf8("toolBar"));
toolBar -> setToolButtonStyle(Qt::ToolButtonIconOnly);
toolBar -> setAllowedAreas(Qt::LeftToolBarArea);
toolBar -> setOrientation(Qt::Vertical);
addIconToolbar();
settings = new PlotSettings();
}
ReliefGraphics::~ReliefGraphics()
{
if(toolBar) delete toolBar;
if(settings) delete settings;
}
void ReliefGraphics::addIconToolbar()
{
QString text = "Save";
toolBar -> addAction(QIcon("./Images/save.png"), text);
text = "Repair";
toolBar -> addAction(QIcon("./Images/repair.png"), text);
toolBar -> addSeparator();
}
To copy to clipboard, switch view to plain text mode
Where I wrong?
Bookmarks