Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, May 2007
QUrl issues


Message 1 in thread

I get the following error when trying to compile php-qt from subversion
sources using qt-4.3.0rc1:

/usr/include/qt4/QtCore/qglobal.h: In instantiation of 'QTypeInfo<QUrl>':
/usr/include/qt4/QtCore/qlist.h:341:   instantiated from 'void
QList<T>::node_destruct(QList<T>::Node*, QList<T>::Node*) [with T = QUrl]'
/usr/include/qt4/QtCore/qlist.h:539:   instantiated from 'void
QList<T>::free(QListData::Data*) [with T = QUrl]'
/usr/include/qt4/QtCore/qlist.h:514:   instantiated from 'QList<T>::~QList()
[with T = QUrl]'
/home/jon/projects/ggui_rc/trunk/smoke/qt/x_5.cpp:4954:   instantiated from
here
/usr/include/qt4/QtCore/qglobal.h:1558: error: invalid application of
'sizeof' to incomplete type 'QUrl'
/usr/include/qt4/QtCore/qlist.h: In member function 'void
QList<T>::node_destruct(QList<T>::Node*, QList<T>::Node*) [with T = QUrl]':
/usr/include/qt4/QtCore/qlist.h:539:   instantiated from 'void
QList<T>::free(QListData::Data*) [with T = QUrl]'
/usr/include/qt4/QtCore/qlist.h:514:   instantiated from 'QList<T>::~QList()
[with T = QUrl]'
/home/jon/projects/ggui_rc/trunk/smoke/qt/x_5.cpp:4954:   instantiated from
here
/usr/include/qt4/QtCore/qlist.h:342: warning: possible problem detected in
invocation of delete operator:
/usr/include/qt4/QtCore/qlist.h:342: warning: invalid use of undefined type
'struct QUrl'
/usr/include/qt4/Qt/qfiledialog.h:44: warning: forward declaration of
'struct QUrl'
/usr/include/qt4/QtCore/qlist.h:342: note: neither the destructor nor the
class-specific operator delete will be called, even if they are declared
when the class is defined.
/usr/include/qt4/QtCore/qlist.h:344: error: invalid use of undefined type
'struct QUrl'
/usr/include/qt4/Qt/qfiledialog.h:44: error: forward declaration of 'struct
QUrl'
/usr/include/qt4/QtCore/qlist.h: In member function 'void
QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with
T = QUrl]':
/usr/include/qt4/QtCore/qlist.h:501:   instantiated from 'void
QList<T>::detach_helper() [with T = QUrl]'
/usr/include/qt4/QtCore/qlist.h:91:   instantiated from
'QList<T>::QList(const QList<T>&) [with T = QUrl]'
/home/jon/projects/ggui_rc/trunk/smoke/qt/x_5.cpp:4954:   instantiated from
here
/usr/include/qt4/QtCore/qlist.h:332: error: invalid use of undefined type
'struct QUrl'
/usr/include/qt4/Qt/qfiledialog.h:44: error: forward declaration of 'struct
QUrl'
/usr/include/qt4/QtCore/qlist.h:335: error: invalid use of undefined type
'struct QUrl'
/usr/include/qt4/Qt/qfiledialog.h:44: error: forward declaration of 'struct
QUrl'
make[2]: *** [smoke/qt/CMakeFiles/smokeqt.dir/x_5.o] Error 1
make[1]: *** [smoke/qt/CMakeFiles/smokeqt.dir/all] Error 2
make: *** [all] Error 2


The error appears in this assignment:
QList<QUrl> xret = this->QFileDialog::sidebarUrls();

sidebarUrls() is supposed to return a QList<QUrl>, and since the errors are
happening in the qt4 headers, I thought I'd ask you guys if this is a qt
error or a php-qt error.

Thanks,
Jon

Message 2 in thread

Hi,
when starting Visual Studio (2003) using the
qt-vsintegration-1.3.0rc1.exe
i get the following warnings (in the VS output window):

The file '.../Trolltech/Qt VS Integration/plugins/Qt3Support4.dll' is
not a valid Qt plugin.
The file '.../Trolltech/Qt VS Integration/plugins/QtNetwork4.dll' is not
a valid Qt plugin.
The file '.../Trolltech/Qt VS Integration/plugins/QtSql4.dll' is not a
valid Qt plugin.

Cheers,
Peter

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 3 in thread

It seems that QPixmap::cacheKey() returns bad values so that
QPixmapCache thinks all those images inserted are the same - which they
are not!

values found for cacheKey() : 
0xffffffffffffffff,
0xfffffff400000000
0xfffffff200000000
0xfffffff100000000

looks to me like the 64 bit arithmetic used there is buggy...

Visual Studio 2003 and Windows XP used here.

Cheers,
Peter

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 4 in thread

Peter Prade wrote:
> It seems that QPixmap::cacheKey() returns bad values so that
> QPixmapCache thinks all those images inserted are the same - which they
> are not!
> 
> values found for cacheKey() : 
> 0xffffffffffffffff,
> 0xfffffff400000000
> 0xfffffff200000000
> 0xfffffff100000000

These are all valid keys, e.g. generated keys don't start at 0. Do you 
have an example where we can see this buggy behavior?

> looks to me like the 64 bit arithmetic used there is buggy...
> 
> Visual Studio 2003 and Windows XP used here.


Thanks,
-
Trond K.

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 5 in thread

Trond Kjernaasen wrote:
> Peter Prade wrote:
> > It seems that QPixmap::cacheKey() returns bad values so that
> > QPixmapCache thinks all those images inserted are the same - which
they
> > are not!
> >
> > values found for cacheKey() :
> 
> These are all valid keys, e.g. generated keys don't start at 0. Do you
> have an example where we can see this buggy behavior?
> 
> > looks to me like the 64 bit arithmetic used there is buggy...
> >
> > Visual Studio 2003 and Windows XP used here.

i noticed that if i prevent empty pixmaps (isNull()=true) from being
inserted into the cache, everything works again.

using qt 4.2.2 this was working fine (inserting null pixmaps). i was
doing this because checking if an image exists also costs time.

it seems that now (Qt4.3.0rc1) if i enter a null pixmap into the cache,
this will lead to consequent calls to QPixmapCache::find(key,pm)
returning "false positives", i.e. returning true for a key that has not
been inserted yet. the returned pixmap is empty.

debugging further reveals:
> 0xffffffffffffffff, <--- this is the problematic value 
> 0xfffffff400000000
> 0xfffffff200000000
> 0xfffffff100000000

i get a cacheKey() of 0xffffffffffffffff for (some) empty pixmaps, but
this key value is also used as "not found" value in the QHash cacheKeys,
so that this function consequently returns the null pixmap for unknown
keys:

QPixmap *QPMCache::object(const QString &key) const
{
    return QCache<qint64, QDetachedPixmap>::object(cacheKeys.value(key,
-1));
}

here is a compilable example program: (you owe me one for this ;-)

#include <QtGui>
#include <QtDebug>
int main(int argc, char *argv[])
{
	QApplication app(argc, argv);

	QPixmap pm;
	qDebug() << QPixmapCache::find("unknown",pm) << "," <<
pm.isNull(); 
	// false, true

	QPixmapCache::insert("null",pm); 
	// still fine, this has a cacheKey() of 0

	qDebug() << QPixmapCache::find("unknown",pm) << "," <<
pm.isNull(); 
	// false, true

	pm.load("blabla-unknown-path"); // load fails
	QPixmapCache::insert("didntload",pm); 
	// this has a cacheKey() of -1 which breaks things!

	qDebug() << QPixmapCache::find("unknown",pm) << "," <<
pm.isNull(); 
	// true, true: not entered, but now found!!
}

Cheers,
Peter

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 6 in thread

Peter Prade wrote:

[snip]

> here is a compilable example program: (you owe me one for this ;-)
> 
> #include <QtGui>
> #include <QtDebug>
> int main(int argc, char *argv[])
> {
> 	QApplication app(argc, argv);
> 
> 	QPixmap pm;
> 	qDebug() << QPixmapCache::find("unknown",pm) << "," <<
> pm.isNull(); 
> 	// false, true
> 
> 	QPixmapCache::insert("null",pm); 
> 	// still fine, this has a cacheKey() of 0
> 
> 	qDebug() << QPixmapCache::find("unknown",pm) << "," <<
> pm.isNull(); 
> 	// false, true
> 
> 	pm.load("blabla-unknown-path"); // load fails
> 	QPixmapCache::insert("didntload",pm); 
> 	// this has a cacheKey() of -1 which breaks things!
> 
> 	qDebug() << QPixmapCache::find("unknown",pm) << "," <<
> pm.isNull(); 
> 	// true, true: not entered, but now found!!
> }

Indeed, that's a nice little bug. It works under Linux because the keys 
that are generated differs slightly. Anyway we'll get that fixed (most 
likely for 4.3.1). Thanks for the example and the report.

Regards,
--
 [ signature omitted ] 

Message 7 in thread

On Friday 18 May 2007, Jon Hood wrote:
> I get the following error when trying to compile php-qt from subversion
> sources using qt-4.3.0rc1:
> 
> /home/jon/projects/ggui_rc/trunk/smoke/qt/x_5.cpp:4954:   instantiated from
> here
> /usr/include/qt4/QtCore/qglobal.h:1558: error: invalid application of
> 'sizeof' to incomplete type 'QUrl'
>
> The error appears in this assignment:
> QList<QUrl> xret = this->QFileDialog::sidebarUrls();
> 
> sidebarUrls() is supposed to return a QList<QUrl>, and since the errors are
> happening in the qt4 headers, I thought I'd ask you guys if this is a qt
> error or a php-qt error.
It says that QUrl is not defined, so a #include <QUrl> is missing somewhere.
It's a bug in smokeqt. Add that include at the top of x_5.cpp to get going, but
I think that file is generated..

-- 
 [ signature omitted ]