qt

How to debug lost events posted from non-GUI thread in Qt?

As the subject says, I'm posting events from non-GUI thread (some GStreamer thread, to be precise). Code looks like this: GstBusSyncReply on_bus_message(GstBus* bus, GstMessage* message, gpointer data) { bool ret = QMetaObject::invokeMethod(static_cast<QObject*>(data), "stateChanged", Qt::QueuedConnection); Q_ASSERT(ret); r...

Qt 4.6 OpenGL GLSL

I'm trying to find like NeHe's tutorials for Qt that are all in GLSL. Because lets face it, OpenGL in the old days are dead and Shaders are the only way now. And with Qt-4.6 they introduced the QMatrix4x4, QVector3, and the Shader classes. But I cannot find any tutorials for this. All the ones I do find, all use crappy SDL and/or GLUT (...

Determine signals connected to a given slot in Qt

I've injected myself into a Qt application, and I'm attempting to figure out what signals a given slot is connected to, but can't find any information on doing this. Is there a mechanism for doing this out of the box? If so, is this exposed to QtScript? (If not, I can wrap it easily enough.) If there is no such mechanism, what would ...

Subclassing QGraphicsItemGroup

Hi everyone I have system that has classes derived from QGraphicsWidget. I manage derived class objects in layouts on QGraphicsScene. Now I need a compound item that contain two or more QGraphicsWidget in it and also I need to put that item inside my layout. So I choose QGraphicsItemGroup and write I class like this. class CompositeIte...

[Qt] Check octal number

Hello, I write simple application in C++/Qt. And i have a text and some octal number in it. My app splits this text by spaces. And i need to check octal numbers from text. How can i select octal numbers from this text with regular expressions? Thank you. ...

Functions connected to signals in QtScript (on Qt 4.5.2) are not firing

I've injected into a proprietary Qt (4.5.2) application, added my own compatible build of QtScript, and have managed to get access to all the signals I need. However, when connecting to them (via QtScript) my functions are never called. I've come up with a few theories for why this is and I've tested everything I can think of, but I've...

How strict to be when using Qt framework?

I'm building a Qt application that needs to use libssh, a SSH client library. libssh (understandably) performs its own network connections, however Qt has its own infrastructure for network connections (QTcpSocket etc). Should I worry about these differences? Should I be trying to make libssh make network connections via QTcpSocket... O...

call by reference problem : with QVector

I have in an Object an QVector of Coordinates (my type) that i want to transfer to an other Vector ( i validate and than want to use ist ). Header bool getVector(QVector<Coordinates> &getCoordinates ); C File static QVector<Coordinates> current; int getVector( QVector<Coordinates> &getCoordinates) { .... stuff ... getCoordinat...

QValidator for hex input

I have a Qt widget which should only accept a hex string as input. It is very simple to restrict the input characters to [0-9A-Fa-f], but I would like to have it display with a delimiter between "bytes" so for example if the delimiter is a space, and the user types 0011223344 I would like the line edit to display 00 11 22 33 44 Now if th...

Sorting and displaying a custom QVariant type.

Hello, I have a custom type I'd like to use with QVariant but I don't know how to get the QVariant to display in a table or have it sort in a QSortFilterProxyModel. I register the type with Q_DECLARE_METATYPE and wrote streaming operators registered via qRegisterMetaTypeStreamOperators but for whatever reason when I use the type with a ...

Subclassing QGraphicsLayoutItem

How exactly can I subclass QGraphicsLayoutItem? I write a class that subclass QGraphicsLayoutItem and reimplement sizeHint and setGeometry but when I add my custom item to linear or grid layout. It does not shown? What is missing? Here is my trial. //basicitem.h #include <QGraphicsWidget> #include <QtCore/QRectF> #include <QtGui/QP...

Is it possible to deselect in a QTreeView by clicking off an item?

I'd like to be able to deselect items in my QTreeView by clicking in a part of the QTreeView with no items in, but I can't seem to find anyway of doing this. I'd intercept a click that's not on an item, but the QTreeView doesn't have a clicked signal, so I can't work out how to do this. ...

getting keyboard events with pyqt

hello i converted recently from wxpython to pyqt and im still facing alot of problems since im still noob in pyqt so is it possible to detected if user pressed (CTRL+key ) in pyqt ? and how ? i've been trying to find an answer for this for 3 days . if you know website or a good place to learn pyqt, it will be highly appreciated t...

Creating Custom QT Library

I created a static Qt library by using VS2005. It created an extra file "test_global.h" besides expected ones(test.h and test.cpp). test_global.h #ifndef TEST_GLOBAL_H #define TEST_GLOBAL_H #include <Qt/qglobal.h> #ifdef TEST_LIB # define TEST_EXPORT Q_DECL_EXPORT #else # define TEST_EXPORT Q_DECL_IMPORT #endif #endif // TEST_GLOBA...

how to insert last input as first table record in QwebKit

Hello all im using Qwebkit and i like to be able to insert into html table each data input that comes last as first record ( ...my data ...) in to the table . here is my code this is only example : ui.webView->page()->mainFrame()->setHtml("<html><body><p>HTML Table Test</p>" "<table id=\"mainT...

Object Deletion: use parent or not

Which one do you prefer to delete objects? Especially in QT, but other practices are also welcome. These two alternatives seem same to me, are they? 1.Bound to another class, and destroy when it is destroyed. SomeClass::SomeClass{ socket_ = new QTcpSocket(this); } or 2.Destroy in the destructor of class SomeClass::SomeClass{ soc...

Should I base my Embedded Linux product on Qt?

My company is developing a medical product. One of the components is a pda-like platform that will run embedded linux. We were considering Qt as the UI framework but found out that Qt is a lot more than that (we are not familiar with Qt). In general, the device needs to do the following: 1. Receive measurements over USB HID from anoth...

Use of qsrand, random method that is not random

Hey everyone, I'm having a strange problem here, and I can't manage to find a good explanation to it, so I thought of asking you guys : Consider the following method : int MathUtility::randomize(int Min, int Max) { qsrand(QTime::currentTime().msec()); if (Min > Max) { int Temp = Min; Min = Max; Max...

QStringListModel sorting

How can sort QStringListModel? Thanks a lot. ...

QLocalSocket and QLocalServer in browser plugins

Hi, I have a simple doubt. Does the ipc mechanism in qt work when we use it for developing browser plugins? The reason i ask this is that I can easily get the QLocalSocket and QLocalServer communication to work in a qt application, but when i write a similar piece of code in a browser plugin dll i see that the server does not accept a n...