Menu branch

Ignat Semenov ragnarokk91 at gmail.com
Wed Apr 17 10:03:04 UTC 2013


A small update:

I think that the setCurrentItem() abstraction is superfluous, not to mention 
that the name coincides with that of a QComboBox member function, thus I've 
put the workaround in findComboboxItem(), so now it is clear what is worked 
around, and once qt5 comes, it will be easy to swap the necessary code for 
QComboBox::findData() (in qt5, QVariant::operator==() works fine wrt to enums 
that are Q_DECLARE_METATYPE'd - tested by tsdgeos in a qt5 installation).

For the record:

[Thursday 11 April 2013] [00:07:23] <tsdgeos>	qDebug() << (QVariant::fromValue<Test::Foo>(Test::two) == QVariant::fromValue<Test::Foo>(Test::two));
[Thursday 11 April 2013] [00:07:24] <tsdgeos>	false

[Thursday 11 April 2013] [00:08:30] <tsdgeos>	Compares this QVariant with v and returns true if they are equal; otherwise returns false.
[Thursday 11 April 2013] [00:08:32] <tsdgeos>	In the case of custom types, their equalness operators are not called. Instead the values' addresses are compared.

[Thursday 11 April 2013] [00:14:58] <tsdgeos>	isemenov: yeah that works in qt5
[Thursday 11 April 2013] [00:15:05] <tsdgeos>	        qDebug() << (QVariant::fromValue<Test::Foo>(Test::two) == QVariant::fromValue<Test::Foo>(Test::two));
[Thursday 11 April 2013] [00:15:06] <tsdgeos>	returns true

Best regards,
Ignat Semenov


More information about the Plasma-devel mailing list