tags:

views:

317

answers:

2

How to make Floating tool bar in Qt, just like the top floating panel of Microsoft Windows RDP client, any code example? Regards

A: 

I'd do it myself - from scratch. AFAIk none of the existing Qt widgets will give you what you want. However, it should be trivially easy to subclass QWidget and create your own.

Thomi
the main window of my application is child of QWidget, how to make toolbar the child of QWidget???
Ummar
+4  A: 

Inside your QMainWindow derived class:

QToolBar* pToolBar = new QToolBar(this);

pToolBar->setAllowedAreas(Qt::NoToolBarArea);

pToolbar->setFixedWidth(300);
pToolBar->setFixedHeight(50);

/* add actions to pToolBar here */

addToolBar(Qt::NoToolBarArea, pToolBar);
ttvd