Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
49 views

Detect if the mouse curor is outside QGraphicsView [duplicate]

I have mouseMoveEvent in QGraphicsView, and it changes the stylesheet of a QStatusBar everytime the mouse is in the QGraphicsView. Now I need to restore that QStatusBar color to black whenever it goes ...
tetektoza's user avatar
  • 178
0 votes
1 answer
105 views

How to get mouse press position relative to QScrollArea's widget

If I have a wide widget in a QScrollArea, and I press the mouse on it, then I get a mouse position (in mousePressEvent()) relative to the scroll area (if I scroll, it changes). How can I get the mouse ...
Alex Nevskiy's user avatar
0 votes
1 answer
220 views

QML forward mouse events to the parent

I have TableView inside another Item that have MouseArea. How can I pass all mouse events to the parent of the TableView (or in another words, make it transparent for mouse events) ?
Vladimir Bershov's user avatar
1 vote
1 answer
618 views

Qt - Draw on opencv-imshow with mouse after capture from UI doesn't work

I have this Qt Project where I can capture an Image from WebCam and afterwards draw on it using OpenCV MouseCallbacks (I perform the drawing on the imshow, not the QGraphicsView). I can capture the ...
nowsqwhat's user avatar
  • 101
-1 votes
1 answer
324 views

How to draw QRubberBand on a QGraphicsView using Mouse?

I have my MainWindow with a GraphicsView on which I want to draw a QRubberBand using MouseEvents. Therefore I created a custom GraphicsView class where I have the MouseEvents, however since I am a ...
nowsqwhat's user avatar
  • 101
-1 votes
1 answer
621 views

Show tooltip at mouse position and show legend on top-right corner

The following toy problem show two tabs, each tab contains a QGridLayout, which has a ScrollArea on one of the cells, which in turn contains a customized QLabel (MyLabel). When the user moves his ...
sofname's user avatar
  • 433
1 vote
0 answers
412 views

How to change speed or sensitivity mouse cursor in Qt

I wanna change the sensitivity of the cursor in the Qt project e.g. MouseArea. I found QMouseDevice or MouseDevice (in QML) for the 3D environment, these have sensitivity property. But I could not ...
Dart Huhman's user avatar
1 vote
3 answers
3k views

How to capture keyboard & mouse events even when the Qt app is minimized / in background / out of focus?

Here the requirement is just to check if any key was pressed or any mouse click or movement has happened. Capturing other specific details is not required. I am fine to do every 1 second polling as ...
iammilind's user avatar
  • 69.8k
0 votes
2 answers
816 views

How to make a widget transparent for selected mouse events

I'm working with a QDial object that is intended to be controlled with a mouse wheel, it works fine as such, emitting valueChanged() signals when necessary. I would like to put a semi-transparent ...
Bart M's user avatar
  • 727
1 vote
0 answers
356 views

How to propagate mouse clicks through a transparent widget

I'm trying to create a widget which, when shown, it will intercept any mouse clicks, process them, but then forward the click to the widget that was under the mouse when it was clicked. I've created a ...
linuxfever's user avatar
  • 3,813
0 votes
0 answers
36 views

QPropetyAnimation not working as expected in the mosemove event

I'm working on animations. So I'm getting some issue on this. I need to animate the screen with qpropertyanimation. Problem is When the user drag the screen through mousemove event, screen has to drag ...
Lakshmi S's user avatar
-1 votes
2 answers
1k views

How do I get the objectName of QML elements I click on?

I'm new in a rather large QML codebase and I want to know the properties of the QML element I click on when running the application, e.g. objectName. E.g. the name "button" in this main.qml. ...
elsamuko's user avatar
  • 608
1 vote
1 answer
690 views

QML: acceptedButtons for Flickable

I have a Flickable with some content that has its own DragHandler. I want all drags with the left mouse button to be handled by the content's drag handler, and drags with the right mouse button should ...
skaldesh's user avatar
  • 1,530
0 votes
0 answers
206 views

Mouse input transparency in Qt without visual transparency

I know of Qt::WindowTransparentForInput which makes a window and all of its chilren transparent, and QWidget::mask which also visually clips the region outside. I want to draw a window with client ...
ManuelSchneid3r's user avatar
0 votes
0 answers
891 views

QEvent:: MouseButtonPress and QEvent:: MouseMove effecting a QGraphicsScene in a strange way

I have an application where I want to pick up the position of the mouse in a graphics view and use this to draw a pair of threshold markers to adjust a gradation scale within the same graphics view. ...
Antony Dewar's user avatar
0 votes
1 answer
136 views

Color mouse movement

I am currently working on a GUI Project with Qt C++. A part of my work consists of tracking the mouse movement and marking its position with a green pixel. The tracking should occur only on a certain ...
infinitedreamer666's user avatar
0 votes
1 answer
289 views

QObjectPicker not receiving hovering QMouseEvent in Qt3DWidget

I've implemented a Qt3DWidget which works fairly well by letting Qt3D draw to an offscreen texture and using the texture's ID to draw on a quad in a QOpenGLWidget. The input source on the ...
Florian Blume's user avatar
0 votes
1 answer
337 views

How to detect Qt mouse events only over QPainted objects

I am attempting to produce a compass widget programatically that looks much like this: I want each "slice" of the compass to act as a button for interaction w/ the rest of the app. To that ...
Connor Spangler's user avatar
0 votes
2 answers
889 views

How to check if mouse button is pressed anywhere on screen , even outside of my mainwindow?

Is it possible to detect mouse buttons pressed inside and outside of my application window in Qt, i guess there is a way to detect mouse clicks inside my application window , but what about detecting ...
the_learnist's user avatar
1 vote
1 answer
672 views

How can I transfer clicks in from one Qt Widget to another?

I'm trying to create a pseudo remote control widget, the remote control widget (an overridden QLabel) receives a screenshot (pixmap) of the widget to be controlled every 2 seconds or so through a REST ...
Mr.Grease's user avatar
  • 197
0 votes
1 answer
1k views

Qcustomplot Display coordinates of selected points using mouse event

I need to display a set of points(nearly 200) on my custom plot. Thereafter when I click on a specific point ,it should display its coordinates using mouse event. The mouse event should be able to ...
Aravind_kosika's user avatar
0 votes
1 answer
349 views

X11 Inside Qt How to click the mouse on top window

Building a Qt application that spawns another app and then clicks on it - the top window I think. Got it working on Windows with SendInput, now for the same idea on Linux I'm trying to use X11. Found ...
windyplayer's user avatar
1 vote
2 answers
385 views

TestCase mouseDrag only clicks item inside Flickable but does not drag

In a QML TestCase, I'm trying to setup automatic scrolling of a ListView that is contained inside a Flickable (to add a custom footer that can be flicked into view, which wouldn't happen with just ...
Juha Untinen's user avatar
  • 1,856
2 votes
1 answer
1k views

Using both MouseMoveEvent for QGraphicsScene and HoverEnterEvent for QGraphicsItem

I'm trying to create a program in which you can connect points together with lines. I instantiate QGraphicsEllipseItem into a QGraphicsScene and I use HoverEnterEvent and HoverLeaveEvent to change the ...
Théo's user avatar
  • 35
0 votes
3 answers
267 views

How to check pushButtons with draging the mouse QT ? MouseMoveEvent

I have 5 pushButtons ( pushButton_i ) i = 1, 2, 3, 4, 5. What I want to do is to drag the mouse ( button pressed ) and then setText of checked buttons on "Yes", otherwise on "NO". I tried the ...
Malek Samet's user avatar
0 votes
0 answers
2k views

QItemDelegate with own editorEvent() handling captures right mouse button clicks I want to receive in QTreeView instead

I have a QTreeView widget that uses a custom QStyledItemDelegate class (for this question it's the same as using QItemDelegate). The QStyledItemDelegate overrides editorEvent(...) in order to handle ...
rbaleksandar's user avatar
  • 9,581
2 votes
1 answer
4k views

QML MouseArea, trigger and propagate events

I have a QML component with buttons, ... in it. I put a MouseArea which covers this entire component because I need to execute an action wherever I click on the component. However, I also want to ...
SteveTJS's user avatar
  • 685
0 votes
1 answer
409 views

Overriding Qt's mousePressEvent breaks moveEvent parameter

I've implemented a bound sub-window class, catching the moveEvent in order to prevent the user from dragging the sub-window out of the MDI area. Then I tried to override the mousePressEvent function. ...
Uri Raz's user avatar
  • 434
0 votes
1 answer
136 views

QML transfer mouse ownership dynamically while mouse pressed

I have an application with a list of images on the right side (using a ListView) and a viewer on the left. The user can drag an image from the list to the viewer, AND keep the image in the list (...
laurapons's user avatar
  • 1,095
2 votes
0 answers
242 views

How to imitate mouse events with full functionality in Qt

I am trying to remote control a Qt application over UDP messages from my host computer. Currently, the remote controlled computer runs a Qt application that receives messages and creates Mouse ...
TRanquil's user avatar
1 vote
1 answer
988 views

eventFilter(QObject *obj, QEvent *e) does not detect right object

I expect my program to print "mouse on label name" when my mouse is located on the labelname (a QLabel), and to print"mouse not on label name" when my mouse is not located on the labelname. Even ...
lll's user avatar
  • 322
1 vote
0 answers
347 views

Qt mdi windows not receiving mouse events

Using the mdi example I added mouse events to mainwindow as: protected: I can receive right and middle button down but no left button or mouse move or button up events. Help please. void ...
Paul Neelands's user avatar
0 votes
1 answer
425 views

In QML, add pressAndHold to item that already handles press?

I'd like to add a pressAndHold handler to tabs created by a TabView. If I attach such a handler to the component that the TabView generates the tab from, then the tab no longer works, because the ...
Paul DeRocco's user avatar
4 votes
2 answers
1k views

OpenGL & Qt : display a label on the mouseover

I'm working with OpenGL and Qt. I render a scene in an OpenGLWidget. When hovering over objects in the scene, I would like to display a box near the selected object with some text. I have already ...
Arctic Pi's user avatar
  • 719
3 votes
3 answers
5k views

How can I propagate hover or mousearea update events to lower elements in QML?

I have some sibling Rectangle elements with a radius property so they appear as circles. Each has a child Item that has a child MouseArea, the purpose of the Item being to implement a "round mouse ...
Sparr's user avatar
  • 7,712
0 votes
2 answers
2k views

Qt: How to Find the Position of the Mouseclick Relative to an Image

I would like to implement an image editor. I have a QPixmap in a QLabel in a QHBoxLayout. I have overriden the mousePressEvent in the parent widget. When the mousePressedEvent occurs, the event->...
user1396055's user avatar
6 votes
2 answers
1k views

Qt - selectively allow a click to fall through to a lower application window

Is it possible to receive a mouse click even in a Qt application, evaluate it, and if necessary, let it fall through to whatever might happen to be below the Qt application window? Note that Qt::...
dtech's user avatar
  • 49.2k
0 votes
1 answer
806 views

QDoubleSpinBox with mouse scroll signal in Qt 5?

I'm using Qt 5. I have a QDoubleSpinBox, when I hover over it with a mouse, each scroll will increase/decrease 1 from the current value. What I want is to redefine the scroll event and set rules to it....
reddy's user avatar
  • 1,821
7 votes
2 answers
1k views

How to simulate mouse wheel events using QTestLib [Qt5]

I am happily using QTestLib to write tests for my Qt5 widgets based UI. There has seemed to be no shortage of features and convenience functionality until now, when I tried to find a way to simulate ...
Mr. Developerdude's user avatar
1 vote
0 answers
1k views

Scrolling through mouse dragging in qt

I am working in c++ on qt 5.10.1, and I have a widget into which I dynamically create additional widgets. for(QString pics : nameVector) { QIcon* buttonIcon = new QIcon; QImage ...
Deltoroid's user avatar
0 votes
1 answer
605 views

QPushButton in QGraphicsScene requires doubleClick instead of single click

I need someone to explain me, when i have qGraphicsScene with void myGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent* event){ qDebug()<<event->scenePos(); } and I have qPushButton ...
Armin the Crossman's user avatar
0 votes
1 answer
177 views

Is there a way to add a mouse event to a thread?

I have a suspicion that something is preventing my mouse event to be called in Qt. Therefore, I think it might help to add the event to a thread. Is there any way to do that? And if so how would the ...
AO1114's user avatar
  • 3
2 votes
2 answers
1k views

How to handle mouse right click on QSystemTrayIcon?

I have connected QSystemTrayIcon::ActivationReason to my 'handleClick' slot as below connect(tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,SLOT(handleClick(QSystemTrayIcon::...
GUI-Novice's user avatar
0 votes
1 answer
602 views

Preview image on slider of videoPlayer

I have a video player which displays images in QgraphicsScene frame by frame. There's a play button, which shows frames by frames, like video. I want to show the preview image when mouse hover the ...
Sayan Bera's user avatar
1 vote
2 answers
2k views

Do something while QPushbutton is pressed

I have a Qt application. There I want to trigger some action while QPushButton is pressed and stop it when button is released. I have read a bit and so far what I found is to reimplement ...
RuLoViC's user avatar
  • 855
1 vote
1 answer
157 views

How to Set Mouse Collision Box for QGraphicsPixmapItem? [QT/C++]

When re-implementing any mouse event function in a QGraphicsPixmapItem such as mousePressEvent, mouseReleaseEvent, mouseMoveEvent, the graphics item uses pixel-perfect collision. For example, for the ...
Griffort's user avatar
  • 1,286
1 vote
1 answer
3k views

How get pressed keys in mousePressEvent method with Qt?

I'm trying to get which keys are pressed in the mousePressEvent method of a window. I know how get some key with the keyboardModifiers method of QApplication but it only works for few keys. A piece ...
ymmx's user avatar
  • 4,932
1 vote
1 answer
2k views

qml mouse move while mouse pressed

I have two rectangles and i want them to send mouseevent to each other while moving mouse with pressed mouse button. See my example Rectangle { x: 100 width: 30 height: 30 color: "red"...
любовь гегель's user avatar
0 votes
0 answers
238 views

Save and reproduce touch, mouse and keyboard input events

Is there elegant way to save and reproduce later all the input events (or at least touch ones) since Qt Quick 2 application's start until it closed or crashed/killed? I can save all the input events ...
Tomilov Anatoliy's user avatar

1
2 3 4 5