Results 1 to 2 of 2

Thread: Change Start position of Drawer in RightArea of QMainWindow

  1. #1
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Change Start position of Drawer in RightArea of QMainWindow

    Hi

    I am using Qt 4.6.4 on Mac.

    I am using DockWidget as Drawer in RightAllowed Area. Following Code is...

    QDockWidget *m_pDock = new QDockWidget(this,Qt:rawer);
    MyWdgt *m_pMyWdgt = new MyWdgt(this);

    m_pDock->setFixedWidth(215);
    m_pDock->setWidget(m_pMyWdgt);
    this->addDockWidget(Qt::RightDockWidgetArea,m_pDock);

    It is showing properly..
    I am using setUnifiedTitleAndToolBarOnMac(true); for QMainWindow...

    Due to setUnifiedTitleAndToolBarOnMac, Drawer's default Y position is not same level of Toolbar or Window...It starts from center of toolbar..

    Kindly look the screen...

    I want to change Y position of Drawer so that it will show below from its default Y's position.

    I have attached Sample Screen for this...

    Thanks
    Santosh
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Change Start position of Drawer in RightArea of QMainWindow

    It is showing properly..
    No it isn't. Just like the screen shot in your other post, this dock widget is not docked. It is floating to the right of and slightly under the main window.

    Read the manual for QDockWidget::isFloating():

    floating : bool
    This property holds whether the dock widget is floating. A floating dock widget is presented to the user as an independent window "on top" of its parent QMainWindow, instead of being docked in the QMainWindow. By default, this property is true.

    Access functions:
    bool isFloating() const
    void setFloating(bool floating)
    Because you do not set the floating property to false, your dock widgets are created floating, not docked. If they were docked, they would be inside the frame of the main window. Yours are floating outside it.

Similar Threads

  1. how to change the position of menu of QMainWindow
    By yxmaomao in forum Qt Programming
    Replies: 11
    Last Post: 17th September 2016, 16:12
  2. Same Width of Qt's Bottom Drawer and its parent QMainWindow
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2014, 23:41
  3. Replies: 2
    Last Post: 7th September 2011, 17:34
  4. QLabel selection: start and end position?
    By truefusion in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2009, 02:00

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.