Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2015-01-05 Thread Sze Howe Koh
On 2 December 2014 at 07:37, Sze Howe Koh szehowe@gmail.com wrote: On 1 December 2014 at 16:00, Thiago Macieira thiago.macie...@intel.com wrote: On Monday 01 December 2014 07:40:50 Knoll Lars wrote: Exactly that. It’s been like that since Qt 1 times, where QPixmap was a non shared

Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-12-01 Thread Thiago Macieira
On Monday 01 December 2014 07:40:50 Knoll Lars wrote: Exactly that. It’s been like that since Qt 1 times, where QPixmap was a non shared class you had to instantiate on the heap. We never changed this accessor for source compatibility reasons (I remember discussing this with Matthias when we

Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-12-01 Thread Sze Howe Koh
On 1 December 2014 at 16:00, Thiago Macieira thiago.macie...@intel.com wrote: On Monday 01 December 2014 07:40:50 Knoll Lars wrote: Exactly that. It’s been like that since Qt 1 times, where QPixmap was a non shared class you had to instantiate on the heap. We never changed this accessor for

Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-11-30 Thread Olivier Goffart
On Sunday 30 November 2014 06:37:11 Kevin Kofler wrote: Sze Howe Koh wrote: I'm curious about the rationale behind this API design. I can't think of any other Qt function that returns an implicitly-shared object by pointer, so this seems inconsistent. e.g. QWidget::font() returns a QFont

Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-11-30 Thread Yves Bailly
On 30/11/2014 09:35, Olivier Goffart wrote: On Sunday 30 November 2014 06:37:11 Kevin Kofler wrote: Sze Howe Koh wrote: I'm curious about the rationale behind this API design. I can't think of any other Qt function that returns an implicitly-shared object by pointer, so this seems

Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-11-30 Thread Konstantin Ritt
Null pixmap actually means no pixmap (though there is a QPixmap instance, with null pixmap data). Clearly, the API should be changed to QPixmap QLabel::pixmap(). Regards, Konstantin 2014-11-30 22:21 GMT+04:00 Yves Bailly yves.bai...@laposte.net: On 30/11/2014 09:35, Olivier Goffart wrote: On

Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-11-30 Thread Knoll Lars
On 30/11/14 09:35, Olivier Goffart oliv...@woboq.com wrote: On Sunday 30 November 2014 06:37:11 Kevin Kofler wrote: Sze Howe Koh wrote: I'm curious about the rationale behind this API design. I can't think of any other Qt function that returns an implicitly-shared object by pointer, so

[Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-11-29 Thread Sze Howe Koh
Hi all, I'm curious about the rationale behind this API design. I can't think of any other Qt function that returns an implicitly-shared object by pointer, so this seems inconsistent. e.g. QWidget::font() returns a QFont by const-ref. Regards, Sze-Howe

Re: [Development] Why does QLabel::pixmap() return `const QPixmap*`?

2014-11-29 Thread Kevin Kofler
Sze Howe Koh wrote: I'm curious about the rationale behind this API design. I can't think of any other Qt function that returns an implicitly-shared object by pointer, so this seems inconsistent. e.g. QWidget::font() returns a QFont by const-ref. Probably because the pointer can be null. C++