The QRect class, part of the Qt framework, defines a rectangle in the plane using integer precision.
Questions tagged [qrect]
26 questions
1
vote
3 answers
Cannot modify height value from QRect
The follow snippet results in my compilation yielding "error: passing 'const QRect' as 'this' argument of 'void QRect::setHeight(int)' discards qualifiers [-fpermissive]".
How can I fix this and also I've noticed that if I were to replace h -= 80;…

johnsonwi
- 159
- 3
- 15
0
votes
1 answer
QRect on a QGraphicsScene
This seems trivial, but I didn't found a solution. All I want to do is to set up a coordinate system a QGraphicsScene [-10, -10] to [10, 10] (f.e. with setSceneRect(-10, -10, 20, 20)) and to plot a QRect within the scene, using the coordinate system…

braggPeaks
- 1,158
- 10
- 23
0
votes
1 answer
Resolved :Move Item's Qrect
Is there any way to move a qrect object from its current position, there are many functions ( moveTo, moveLeft, ....) , but all of them move the object from (0,0) , and not from its current position,
If I need to move my object from its current…

Soukaina
- 1
- 3
0
votes
1 answer
PyQt5 extending lines past the image being drawn. How can I prevent this from occuring?
I am building code to present a wafer map based on inspection data. The loop function for plotting the die seems to be working correctly except that there are extra lines extending beyond and below the map area. All of the calculated numbers look…
0
votes
1 answer
bottom-right position of QRect vs QRectF
Does anyone know why QRectF right()/bottom() methods behaves differently than QRect ?
The following example
QRectF r1(0, 0, 20, 20);
qDebug() << r1.right();
QRect r2(0, 0, 20, 20);
qDebug() << r2.right();
returns this result:
20
19
When I tried…

Ludek Vodicka
- 1,610
- 1
- 18
- 33
0
votes
0 answers
QT Round Edges Rectangle
Im using following code for making the edges of rectangle round... but getting the top left and right different from the bottom left and right.
How can I fix this?
QRegion ErrorCallout::roundRect(const QRect& rect, int r)
{
QRegion region;
…

Ankul
- 53
- 9
0
votes
1 answer
Getting QRectF with text by click on QGraphicsItem
If I have some painter, some rectangle and some string:
QPainter* pPainter;
//Initializing it
QRectF RectF;
//Initializing it
std::string strText = "Some string";
And I draw the rectangle with text using painter on some QGraphicsItem object and…

Chernyavski.aa
- 1,153
- 1
- 9
- 16
0
votes
1 answer
QWidget framing
I understand that the co-ordinate system of a widget is local to the widget. 0,0 top left.
I want to draw a frame in the widget, but using the QRect returned by rect() will result in the right and bottom not framed.
There is a method called…

SPlatten
- 5,334
- 11
- 57
- 128
0
votes
1 answer
Animating a QRect with QPropertyAnimation
I have a bunch of QRects and some text in a QGraphicsScene that I am trying to animate with QPropertyAnimation. Animating the text works fine but the QRects don't work because they fail to convert to a QGraphicsObject
This works…

Ben
- 470
- 1
- 6
- 18
0
votes
1 answer
PySide metro style mousepressevent
I am trying to have a python desktop application with metro (Windows 8) style, so a table of rectangles which can be clicked to do something.
I generate the table of rectangles (MyIcon) like this:
for sub_rectx in xrange(4):
for sub_recty in…

Seudo Nimo
- 3
- 3
0
votes
1 answer
how to work with Geom in QT?
geom does not work right. When you define a new position for the window, part of it is off screen. How to solve this problem?
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
…

Protomen
- 9,471
- 9
- 57
- 124