Re: [Interest] QSqlDatabase "left open"

2013-04-05 Thread Alex Malyushytskyy
Do you say QStringList QSqlDatabase::connectionNames () returns anything after QSqlDatabase::close is called? I believe in Qt 4.6 it worked on Windows. You may try QSqlDatabase::removeDatabase but it may cause some resource leeks if there are open queries. Regards, Alex On Thu, Ap

[Interest] matrox 9120 plus card and black window opengl problem

2013-04-05 Thread Francesco Lamonica
Hi all, I am having problems with an app that renders images in a qglwidget (qt 4.8.4) on a windows 7 pc using the aforementioned video card. I thought there might be a problem in my code but even the 2d example from qt distribution shows a black tile in the right (opengl) panel. I obviously upgrad

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Aekold Helbrass
Wow, that works! Thank you! Was the declaration the main thing that was missing? As for why I want to do this, I have a plan for application with quite complex object tree, that will be stored in JSON. Classes structure will be quite simple, only strings and integers. And writing the parsing logic

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Pritam Ghanghas
working main.cpp is attached. I am not sure why you want to do this. From: Aekold Helbrass [helbr...@gmail.com] Sent: Friday, April 05, 2013 5:59 PM To: Pritam Ghanghas Cc: Qt-interest Interest Subject: Re: [Interest] QVariant cannot take custom type Complete QtCre

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Aekold Helbrass
Complete QtCreator project in attachment. I'm running it on QtCreator 2.7.0 and Qt 5.0.1, SUSE Linux 12.3. On Fri, Apr 5, 2013 at 2:30 PM, Pritam Ghanghas wrote: > can you send compilable code that reproduces this problem. I will try here. > > From: > interest-

Re: [Interest] QIcons and multithreading

2013-04-05 Thread Sensei
On 4/5/13 1:38pm, Bo Thorsen wrote: > Den 05-04-2013 13:09, Sensei skrev: >> By the way, and just for a thorough exploration of my code, is >> QTreeWidgetItem *without icons* safe to be constructed in a separate >> thread? > > Looking at the source code, it might actually work. But you will be > de

Re: [Interest] QIcons and multithreading

2013-04-05 Thread Bo Thorsen
Den 05-04-2013 13:09, Sensei skrev: > By the way, and just for a thorough exploration of my code, is > QTreeWidgetItem *without icons* safe to be constructed in a separate thread? Looking at the source code, it might actually work. But you will be depending on the internal implementation of QIcon

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Pritam Ghanghas
can you send compilable code that reproduces this problem. I will try here. From: interest-bounces+pritam_ghanghas=infosys@qt-project.org [interest-bounces+pritam_ghanghas=infosys@qt-project.org] on behalf of Aekold Helbrass [helbr...@gmail.com] Sent: Frid

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Aekold Helbrass
Ok, I've tried this one: QVariant var(QMetaType::QObjectStar, &item); and it *almost* works. Pointer somehow gets crippled after using QMetaProperty.write. When Item* is created originally - address is 0x1b952fo. But into Holder it is written as 0x1b95480. Is is even possible? Maybe I'm

Re: [Interest] QIcons and multithreading

2013-04-05 Thread Sensei
By the way, and just for a thorough exploration of my code, is QTreeWidgetItem *without icons* safe to be constructed in a separate thread? Thanks & Cheers! ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinf

Re: [Interest] QIcons and multithreading

2013-04-05 Thread Sensei
On 4/4/13 6:45pm, Alan Ezust wrote: > The reason, simply, is that the graphics memory and the objects that > reside in it are not thread-safe, and to make them thread-safe would > cause a great performance impact, so Qt doesn't try. > You can read more about this in the documentation, but in genera

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Pritam Ghanghas
use gdb and see where exactly it segfaults. That will give better pointers than random guesses. You can try posting backtrace here. From: interest-bounces+pritam_ghanghas=infosys@qt-project.org [interest-bounces+pritam_ghanghas=infosys@qt-project.org] on b

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Aekold Helbrass
Thanx, that one was close, but still segfault: QSharedPointer pointer(item); QVariant var = QVariant::fromValue(pointer); list.append(var); On Fri, Apr 5, 2013 at 1:33 PM, Conti Manuele wrote: > Hi All, > There is a problem in your code, actually I use this and work

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Conti Manuele
Hi All, There is a problem in your code, actually I use this and work perfectly: Q_DECLARE_METATYPE(QSharedPointer) qRegisterMetaType< QSharedPointer >(); Bye On 04/05/2013 12:27 PM, Samuel Gaist wrote: > He explains how to handle QObject * so a pointer to QObject instance, not a > QObject inst

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Samuel Gaist
He explains how to handle QObject * so a pointer to QObject instance, not a QObject instance. On 5 avr. 2013, at 12:22, Aekold Helbrass wrote: > So, it is absolutely impossible to use QObject-derived class with QVariant? > I'm storing QList of pointers already, and I want to write that with >

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Aekold Helbrass
So, it is absolutely impossible to use QObject-derived class with QVariant? I'm storing QList of pointers already, and I want to write that with QMetaProperty. The only thing that needs copy-constructor, in my understanding, is qRegisterMetaType invocation. I even read an article where guy explain

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread André Somers
Op 5-4-2013 11:39, Sven Bergner schreef: > Hello, > you can use a custom type with QVariant by declaring it > using Q_DECLARE_METATYPE ( Type ). > Hope that helps. > It does not. That was already in the code posted in the opening post. As noted by others, the issue lies with trying to use a QObje

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Sven Bergner
Hello, you can use a custom type with QVariant by declaring it using Q_DECLARE_METATYPE ( Type ). Hope that helps. Regrads, Sven 2013/4/5 Pritam Ghanghas > QObjects are not supposed to be copiable, providing a copy constructor > violates Qt's principle that QObject is an identity type. If yo

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Pritam Ghanghas
QObjects are not supposed to be copiable, providing a copy constructor violates Qt's principle that QObject is an identity type. If you want to store QObjects in QVariant store pointers to be them instead. From: interest-bounces+pritam_ghanghas=infosys@qt-proj

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Aekold Helbrass
I've provided copy-constructor, as was suggested in that article. On Fri, Apr 5, 2013 at 10:50 AM, Samuel Gaist wrote: > Hi, > > IIRC, you can't have Item or Holder in a QVariant because there QObject so > the copy constructor is disabled for them. > > This thread might be of interest > http://s

Re: [Interest] QVariant cannot take custom type

2013-04-05 Thread Samuel Gaist
Hi, IIRC, you can't have Item or Holder in a QVariant because there QObject so the copy constructor is disabled for them. This thread might be of interest http://stackoverflow.com/questions/7872578/how-to-properly-use-qregistermetatype-on-a-class-derived-from-qobject Hope it helps On 5 avr. 2

[Interest] QVariant cannot take custom type

2013-04-05 Thread Aekold Helbrass
Hi All! Short story is: I'm trying to put custom type into QVariant and it doesn't work, on debug I see QVariant with value and trying to read it I'm getting segfault. Long story, I'm new to Qt/C++ so I'm trying to do everything very carefully, but I'm almost sure it's some rookie mistake in my