Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. mouse events
    Log in to post

    • UNSOLVED Draw a line between two mouse clicks.
      QML and Qt Quick • qml mouse events qml canvas • • Itdoesntwork  

      1
      0
      Votes
      1
      Posts
      229
      Views

      No one has replied

    • SOLVED How to check if mouse button is pressed anywhere on screen , even outside of my mainwindow?
      General and Desktop • c++ focus issue mouse control mouse events • • learnist  

      3
      0
      Votes
      3
      Posts
      439
      Views

      @raven-worx Thanks for the answer
    • UNSOLVED MouseArea - The very painful way of events propagation
      QML and Qt Quick • event mousearea mouse events blocking • • jeanmilost  

      4
      0
      Votes
      4
      Posts
      438
      Views

      @GrecKo Thank you for your answer. the wheel signal provides a wheel object though, you can do wheel.accepted = false. Good point, I missed that. This resolve the issue I faced with onWheel. The more correct way to get parameter from signal handlers now is to define them as function, not rely on context properties. Ok, thanks for the tip. I'll try this way in the future. I am curious about your usecase of capturing onWheel on a ListView, can you give more details? In my case it's just to close a hint opened from a button on an item in my view. The hint position is linked to the opening button position, and as I use a ToolTip, the hint continue to scroll outside my view when the item containing the button go out of the view. For that reason I want to close this hint before scrolling the view. Anyway, have you looked at Qt Quick Input Handlers? This seems to be an interesting alternative indeed. However I tried to use it, but it seems not react at all in my view. Here is the code I tested, am I doing something wrong? TapHandler { target: myView acceptedButtons: Qt.LeftButton | Qt.RightButton onTapped: { console.log("onTapped called..."); } onSingleTapped: { console.log("onSingleTapped called..."); } }
    • SOLVED ScrollView and drawning a selection region with a mouse
      QML and Qt Quick • mousearea scrollview mouse events drawing timed out • • SoKaI  

      3
      0
      Votes
      3
      Posts
      205
      Views

      Thank you, it works!
    • SOLVED Strange mouse press events in lower right corner of window widgets Mac only
      General and Desktop • qwidget resize mouse events mac-os • • KonradGl  

      14
      0
      Votes
      14
      Posts
      1525
      Views

      We found a solution to that bug. The Cocoa window itself isn't set to non resizeable. If you do this, everything works as expected. class MainWindow : public QMainWindow { public: explicit MainWindow(QWidget *parent = nullptr) : QMainWindow(parent) { //this will get rid of the size grip widget showing setFixedSize(500, 500); } void mousePressEvent(QMouseEvent *) override { std::cout<<"mouse pressed"<<std::endl; } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; NSWindow* window = [(NSView*)w.window()->winId() window]; //IMTPORTANT. Otherwise the lower right mouse events will not be passed on correctly by cocoa window.styleMask &= ~NSWindowStyleMaskResizable; w.show(); return a.exec(); }
    • SOLVED Custom behavior for QSlider - tips/hints needed
      General and Desktop • desktop qslider mouse events • • MasterBLB  

      14
      0
      Votes
      14
      Posts
      1527
      Views

      Thank you @JKSH .
    • SOLVED Mouse click for latest Qt and VC++ problem....
      Game Development • gui visual c++ mouse events • • Tamis2018  

      10
      0
      Votes
      10
      Posts
      1897
      Views

      @JKSH Yes, I had to reinstalled QT on Visual C++. Works OK... THANKS!!!