Results 1 to 1 of 1

Thread: extra line when adding QToolBar into QMainWindow

  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: extra line when adding QToolBar into QMainWindow

    Hi,

    How can I avoid this line when adding QToolBar into mainwindow?
    seems that there contains 2 tool bar?

    Qt Code:
    1. QToolBar* toolBar = new QToolBar(this);
    2. toolBar->setGeometry(0,0,200,20);
    3. this->addToolBar(toolBar);
    To copy to clipboard, switch view to plain text mode 

    error.png


    Added after 1 31 minutes:


    It seems that when one QMainWindow is created,
    there is already one default ToolBar inside of it.

    <QToolBar*> bars = this->findChildren<QToolBar*>();
    I get one tool bar element without calling addToolBar function...
    But somehow I dont find similar functions like QMainWindow::menuBar() or QMainWindow::statusBar()...
    Last edited by cic; 29th July 2013 at 11:10.

Similar Threads

  1. Replies: 2
    Last Post: 29th July 2013, 01:28
  2. QToolTip tables adding an extra row
    By ksierens in forum Qt Programming
    Replies: 2
    Last Post: 20th April 2013, 19:05
  3. QToolBar Layout(when part of QMainWindow)
    By iridium in forum Qt Programming
    Replies: 3
    Last Post: 18th April 2013, 14:19
  4. Replies: 10
    Last Post: 1st November 2010, 01:24
  5. QToolbar on QMainWindow
    By paolom in forum Qt Programming
    Replies: 2
    Last Post: 18th October 2010, 15:31

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.