Results 1 to 2 of 2

Thread: Disable dragging a QDockWidget with the mouse

  1. #1
    Join Date
    Jan 2015
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Disable dragging a QDockWidget with the mouse

    Hello,

    I have a QDockWidget that is floating. It does not have a frame or frame's Titlebar. but it does have the regular QDockWidget Title. Normally users drag the QDockWidget with the mouse, but I want to disable this.
    If the QDockWidget is floating, I want it to remain in a fixed position which I set using the move function. The user should not be allowed to drag it. However, the user should still be able to dock/undock it by pressing the little dock/undock button on the right of the QDockWidget title.

    Is what I am hoping to achieve possible?

    Thanks,
    jl_287

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

    Default Re: Disable dragging a QDockWidget with the mouse

    The most obvious solution is to not make the widget a QDockWidget. However in my personal opinion I would really stay away from your application if you didn't allow me to move windows on my desktop the way I like (of course I could still do it using the means my system provides).
    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. Force dragging a QDockWidget
    By Kryzon in forum Qt Programming
    Replies: 0
    Last Post: 7th January 2015, 10:56
  2. Problem in dragging and move QDockWidget
    By stilgar in forum Qt Programming
    Replies: 1
    Last Post: 18th April 2012, 11:33
  3. Hover on mouse over while dragging
    By mooreaa in forum Qt Programming
    Replies: 3
    Last Post: 6th February 2010, 11:31
  4. How do disable painting while dragging?
    By Disperato in forum Qt Programming
    Replies: 1
    Last Post: 26th June 2009, 18:47
  5. Dragging mouse selection in QTableWidget
    By yartov in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2008, 16:03

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.