Re: [Development] Use of Standard Library containers in Qt source code

2016-07-11 Thread Thiago Macieira
On terça-feira, 12 de julho de 2016 00:20:01 PDT Cristian Adam wrote: > Their latest presentation > y/copperspice_the_next_generation_of_signals.pdf> has > at page 6 this: Criticism: * Qt's dependency on qmake: that's o

Re: [Development] Use of Standard Library containers in Qt source code

2016-07-11 Thread Cristian Adam
On Thu, Jul 7, 2016 at 12:06 PM, Marco Bubke wrote: > I think it simply a question of time to get used to the STL. You get used > to many things. > > I think we should mind about the new features of C++ which are coming, > which cannot integrated very well with Qt because we use a different idiom

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Sune Vuorela
On 2016-07-11, Allan Sandfeld Jensen wrote: > On Monday 11 July 2016, Benjamin TERRIER wrote: >> QImage::detach() is not public API. >> However QPixmap::detach() is, so why QImage::detach() couldn't be made >> public too? >> > It probably should be. It is a lot more sensible to use than copy(rect

Re: [Development] QTableView gets freezed in showing data read from SQLite database , which is updated dynamically with 2000 rows in 2s

2016-07-11 Thread André Somers
Op 09/07/2016 om 20:01 schreef swarit wipra: Hi folks, i have issues in showing huge data in QTableView ,data read from sqlite database which is being updated dynamically .. 2k rows in 2s. i am using QSQLRelationModel let me describe the scenario in detail. My Qt application has a view i.e

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Allan Sandfeld Jensen
On Monday 11 July 2016, Benjamin TERRIER wrote: > 2016-07-11 16:03 GMT+02:00 Paul Olav Tvete : > > On mandag 11. juli 2016 12.54.58 CEST Simon Hausmann wrote: > >> Instead of using copy(), why not call the non-const bits() function (and > >> don't use the returned value). That will detach [...] > >

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Simon Hausmann
Detach() is marked with \internal - wouldn't want to suggest the use of private api;) Simon From: Paul Olav Tvete Sent: Jul 11, 2016 16:03 To: development@qt-project.org Subject: Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Benjamin TERRIER
2016-07-11 16:03 GMT+02:00 Paul Olav Tvete : > On mandag 11. juli 2016 12.54.58 CEST Simon Hausmann wrote: >> Instead of using copy(), why not call the non-const bits() function (and >> don't use the returned value). That will detach [...] > > Instead of using bits(), why not call detach() directly

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Paul Olav Tvete
On mandag 11. juli 2016 12.54.58 CEST Simon Hausmann wrote: > Instead of using copy(), why not call the non-const bits() function (and > don't use the returned value). That will detach [...] Instead of using bits(), why not call detach() directly? ;) - Paul __

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Tomasz Olszak
Oh good spot, thanks for that. It doesn't depend on QIMage::transformed impl. Thanks! 2016-07-11 13:54 GMT+01:00 Simon Hausmann : > Hi, > > > I realize that there may be an even simpler way of ensure that you get a > deep copy, but only if transformed() hasn't already > > made one (so that you

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Simon Hausmann
Hi, I realize that there may be an even simpler way of ensure that you get a deep copy, but only if transformed() hasn't already made one (so that you don't have to worry about your potentially dangling pointer): Instead of using copy(), why not call the non-const bits() function (and don't

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Tomasz Olszak
QTransform m. img.transformed(m).copy() will create one copy. But: QTransform m. m.rotate(10); img.transformed(m).copy() will copy image twice; On embedded device, if you do some video decoding it is a problem :) 2016-07-11 12:52 GMT+01:00 Giuseppe D'Angelo : > On Mon, Jul 11, 2016 at 1:40 PM,

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Tomasz Olszak
Yes seems more robust but it also seems like using a sledgehammer to crack a nut. Seems like it is not worth to burn you time for that. If everyone is ok with docs I'm too :) 2016-07-11 12:52 GMT+01:00 Simon Hausmann : > Hi, > > > What I'm suggesting is not to use the cleanup function to release

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Giuseppe D'Angelo
On Mon, Jul 11, 2016 at 1:40 PM, Tomasz Olszak wrote: > The problem here is that you can't say if transformed returns shallow or > deep copy. Result depends on argument value. Of course the transform > returning shallow copy on identity matrix is nice but should be documented > somewhere. After re

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Simon Hausmann
Hi, What I'm suggesting is not to use the cleanup function to release any memory. As you have explained that is not possible as you do not own the data. But you can use the cleanup callback as a way to determine if Qt still has a reference to your image data or not. If your image _was_ transf

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Tomasz Olszak
The pointer comes from external object and it's lifetime is managed by it. I need to ensure that I will not use it anymore after leaving certain function. Hence it don't even need to be thread operation, So using clean function won't help here. The problem here is that you can't say if transformed

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Simon Hausmann
Hi, Thank you for the explanation of your use-case. What remains unclear to me is why it is necessary for you to ensure a deep copy? Is it related to the fact that your image is created from a raw data pointer and after your worker thread is done, you cannot guarantee for the life-time of th

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Tomasz Olszak
QImage::copy returns deep copy and has similar documentation so I assumed that when docs say copy it means deep copy. Let's consider common case: 1. QImage img created from raw data pointer got from e.g. driver. 2. img used in thread to perform some transforms 3. Save result as deep copy Ensurin

Re: [Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Simon Hausmann
Hi, Could you elaborate on what you see as the discrepancy between docs and implementation? The docs don't say whether it's a shallow or a deep copy, so it looks to me that the implementation is within the bounds of the docs. Plus it seems sensible to return a shallow copy, doesn't it? Si

[Development] QImage::transformed returns shallow copy for QTransform::TxNone matrix type.

2016-07-11 Thread Tomasz Olszak
Hello, QImage:: transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) docs: "Returns a copy of the image that is transformed using the given transformation matrix and transformation mode." But if matrix.type() == QTransform::TxNone then shallow instead of de