Results 1 to 8 of 8

Thread: QToolBar in a new UI form?

  1. #1
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Thanks
    55
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QToolBar in a new UI form?

    I wanted to add a QToolBar to a new UI Dialog form. But, I can't find the QToolBar icon in the Qt Toolbox. Is there a way I can do this in QtDesigner? I know that in QMainWindow's you can right-click to insert a toolbar, maybe toolbars are only meant for QMainWindow?
    Software Engineer



  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QToolBar in a new UI form?

    Quote Originally Posted by gfunk
    (...)maybe toolbars are only meant for QMainWindow?
    Yes, they are meant only for QMainWindows.

  3. The following user says thank you to wysota for this useful post:

    gfunk (23rd May 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBar in a new UI form?

    Quote Originally Posted by gfunk
    I wanted to add a QToolBar to a new UI Dialog form. But, I can't find the QToolBar icon in the Qt Toolbox. Is there a way I can do this in QtDesigner? I know that in QMainWindow's you can right-click to insert a toolbar, maybe toolbars are only meant for QMainWindow?
    The only way to add a MenuBar, ToolBar, StatusBar to a Form is to use QMainWindow as Base class.
    A camel can go 14 days without drink,
    I can't!!!

  5. The following user says thank you to mcosta for this useful post:

    gfunk (23rd May 2006)

  6. #4
    Join Date
    Jan 2006
    Location
    ha noi - viet nam
    Posts
    24
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QToolBar in a new UI form?

    Quote Originally Posted by wysota
    Yes, they are meant only for QMainWindows.
    No !
    any Widget or Dialog. We can add Toolbar:

    - define 1 tool bar"this" is widget(Dialog) want add toolbar)
    QToolBar * m_pobTB;


    m_pobTB=new QToolBar(this);

    and on Toolbar add Action need

    - set position of Toolbar
    m_pobTB->setGeometry(0,0,width(),30); // example
    //---------------------------------------

    Full name: Đậu Sỹ Mạnh
    Email: manhds@fsoft.com.vn
    Nationality: Vietname
    Languge: Vietnamese, Janpanese.

    //---------------------------------------

  7. #5
    Join Date
    Jan 2006
    Location
    ha noi - viet nam
    Posts
    24
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QToolBar in a new UI form?

    //---------------------------------------

    Full name: Đậu Sỹ Mạnh
    Email: manhds@fsoft.com.vn
    Nationality: Vietname
    Languge: Vietnamese, Janpanese.

    //---------------------------------------

  8. #6
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QToolBar in a new UI form?

    Ask about your problem here...most of this forums users ignore old qt forum...
    a life without programming is like an empty bottle

  9. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QToolBar in a new UI form?

    Quote Originally Posted by manhds
    No !
    any Widget or Dialog.
    Not from Designer.
    We can add Toolbar:

    - define 1 tool bar"this" is widget(Dialog) want add toolbar)
    QToolBar * m_pobTB;


    m_pobTB=new QToolBar(this);

    and on Toolbar add Action need

    - set position of Toolbar
    m_pobTB->setGeometry(0,0,width(),30); // example
    Of course we can, as the toolbar itself is a widget like any else. But some functionality related to toolbars can only be provided by QMainWindow. In other cases, you'd have to implement it yourself.

  10. #8
    Join Date
    Jan 2006
    Location
    ha noi - viet nam
    Posts
    24
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QToolBar in a new UI form?

    Quote Originally Posted by zlatko
    Ask about your problem here...most of this forums users ignore old qt forum...
    no thanks !
    I find my problem
    //---------------------------------------

    Full name: Đậu Sỹ Mạnh
    Email: manhds@fsoft.com.vn
    Nationality: Vietname
    Languge: Vietnamese, Janpanese.

    //---------------------------------------

Similar Threads

  1. [Qt4.1] How to insert an image inside a Form?
    By Gonzalez in forum Qt Tools
    Replies: 5
    Last Post: 23rd September 2008, 11:20
  2. Insert separate QToolBar into QMainWindow
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 10:37
  3. Menubar in mainwindow form
    By Draximillian in forum Qt Tools
    Replies: 5
    Last Post: 13th April 2006, 02:26
  4. .h file for each form in QT 3.3.5 project??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2006, 11:59
  5. Connecting slots/signals in subclassed form
    By qball2k5 in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2006, 16:01

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.