Results 1 to 5 of 5

Thread: QDockWidget setTabPosition does not work

  1. #1
    Join Date
    Sep 2014
    Posts
    1
    Qt products
    Qt5

    Default QDockWidget setTabPosition does not work

    Hi all.

    I am trying to set tabs on top when QDockWidgets are tabified. However, if I use QtCreator and generate a widget project, I don't have access to setTabPosition.

    In the examples, provided by Qt (dockwindgets.pro), I can access the setTabPosition method but compiler returns:

    ui->setTabPosition(Qt::DockWidgetArea::TopDockWidgetA rea, QTabWidget::TabPosition::North);

    Qt::DockWidgetArea::TopDockWidgetArea is not a class or namespace
    QTabWidget::TabPosition is not a class or namespace.

    Thanks.

  2. #2

    Default Re: QDockWidget setTabPosition does not work

    Try this

    setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::VerticalTabs);

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QDockWidget setTabPosition does not work

    Quote Originally Posted by Cassilio View Post
    In the examples, provided by Qt (dockwindgets.pro), I can access the setTabPosition method but compiler returns:
    Qt Code:
    1. ui->setTabPosition(Qt::DockWidgetArea::TopDockWidgetArea, QTabWidget::TabPosition::North);
    2.  
    3. Qt::DockWidgetArea::TopDockWidgetArea is not a class or namespace
    4. QTabWidget::TabPosition is not a class or namespace.
    To copy to clipboard, switch view to plain text mode 
    QDockwidget does not have a setTabPosition() member function. I am assuming the ui object is a QMainWindow. Fix your syntax and all should be well.
    Qt Code:
    1. ui->setTabPosition(Qt::TopDockWidgetArea, QTabWidget::North );
    To copy to clipboard, switch view to plain text mode 
    If the code posted actually came from an "example provided by Qt" then you should log it is a bug against Qt specifying exactly where it exists.

  4. #4
    Join Date
    Oct 2014
    Posts
    81
    Thanks
    20
    Thanked 9 Times in 9 Posts
    Qt products
    Qt5
    Platforms
    Windows
    Wiki edits
    7

    Default Re: QDockWidget setTabPosition does not work

    You're replying to a year old post.
    In my opinion there's nothing wrong with providing a solution to an open problem, obviously, it's just that you're writing as if he's still looking for the answer.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QDockWidget setTabPosition does not work

    Indeed. Didn't notice that the poster before me had resurrected the thread
    simonWirex's suggestion is not the answer either.

Similar Threads

  1. QDockWidget inside QDockWidget
    By mqt in forum Qt Programming
    Replies: 3
    Last Post: 1st July 2013, 12:57
  2. Replies: 0
    Last Post: 12th July 2011, 08:20
  3. Replies: 1
    Last Post: 7th December 2010, 21:46
  4. [SOLVED] QDockWidget::setVisible() doesn't work
    By Oleg in forum Qt Programming
    Replies: 2
    Last Post: 4th January 2008, 20:27
  5. Can setWindowIcon() work in QDockWidget?
    By alfa_wu in forum Qt Programming
    Replies: 2
    Last Post: 13th December 2007, 08:51

Tags for this Thread

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.