Results 1 to 7 of 7

Thread: QToolBox and QMouseEvent

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Arrow QToolBox and QMouseEvent

    Hi,
    I looking for a way to call myToolBox->show but I like toolBox appear out of windows application (beside on right side of my window app. So

    ___ _______
    w| my
    i | toolbox
    d|
    g|
    e|
    t |
    ----------------
    Is it possible? (qt .3.2)
    And is there a function that return true when mouse is on a side of window application?
    Thanks
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox and QMouseEvent

    I understand your questions like this, pleas correct me if I'm wrong.

    1) You have an application (Windows programme) and you want another window with a toolbox to be shown. This window should not be attached to the main window but should be shown on the right side?

    2) You would like to get notified when the mouse cursor is not over your main programme or the toolbox window? Or do you want to get notified when the mouse cursor is over your main window, but on the edge of the window?
    Last edited by KjellKod; 31st January 2006 at 11:28.

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QToolBox and QMouseEvent

    HI,

    I want to know when mouse is on right border of window of my application (bit I see that when I on this appear resize cursor of mouse!!!). So I'd like this before appear resize cursor (a bit before)

    I'd like toolBox attached my windows application: see file
    Attached Images Attached Images
    Regards

  4. #4
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox and QMouseEvent

    OK, let's take the mouseevent first.

    Sorry for asking more, but what are you trying to achieve? I just want to know what the goal of

    I want to know when mouse is on right border of window of my application (bit I see that when I on this appear resize cursor of mouse!!!). So I'd like this before appear resize cursor (a bit before)
    -- to be able to help you better. Do you want to do a specific action instead of re-size? Or are you trying to block re-size (just guessing)

  5. #5
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QToolBox and QMouseEvent

    I'm thinking this: when mouse is over right border of window application, appear a toolBox
    in the way of my picture. With toolbox->hide and toolbox->show, toolbox appear but "inside" window. I'd like it outside......there is no reason for this. But Is it possible?
    Thanks
    Regards

  6. #6
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox and QMouseEvent

    I'm no Qt wizard (yet )
    But as I see it you can do it in two ways.
    1) Add a widget of some kind (a frame?) on your MainWindow. Make sure that the widget is positioned on the right border of the application and that it is hidden i.e. you can call MickeysWidget->hide() so that it is never shown.
    -- Let that widget listen to MouseMovement and when you get some then you make
    ToolBoxWindow->show()
    -- When you get MouseMovement on other parts of the MainWindow then you can call ToolBoxWindow->hide()
    -------------- problem w/ this method. I don't know if the MickeyWidget will listen all the times to MouseMovement events unless it is activated, but I think you can make it so.

    2) Constantly check where your cursor is (MainWindow coordinates) . If it's in a specific part of your MainWindow then make toolbox->show()
    // Not exactly sure how to do this.

    To make the toolbox appear outside your application is no problem at all. Just have the Toolbox in another window.
    I.e. your main.cc creates MainWindow and toolBoxWindow, and make logic for having the MainWindow to receive events which then has logic for hiding/showing the toolBoxWindow.

  7. #7
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox and QMouseEvent

    Mickey,
    I see that you're using Qt3: Is this a help?
    http://doc.trolltech.com/3.0/popup-example.html

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.