Re: [Development] qsizetype and classes working with QStrings or QList

2020-09-01 Thread Scott Bloom
> On 27 Aug 2020, at 08:04, Giuseppe D'Angelo via Development > wrote: > > Hi, > > Il 27/08/20 02:46, Thiago Macieira ha scritto: >> A QListView of 2 billion lines with where each line is a QString one >> to 7 characters in length would be 2G * (24 + 32) = 96 GB of memory use. >> QListWidget's

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-28 Thread Matthew Woehlke
On 25/08/2020 15.15, André Pönitz wrote: On Mon, Aug 24, 2020 at 09:46:43AM +0200, Mathias Hasselmann wrote: C++ also has a solution for that problem: [1] https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/ AAA is a non-solution from the ivory tower.

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Giuseppe D'Angelo via Development
Hi, Il 27/08/20 16:47, Thiago Macieira ha scritto: So, can someone take a look at what it would take to make the models use 64- bit and come up with a proper guide for how to maintain code that compiles and works on both Qt5 and Qt6? The latter is very important: if you can't easily maintain

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Thiago Macieira
On Thursday, 27 August 2020 00:52:10 PDT Lars Knoll wrote: > > On 27 Aug 2020, at 09:12, Philippe wrote: > >>> * QAbstractItemModel > >>> * QModelIndex > If I were do design these from scratch, I would certainly use qsizetype > here, maybe even a qint64 (because one can handle those large data

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Edward Welbourne
Il 25/08/20 07:49, Thiago Macieira ha scritto: >> But how about models? This is an honest question. Does it make sense >> for tables and lists that big? Note that an item*view* has a purpose >> of being viewed, so how does one display such a huge list, tree or >> table? Giuseppe D'Angelo (25

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Lars Knoll
On 27 Aug 2020, at 10:45, Lars Knoll mailto:lars.kn...@qt.io>> wrote: On 27 Aug 2020, at 08:32, Lars Knoll mailto:lars.kn...@qt.io>> wrote: On 27 Aug 2020, at 08:04, Giuseppe D'Angelo via Development mailto:development@qt-project.org>> wrote: Hi, Il 27/08/20 02:46, Thiago Macieira ha

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Lars Knoll
On 27 Aug 2020, at 08:32, Lars Knoll mailto:lars.kn...@qt.io>> wrote: On 27 Aug 2020, at 08:04, Giuseppe D'Angelo via Development mailto:development@qt-project.org>> wrote: Hi, Il 27/08/20 02:46, Thiago Macieira ha scritto: A QListView of 2 billion lines with where each line is a QString one

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Lars Knoll
> On 27 Aug 2020, at 09:12, Philippe wrote: > > On Wed, 26 Aug 2020 06:36:27 + > Lars Knoll wrote: > >>> * QAbstractItemModel >>> * QModelIndex >> >> I don’t think we should port these to use qsizetype. > > If you mean, the effort would be too big, or there is lack of resources > to do

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Philippe
On Wed, 26 Aug 2020 06:36:27 + Lars Knoll wrote: > > * QAbstractItemModel > > * QModelIndex > > I don’t think we should port these to use qsizetype. If you mean, the effort would be too big, or there is lack of resources to do it, or too many API breaks for Qt 5 to 6, then I can agree.

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Lars Knoll
> On 27 Aug 2020, at 08:04, Giuseppe D'Angelo via Development > wrote: > > Hi, > > Il 27/08/20 02:46, Thiago Macieira ha scritto: >> A QListView of 2 billion lines with where each line is a QString one to 7 >> characters in length would be 2G * (24 + 32) = 96 GB of memory use. >> QListWidget's

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-27 Thread Giuseppe D'Angelo via Development
Hi, Il 27/08/20 02:46, Thiago Macieira ha scritto: A QListView of 2 billion lines with where each line is a QString one to 7 characters in length would be 2G * (24 + 32) = 96 GB of memory use. QListWidget's overhead is much worse. This isn't accurate; QListView (with the default delegate)

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Thiago Macieira
On Wednesday, 26 August 2020 17:23:16 PDT Lisandro Damián Nicanor Pérez Meyer wrote: > > Disagree here. There is good reason many in my industry (Electronic > > design automation) use the Scintilla editor widget inside Qt apps. > > Specifically to handle extremely large, in both line count and

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Lisandro Damián Nicanor Pérez Meyer
Hi! El mié., 26 ago. 2020 16:59, Scott Bloom escribió: > From: Development On Behalf Of Ville > Voutilainen > Sent: Wednesday, August 26, 2020 12:08 AM > To: Lars Knoll > Cc: Qt development mailing list > Subject: Re: [Development] qsizetype and classes working with QStrings or > QList > >

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Scott Bloom
From: Development On Behalf Of Ville Voutilainen Sent: Wednesday, August 26, 2020 12:08 AM To: Lars Knoll Cc: Qt development mailing list Subject: Re: [Development] qsizetype and classes working with QStrings or QList On Wed, 26 Aug 2020 at 09:39, Lars Knoll wrote: > > QtGui: > > *

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Giuseppe D'Angelo via Development
Il 25/08/20 21:05, André Pönitz ha scritto: why I wanted a configure time switch to choose the size of qsizetype). This doesn't really help if Qt comes with your distribution or even with the Qt installers. What I meant is that it would be a porting aid towards Qt 6, rather than a switch to

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Marco Bubke
A new Document API where you could memory map the file and save the changes as a log on top would be nice. For lines you have to read the file but you don't have to hold it completely in memory. An other advantage would be that your document would be a binary reflection of the file. But I think

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Lars Knoll
> On 26 Aug 2020, at 09:07, Ville Voutilainen > wrote: > > On Wed, 26 Aug 2020 at 09:39, Lars Knoll wrote: >>> QtGui: >>> * QTextCursor >>> * QTextDocument (find offset, character{At,Count}) >>> * QTextLayout >>> * QValidator and subclasses (validate offset) >> >> These here are

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Ville Voutilainen
On Wed, 26 Aug 2020 at 09:39, Lars Knoll wrote: > > QtGui: > > * QTextCursor > > * QTextDocument (find offset, character{At,Count}) > > * QTextLayout > > * QValidator and subclasses (validate offset) > > These here are questionable. Editing a text file with more than 2G > characters? Sounds

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-26 Thread Lars Knoll
Going back to the original question here: > On 23 Aug 2020, at 16:06, Marcel Krems wrote: > > Hi, > > since QString, QList, etc. are using qsizetype for indexing- and > size-operations. > What is the plan with classes working with aforementioned container classes > which are still using int

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Scott Bloom
Or for( auto ii = 0; ii < std::vector.size(); ++ii ) { } since there is no suffix for "size_t" and the size of size_t will depend on 64 vs 32 bits whats the best way to AAA the index iterator? Scott -Original Message- From: Development [mailto:development-boun...@qt-project.org] On

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread André Pönitz
On Mon, Aug 24, 2020 at 09:46:43AM +0200, Mathias Hasselmann wrote: >C++ also has a solution for that problem: [1] > > https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/ AAA is a non-solution from the ivory tower. It's a pain for human reviewers and tools

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread André Pönitz
On Mon, Aug 24, 2020 at 09:26:54AM +0200, Giuseppe D'Angelo via Development wrote: > On 23/08/2020 16:06, Marcel Krems wrote: > > If they keep using int there could be a lot of warnings like this one: > > warning: implicit conversion loses integer precision: 'qsizetype' (aka > > 'long long') to

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Matthew Woehlke
On 25/08/2020 02.22, Mathias Hasselmann wrote: I'd really enjoy implementing list models without having to litter static casts all over the place. Well, but seems that chance got missed once again with qsizetype still being signed. That's intentional. There are problems with unsigned index

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Matthew Woehlke
On 25/08/2020 05.58, Giuseppe D'Angelo via Development wrote: Il 25/08/20 07:49, Thiago Macieira ha scritto: But how about models? This is an honest question. Does it make sense for tables and lists that big? Note that an item*view*  has a purpose of being viewed, so how does one display such

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Matthew Woehlke
On 25/08/2020 01.24, Philippe wrote: But then there would be the need to make QAbstractSlider be able to handle 64 bit quantities too. Well, since you mentioned it: https://github.com/Kitware/qtextensions/blob/master/widgets/qtDoubleSlider.h No, that isn't a two-headed slider, it's a slider

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Thiago Macieira
On Monday, 24 August 2020 23:11:17 PDT Philippe wrote: > > This is an honest question. Does it make sense for > > tables and lists that big? Note that an item *view* has a purpose of being > > viewed, so how does one display such a huge list, tree or table? > > I have a concrete case: in the

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Giuseppe D'Angelo via Development
Il 25/08/20 07:49, Thiago Macieira ha scritto: But how about models? This is an honest question. Does it make sense for tables and lists that big? Note that an item*view* has a purpose of being viewed, so how does one display such a huge list, tree or table? Just another thought -- models

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Иван Комиссаров
Well, yes, when displaying huge databases, for example. This use-case pops up quite often from my experience. It is rare to contain more than 2^31 elements, yes, but one has to be aware of that case and support it somehow which leads to overcompicated code that does «paging», for example. And

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Mathias Hasselmann
Am 25.08.2020 um 01:09 schrieb Thiago Macieira: On Monday, 24 August 2020 15:10:24 PDT Иван Комиссаров wrote: It would be nice if QAbstractItemModel will support qsizetype instead of int, but I do not see how this is possible considering the fact that rowCount/columnCount return int. I

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-25 Thread Philippe
> This is an honest question. Does it make sense for > tables and lists that big? Note that an item *view* has a purpose of being > viewed, so how does one display such a huge list, tree or table? I have a concrete case: in the audio domain, it's common to have audio files with more than 2

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Thiago Macieira
On Monday, 24 August 2020 22:24:52 PDT Philippe wrote: > > Do we need models with more than 2 billion rows or columns? > > More than we need in-memory containers with more than 2 billion entries, > no? More? We see a lot of data processing bumping up to gigabyte levels. Containers with more

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Philippe
> Do we need models with more than 2 billion rows or columns? More than we need in-memory containers with more than 2 billion entries, no? For instance, one could wish to display in a list view, the contents of a file with more than 2 billions "entries". But then there would be the need to make

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Thiago Macieira
On Monday, 24 August 2020 15:10:24 PDT Иван Комиссаров wrote: > It would be nice if QAbstractItemModel will support qsizetype instead of > int, but I do not see how this is possible considering the fact that > rowCount/columnCount return int. I suppose, it is not very hard to patch > QModelIndex,

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Иван Комиссаров
It would be nice if QAbstractItemModel will support qsizetype instead of int, but I do not see how this is possible considering the fact that rowCount/columnCount return int. I suppose, it is not very hard to patch QModelIndex, but what to do with virtual functions? The user code will break.

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Marcel Krems
https://bugreports.qt.io/browse/QTBUG-86224 On 24.08.2020 09:26, Giuseppe D'Angelo via Development wrote: On 23/08/2020 16:06, Marcel Krems wrote: If they keep using int there could be a lot of warnings like this one: warning: implicit conversion loses integer precision: 'qsizetype' (aka

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Giuseppe D'Angelo via Development
On 24/08/2020 11:17, Mathias Hasselmann wrote: Do you have examples showing verifiable evidence, or do you share a feeling? There has been quite a flurry of patches into Qt fixing the generated warnings (shortening 64-to-32, using "%d" in printf, and the like). I don't have a way to list

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Ville Voutilainen
On Mon, 24 Aug 2020 at 15:37, Christian Kandeler wrote: > > I don't have verifiable evidence examples, but the gist of it is this: > > > > ConcreteType x = foo(); // this detects API breaks right here, right now > > ... > > ... > > ... > > some_use_of(x); > > > > With AAA, this might become > > >

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Christian Kandeler
On Mon, 24 Aug 2020 14:45:19 +0300 Ville Voutilainen wrote: > On Mon, 24 Aug 2020 at 12:17, Mathias Hasselmann > wrote: > > >> C++ also has a solution for that problem: > > >> https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/ > > > That non-solution is terrible.

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Ville Voutilainen
On Mon, 24 Aug 2020 at 12:17, Mathias Hasselmann wrote: > >> C++ also has a solution for that problem: > >> https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/ > > That non-solution is terrible. The very reason for not using deduced > > types is to detect API breaks

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Mathias Hasselmann
Am 24.08.2020 um 11:04 schrieb Ville Voutilainen: On Mon, 24 Aug 2020 at 10:50, Mathias Hasselmann wrote: Am 24.08.2020 um 09:26 schrieb Giuseppe D'Angelo via Development: On 23/08/2020 16:06, Marcel Krems wrote: If they keep using int there could be a lot of warnings like this one:

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Ville Voutilainen
On Mon, 24 Aug 2020 at 10:50, Mathias Hasselmann wrote: > > Am 24.08.2020 um 09:26 schrieb Giuseppe D'Angelo via Development: > > On 23/08/2020 16:06, Marcel Krems wrote: > > If they keep using int there could be a lot of warnings like this one: > warning: implicit conversion loses integer

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Mathias Hasselmann
Am 24.08.2020 um 09:26 schrieb Giuseppe D'Angelo via Development: On 23/08/2020 16:06, Marcel Krems wrote: If they keep using int there could be a lot of warnings like this one: warning: implicit conversion loses integer precision: 'qsizetype' (aka 'long long') to 'int' [-Wshorten-64-to-32]

Re: [Development] qsizetype and classes working with QStrings or QList

2020-08-24 Thread Giuseppe D'Angelo via Development
On 23/08/2020 16:06, Marcel Krems wrote: If they keep using int there could be a lot of warnings like this one: warning: implicit conversion loses integer precision: 'qsizetype' (aka 'long long') to 'int' [-Wshorten-64-to-32] I'm afraid that these warnings will be all over the place anyhow.