PDA

View Full Version : QToolBar, QWidgetAction, QWidget



prof.ebral
17th February 2010, 12:17
First question!!

I am including a very basic UI. I understand it's basic .. I have not added the data yet as I am working on a new layout.

Here is my questions introduction so you can understand better. I am aiming for an intuitive and portable UI. I have replaced the common QMenuBar with a QToolBar, and I will allow users to hide this. I have 4 QDockWidgets, one of which is hidden and the widget inside becomes the CentralWidget for my QMainWindow. I do this so the CentralWidget can change, or not be set at all. The CentralWidget with the second QToolBar .. that is the focus of the question.

I like the QToolBar a lot because I can move it around. Yet I don't totally understand it yet. I am converting a software that uses wx.Python to PyQt (or maybe PySide in the future), and in the process I am attempting to streamline the UI. What the CentralWidget holds is a Multi-Layered Map that allows users to place images on it. The current wx.Python design has these layers in tabs, but I would like to convert them over to Checkable QToolBar widgets.

Now comes the heart of the question. Each layer has different options. The options would fit inside a QWidget, but they take up a huge amount of pixel space so I want them to be visible only when I need them to be. In the screen shot I have my pointer by a Ying-Yang icon (yes I know some material is mis labeled, UI first).

Now the question. What I would like to do is have the buttons to the right of the Ying-Yang represent the layers, and the Ying-Yang pop-up the layer options when it is pressed.

I was looking at QWidgetActions and I think I am doing something wrong. Since MeeGo is coming about I would like to point out that I want the Ying-Yang to function like the items on the Moblin Panel. each item has a Panel all it's own.

I don't want to ask 'can I do this', I want to ask 'How can I do this?' or at least, 'Can you point me in the right direction?'

Intel, you guys can answer too. ;) ;)

4300

prof.ebral
17th February 2010, 19:53
As I usually do when I post questions of this sort I like to post my progress.

So it appears I am not far off. I am using .popup() and getting the menu item I want to show, however now it wants a QPoint. I am looking over the documentation today. I guess if I can map the QPoint to the button I am pressing, it appears I will receive the widget that I want.

aamer4yu
18th February 2010, 07:06
Can you provide a screenshot of moblin panel that you are trying to replicate ? I couldnt grasp what you want exactly since I dont know about moblin !
Meanwhile from reading your post , I would say look at the following classes -
QStackedWidget, QToolBox , QListWidget.

Also please go through all the examples in Qt Demos. I am sure you can find something for your needs to start with.

prof.ebral
18th February 2010, 19:38
Certainly.
Moblin 2.0 Beta with the My Zone open: http://farm4.static.flickr.com/3655/3606772004_b8079ae3c2.jpg

This is what I have so far: 4305

If you look at the status bar you will see my mouse is hovering over the Layer Options toolbar button. The little window with the scroll is what pops up when pressed, and I would like that to look connected to the toollbar, like the My Zone buttons connects to the My Zone panel.