Results 1 to 4 of 4

Thread: QToolBar, QWidgetAction, QWidget

  1. #1
    Join Date
    Feb 2010
    Posts
    96
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QToolBar, QWidgetAction, QWidget

    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.

    Pious-Paladin.jpg

  2. #2
    Join Date
    Feb 2010
    Posts
    96
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBar, QWidgetAction, QWidget

    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.

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBar, QWidgetAction, QWidget

    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.

  4. #4
    Join Date
    Feb 2010
    Posts
    96
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBar, QWidgetAction, QWidget

    Certainly.
    Moblin 2.0 Beta with the My Zone open: http://farm4.static.flickr.com/3655/...b8079ae3c2.jpg

    This is what I have so far: Pious-Paladin-2.jpg

    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.

Similar Threads

  1. QWidgetAction resize in QMenu
    By stburton in forum Qt Programming
    Replies: 7
    Last Post: 11th January 2018, 15:27
  2. How to make QMenu.exec() return a QWidgetAction
    By gregsan in forum Qt Programming
    Replies: 5
    Last Post: 15th April 2010, 01:04
  3. Adding a QWidget to QToolbar
    By qtUser500 in forum Qt Tools
    Replies: 6
    Last Post: 16th October 2009, 19:16
  4. QWidgetAction: A QTreeWidget in a QMenu
    By chezifresh in forum Qt Programming
    Replies: 1
    Last Post: 16th October 2009, 04:49
  5. how to add QWidget to QToolBar
    By babu198649 in forum Qt Tools
    Replies: 2
    Last Post: 22nd September 2008, 07:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.