Results 1 to 10 of 10

Thread: Splitter in QMainWindow DockAreas

  1. #1
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Splitter in QMainWindow DockAreas

    Hello,

    I have a quick question I could not answer with the qt api docu site. Is it possible to set attributes for the splitter of the dock areas in qt 4.7? In my case I want to to set the splitters of the dock areas to non opaque resizing and to callapsible. Any help would be appreciated.

    Regards,
    Marcus

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

    Default Re: Splitter in QMainWindow DockAreas

    I guess you can access the splitters with qFindChild()
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Splitter in QMainWindow DockAreas

    First, thanks for the quick reply. I tried it but it does not work for me. I get a bunch of splitters for my mainwindow but not the ones which are responsible for the dock areas

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

    Default Re: Splitter in QMainWindow DockAreas

    If they are splitters, they should be there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Splitter in QMainWindow DockAreas

    To clarify my problem: I have a QMainWindow and many different QDockWidgets for my modules. These DockWidgets can be arranged in tabs or nested in my MainWindow. So if I dock a DockWidget into my MainWindow I automatically get a Splitter to resize the DockArea. Same if I nest another Dock into that DockArea. These splitters are default non-collapsible and opaque-resizing but I want them to be collapsible and non-opaque-resizing. So after adding a DockWidget to my MainWindow I did the following: mw->findChildren<QSplitter*>(). This returns a bunch of splitters but non of these splitters references one of the DockArea splitters. So what am I doing wrong? I also tried to get all QSplitterHandle of the MainWindow but with the same result.

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

    Default Re: Splitter in QMainWindow DockAreas

    Those handles are not implemented as splitters. They are part of the QMainWindow class. They just look like splitters.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Splitter in QMainWindow DockAreas

    This mean that there is no chance to change the behaviour of that separators?

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

    Default Re: Splitter in QMainWindow DockAreas

    No, I don't think so. This is how the "splitters" are drawn:
    Qt Code:
    1. static void paintSep(QPainter *p, QWidget *w, const QRect &r, Qt::Orientation o, bool mouse_over)
    2. {
    3. QStyleOption opt(0);
    4. opt.state = QStyle::State_None;
    5. if (w->isEnabled())
    6. opt.state |= QStyle::State_Enabled;
    7. if (o != Qt::Horizontal)
    8. opt.state |= QStyle::State_Horizontal;
    9. if (mouse_over)
    10. opt.state |= QStyle::State_MouseOver;
    11. opt.rect = r;
    12. opt.palette = w->palette();
    13.  
    14. w->style()->drawPrimitive(QStyle::PE_IndicatorDockWidgetResizeHandle, &opt, p, w);
    15. }
    To copy to clipboard, switch view to plain text mode 

    There is nothing to set an attribute on.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Splitter in QMainWindow DockAreas

    Thanks for your support. I finally found the places for that separator in the source of Qt and I guess you are right. There is no easy solution for changing the behavior of that separator Perhaps Qt will change it in the future...

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

    Default Re: Splitter in QMainWindow DockAreas

    I don't think so.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 17th November 2010, 17:07
  2. How to add splitter in a dialog.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 5th August 2008, 08:40
  3. Splitter?
    By Katuakina in forum Qt Programming
    Replies: 1
    Last Post: 5th October 2007, 09:21
  4. Own defined Dockareas
    By jobrandt in forum Qt Programming
    Replies: 7
    Last Post: 18th July 2007, 10:48
  5. splitter
    By gambr in forum Qt Tools
    Replies: 2
    Last Post: 21st November 2006, 17:06

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
  •  
Qt is a trademark of The Qt Company.