qt

This code for creating a QPolygon in Pyqt is stopping my application! Help?

HI all, The following code: self.painter = QtGui.QPainter(self) self.painter.setRenderHint(QPainter.Antialiasing) self.painter.translate(482,395) self.painter.scale(300,300) self.painter.save() needle = Qt.QPolygon([QPoint(30, 0), QPoint(-30, 0), QPoint(0, 200)]) self.painter.setBrush(Qt.cyan) self.painter.setPen(Qt.black) self.painter...

QGridlayout changes height of row

I have a problem with a QGridLayout. One row of my layout contains an element (QProgressbar) that is normaly hidden. When there is some progress to report i call show on it. The problem is that when i call show on the QProgressbar the row above the row containing it will be slightly resized in height (1-3 px). So the whole layout does a ...

[qt] Non-pixelized rounded corner for top-level window

Hi, I want to set rounded corners on a QDialog. Since it is a top-level window, border-radius doesn't work, so I've to do this : QRegion EnterPinDialog::roundedRect(const QRect& rect, int r) { QRegion region; // middle and borders region += rect.adjusted(r, 0, -r, 0); region += rect.adjusted(0, r, 0, -r); // top l...

QT Thread_ Issues

Hi, I am using the following code.. But I got the error like THREAD Started QObject: Cannot create children for a parent that is in a different thread. (Parent is CGNetwork(0x10151d0d0), parent's thread is QThread(0x1016015b0), current thread is RenderThread(0x10155de40) Code: RenderThread.cpp RenderThread::RenderThread(CGNetwor...

Application icon on Qt 4.6.3 / Symbian S60 5th Edition

I am trying to make an icon for my Qt 4.6.3 application, which is currently running on Symbian S60 5th edition. The application runs fine, except for its icon, which I have been unable to set by any means. I have read and tried a number of articles, including [1], [2], [3], [4] and [5], but in vain. What could I be doing wrong, or what s...

How to Remove Vertical slider from QWebView that displays GoogleMap with current lacation?

Hi, I want to remove the Vertical slider from QWebView that displays GoogleMap with current lacation details. My QWebView size is Width:342 and Height:501. In java script I have mentioned the following: <div id="map" style="width: 320px; height: 490px"> How ever when I run the application on Nokia N97, I got the map but height of t...

Qt:how to give a delay in loop execution

hello, In my application I want that when a loop is being executed,each time the control transfers to the loop,each execution must be delayed with a particular time.Can anyone tell me how can i do this? Thank you. ...

How to thread the sorting of a QSortFilterProxyModel?

The main view of my application contains a one-level (no children) QTreeView that displays on average 30,000 items. Due to the way the items are created, they are inserted into the model unsorted. This means that on application startup I have to sort the items in the view alphabetically, which takes nearly 1 second, leaving an unresponsi...

Set producer value for PDFs created by QPrinter

I'm currently producing PDFs using python and PyQT. I'd like to change the "Producer" value of the PDF's document information, currently it is set to "Qt 4.6.2 (C) 2010 Nokia Corporation and/or its subsidiary(-ies)". I've looked through the QPrinter reference, and nothing obvious stuck out that I could set. How do I change the docum...

Qt thread call issues

Please help me. I am struck-up with thread concept. Actually my problem : I want to display the cities List in the combobox. I am getting cities list from the webservice. I am using thread for update the combo box value after webserice call finished. Here I can call the webservice. But I couldn't get the Reply. I am using the followin...

qt mysql query giving different result on different machine

QSqlQuery query; QString queryString = "SELECT * FROM " + parameter3->toAscii() + " WHERE " + parameter1->toAscii() + " = \"" + parameter2->toAscii() + "\""; bool retX = query.exec(queryString); above code when bundled as an application returns true on the machine it has been created. it returns false on other machines. how is it possi...

Value access in C++

HI, I have two clases A and B, Here A is inheriting B and now i want to access a variable in B from A, I included A header in B and tried to access but showing some error in QObject. Is it possible to acces like this.. Please help ...

IVideoWindow update problem

Hi all! I want to render the video from my webcam into QWidget. I've set QWidget, as a parent to IVideoWindow. Here is the code: m_iVideoWindow->put_Owner((OAHWND)widget_->winId()); m_iVideoWindow->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN); m_iVideoWindow->put_Left(0); m_iVideoWindow->put_Top(0); widget_->setChild(m_iVideoWindow); A...

Problem with positioning a copy of a QGraphicsPolygonItem in a QGraphicsScene

Hi. I have an application where a QGraphicsPolygonItem (objectA) has the following characteristics: ScenePos: X=250 Y=125 Transform(): |----|---|---| | 2 | 0 | 0 | | 0 | 1 | 0 | | 50 | 0 | 1 | |----|---|---| Now, I am creating and new QGraphicsPolygonItem (objectB) and setting its scenepos and Transform the same as object A: obj...

does Qt implement _countof or equivalent?

I really like using the _countof() macro in VS and I'm wondering if there is an OS-generic implementation of this in Qt. For those unaware, _countof() gives you the number of elements in the array. so, wchar_t buf[256]; _countof(buf) => 256 (characters) sizeof(buf) => 512 (bytes) It's very nice for use with, say, unicode strings, wh...

How to create a Bundle Library (mh_bundle) with qmake on Mac OS X?

Hi All, I'm a newbee to Qt and qmake and I like to know if it's possible to instruct qmake to build a "Bundle Library" (mh_bundle) under Mac OS X using the TEMPLATE and CONFIG variables? I already managed to make a "Dynamic Library" (mh_dylib) and a "Framework" (mh_dylib). If there is no direct solution, how is the best way to achieve t...

Why are slots being called from the main thread?

I have a Qt application that has two threads: the main thread that handles the GUI and a second thread that manages network connections. Here is the thread code: void thread::run() { QTcpServer server; server.connect(&server,SIGNAL(newConnection()),this,SLOT(OnConnect())); //... } When I put a breakpoint at the start of ...

How does the HTTP protocol work exactly?

I thought I had this all figured out, but now that I'm writing a webserver, something is not quite working right. The app listens on a port for incoming requests, and when it receives one, it reads everything up to the sequence "\r\n\r\n". (Because that signifies the end of the headers - yes, I am ignoring possible POST data.) Now, aft...

CMake, Qt, gcc and precompiled headers

Hi! I'm (once again) struggling with the creation of precompiled headers in conjunction with gcc and Qt on the Apple platform. When now creating my precompiled header I use a code section (based on good old "PCHSupport_26.cmake") to extract the compile flags as follows: STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_n...

Detect when mouse enter QGraphicsItem with button down

I want to detect when the mouse cursor moves in over a QGraphicsItem while a mouse button is pressed, i.e. the button is pressed before the mouse enters the item. My first idea was to use hoverEnterEvent, but it doesn't seem to trigger when the left mouse button is pressed. My other idea was to use dragEnterEvent, but it doesn't seem to ...