5

I'm designing the GUI for a project, and I want a left bar like this ones

http://patatux.net/wp-content/uploads/2010/12/Pantallazo-BEBE-Me-fui.png
(source: patatux.net)

https://www.tuxradar.com/files/LXF119.rev_qt.04.jpg
(source: tuxradar.com)

How do I put them in my .ui file?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
JGDames
  • 51
  • 1
  • 2
  • This is not functionality that you can simply drag and drop into your project. You will need to design and create it yourself. – AJG85 Jun 06 '11 at 17:43

3 Answers3

5

You can try to use QToolBar with vertical orientation. To emulate tabs behavior you should put actions to QActionGroup and make them checkable.

For example to create left panel Qt creator like:

welcomeAct = new QAction(...)
toolbar->addAction(welcomeAct)
editAct = new QAction(...)
toolbar->addAction(editAct)
designAct = new QAction(...)
toolbar->addAction(designAct)
...

//add spacing
QLabel *spacing = new QLabel;
spacing->setSizePolicy(Qt::Expanding, Qt::Expanding);
toolbar->addWidget(spacing);

//adding aditional actions
runAct = new QAction(...)
toolbar->addAction(runAct)
runDebugAct = new QAction(...)
toolbar->addAction(runDebugAct)
buildAct = new QAction(...)
toolbar->addAction(buildAct)

// put "tabs" action in QActionGroup
group = new QActionGroup(this);
group->addAction(welcomeAct)
group->addAction(editAct)
group->addAction(designAct)
...
mtvec
  • 17,846
  • 5
  • 52
  • 83
Dmitriy Erlih
  • 507
  • 2
  • 4
  • 12
4

Simplest way - is to use QtCreator's library libCorePlugin.so and corresponding includes (FancyTabBar.h) from QtCreator's srcs

DimanNe
  • 1,791
  • 3
  • 12
  • 19
2

You can most likely do it by putting everything into a QHBoxLayout, where the left hand side is a QVBoxLayout column of QPushButton's with icons matching what you want. Have the buttons trigger what the right hand pane looks like.

There is also the QTabBar which does most of this work for you. You just need to tell it to put the tabs on the left hand side.

Wes Hardaker
  • 21,735
  • 2
  • 38
  • 69