Questions tagged [qrubberband]

16 questions
3
votes
1 answer

QRubberBand, how to draw on it

I'm trying to draw numbers on QRubberBand object. I have class widget with QRubberBand object rectangleRubberBand; I can show this area etc, but I'm trying to draw on area not on the widget some numbers, for example width and height of this area.…
Shepherd
  • 33
  • 1
  • 5
2
votes
1 answer

QRubberBand move on QGraphicsView after resizing

I have the same problem from this topic: QRubberBand move when I resize window, after a few try I realized that solution from this topic doesn't apply on QGraphics View. Why my selection move, arout QgraphicsView when I resize window. import…
Vesa95
  • 607
  • 1
  • 7
  • 26
2
votes
1 answer

QPixmap & QRubberBand scaling troubles

I have a "working" example but a few issues I can not seem to figure out. I have calculated the topLeft and bottomRight coordinates inside the rubber band and converted them to the widgets coordinates. However the pixmap.copy() does not copy those…
uMinded
  • 595
  • 1
  • 9
  • 21
1
vote
1 answer

How to Crop Image in a QGraphicsView in Qt C++?

I am a beginner in Qt and for my school project I have to develop an Image Editor. The last feature I'm missing for the Editor is cropping the Image using a QRubberBand, and then crop the selected area using a push button. The problem is that I…
nowsqwhat
  • 101
  • 7
1
vote
0 answers

Get widgets selected with QRubberBand

I'm wondering if there's any way to get all widgets (QLabel specifically) inside a QRubberBand area. void Widget::mousePressEvent(QMouseEvent *event) { origin = event->pos(); if (!rubberBand) rubberBand = new…
ruda
  • 181
  • 4
  • 14
1
vote
1 answer

Select items with RubberBandDrag only when it's released

I have a QGraphicsScene where I have QGraphicsItems and enabled rubberBand selection. I want to select these items with rubberband selection but I want them to become selected only when the rubber band is released. Now it selects/deselects items…
galaxy
  • 53
  • 1
  • 1
  • 15
1
vote
1 answer

How to prevent clip a QRubberband in a certain region?

I am planning to make a small photo cropping software and I encounter this problem where when I moved the QRubberband I made, it is kind of moving past to the borders of the QLabel. Here is the sample code: (Left-click and drag to make a…
Eliazar
  • 301
  • 3
  • 13
1
vote
1 answer

QRubberBand move when I resize window

I want to make a selection, so I create a QRect with QRubberband, everything work fine, when i press the button I cand click o image and make a selection, the problem is the selection is moving when I resize the window, how can I stop this…
Vesa95
  • 607
  • 1
  • 7
  • 26
0
votes
0 answers

QRubberband pyqt5 center item breaks grab

Could someone help me with the following issue. I am attempting to use Qrubberband to make a crop of an image. The following code worked well and made a small popup appear with the photo inside which I could crop perfectly. The issue is I wanted the…
Clive Atkins
  • 545
  • 4
  • 21
0
votes
0 answers

How can I get the coordinates of a QLabel's first pixel in PyQt5 or PyQt6?

I'm trying to make a program that allows me to tag objects in a photo. I'm using QRubberBand to create selection rectangles over an image. This image is a QLabel where I set a QPixmap. It's important to note that I resized the original images. Right…
Mordred
  • 9
  • 1
0
votes
0 answers

How to crop a Pixmap image in a QLabel and save it using Qrubberband (while constricting crop area to label size)? (PyQt5)

So I have a QLabel that will display an image in my GUI and I need to trigger a cropping sequence when I click a "Crop" button. Problem is I want to constrict the cropping area and create kind of like a bounding box around the label so if the user…
Saif eldeen Adel
  • 318
  • 3
  • 15
0
votes
2 answers

Is there a way to show tool tips for QRubberBand?

I am trying to set a tool tip for QRubberBand. This is how the constructor of the parent looks. Please note the parent is not a window, but rather a widget of a window. roiRB = new QRubberBand( QRubberBand::Rectangle,this); …
madhavpcm
  • 21
  • 3
0
votes
1 answer

What causes a nested QRubberband to move unexpectedly?

I am just curious if I can make a nested QRubberband. (I or someone might find a use to it). I managed to edit the code from this answer to make a nested QRubberband. It is all fine and working until I move the QRubberband inside its parent…
Eliazar
  • 301
  • 3
  • 13
0
votes
0 answers

qRubberBand not painted continuously in some cases

I have a problem with qRubberBand not painting continuous rectangles in some cases. I used exact example from Qt documentation: void Widget::mousePressEvent(QMouseEvent *event) { origin = event->pos(); if (!rubberBand) rubberBand =…
nocturne
  • 627
  • 3
  • 12
  • 39
-1
votes
1 answer

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 beginner, I don't know how to connect everything to…
nowsqwhat
  • 101
  • 7