Results 1 to 8 of 8

Thread: Highlight DockArea

  1. #1
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Highlight DockArea

    Hey guys,

    I'm trying to display the dockAreas without having a dockWidget over it. In other words, when you drag a dockWidget over the MainWindow, this shows a blue transparent rectangle which indicates where and how the dock will be docked. I would like to know how to show this blue transparent rectangle without have a dock over MainWindow, like using a pushbutton or anything like these.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Highlight DockArea

    Take a look at QRubberBand to see if that scratches your itch.

    The Qt source code for QDockWidget and QMainWindow will (obviously) show you exactly how how this is achieved for dock drag and drop.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Highlight DockArea

    You'll need to look into QMainWindow, it might have container widgets for each of its dock areas.

    Cheers,
    _

  4. #4
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Highlight DockArea

    Quote Originally Posted by ChrisW67 View Post
    Take a look at QRubberBand to see if that scratches your itch.

    The Qt source code for QDockWidget and QMainWindow will (obviously) show you exactly how how this is achieved for dock drag and drop.
    I did, but I need the exactly location of dock to be able to create QRubberBand. I also tried to find in qt source code, but I couldn`t find anything. Any help would be very helpful

    Quote Originally Posted by anda_skoa View Post
    You'll need to look into QMainWindow, it might have container widgets for each of its dock areas.

    Cheers,
    _

    I couldn`t find anything in QMainWindow neither QDockWidget

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Highlight DockArea

    Quote Originally Posted by thibs View Post
    I couldn`t find anything in QMainWindow neither QDockWidget
    What about this? https://code.woboq.org/qt5/qtbase/sr...GapIndicatorEv

    Cheers,
    _

  6. #6
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Highlight DockArea

    This code is not in qmainwindow. There is no qmainwindowlayout in msvc2013_64_opengl and I don't know how to implement this function in my code. Could you help me?

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

    Default Re: Highlight DockArea

    Quote Originally Posted by thibs View Post
    This code is not in qmainwindow.
    No, but it used by QMainWindow to layout the content area of the widget. This is the layout manager that stacks tool bars and dock widgets around the perimeter of the main content widget.
    There is no qmainwindowlayout in ...
    Sure it is: just not publicly exposed. There is only one set of source code for all platforms.

    You do not have access directly to the layout and the dock areas do not have a size until you actually dock something or hover. I cannot see how to achieve what you ask without actually putting a dock widget in the area and then rubber-banding the QDockWidget.
    Last edited by ChrisW67; 31st January 2017 at 09:24.

  8. #8
    Join Date
    May 2015
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Highlight DockArea

    What I'm trying to achieve is to have the same dockArrows that visual studio has. I have done everything, and I "hacked" this problem creating a QRubberBash, but i don't know the actual size of the dock area, so to the QRubberBash have the same size of the dockArea.Capture.jpg

Similar Threads

  1. How to highlight a QWidget
    By AndreiTuicu in forum Qt Programming
    Replies: 1
    Last Post: 21st May 2014, 08:08
  2. How to Highlight a PixMap?
    By LaTj in forum Newbie
    Replies: 2
    Last Post: 4th November 2013, 23:23
  3. QMainWindow with fixed area + Dockarea
    By trallallero in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2012, 09:25
  4. highlight in QTextEdit
    By ubuntudevelop78 in forum Qt Programming
    Replies: 1
    Last Post: 27th November 2009, 00:22
  5. Highlight row in treeview
    By supergillis in forum Qt Programming
    Replies: 6
    Last Post: 20th November 2008, 08:49

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.