qt4

How can I check for a blank image in Qt or PyQt?

I have generated a collection of images. Some of them are blank as in their background is white. I have access to the QImage object of each of the images. Is there a Qt way to check for blank images? If not, can someone recommend the best way to do it in Python? ...

PyQt Automatic Repeating Forms

I'm currently attempting to migrate a legacy VBA/Microsoft Access application to Python and PyQt. I've had no problems migrating any of the logic, and most of the forms have been a snap, as well. However, I've hit a problem on the most important part of the application--the main data-entry form. The form is basically a row of text boxes...

Ruby and Qt4 ...

when i used to use Qt3, i was only have to design my program interface, then use the "rbuic" command to convert the .ui file into a .rb file, and problem solved ... but the thing is, now I'm using Qt4, and there is no such thing like "rbuic", so I'm i suppose to write the whole ruby program to run an interface by my self, if yes, then I'...

QT 4.5 - how do I get a QPainter device in a QGraphicsView

I am trying to do a painting program with QT 4.5, so I am using the QGraphicsView for the canvas, and QGraphicsScene to store the items drawn. For some reasons, I just couldn't get a QPainter context in my own derived QGraphicsView class DrawingCanvas : public QGraphicsView { DrawingCanvas::DrawingCanvas(QWidget * parent); ... }; ...

Porting a Qt Application from Linux to Windows

I built a qt application that uses opengl on linux and am trying to build it on windows. I used g++ to make it on linux and am using command line nmake for Visual Studio 2005 to build it on windows. When I tryed to build my application I typed qmake -makefile app.pro nmake The nmake failed and said "bool qt_win_owndc_required"... alr...

Missing QMenuBar in Qt4 apps on OSX

My Qt4 apps with a QMenuBar show up fine under Linux and Windows, but will not display under OSX. I have a Xeon 64bit Mac Pro with OSX 10.5.7. I'm using Qt 4.5.2. I've tried building my apps with qmake -spec macx-g++ and using an xcode project. Neither seem to work. Any help is much appreciated. Thanks, Regis ...

Implementing drag and drop with QT 4.5 using QT Creator environment

We're about to commit to Qt and C++ (sigh) to do some cross-platform development. The latest version of Qt 4.5 seems very nice as does the QT Creator IDE, which although simple compared to other IDEs, is a good way to get started. I'm trying to understand how to do drag and drop into QT widgets from the "outside" world. As far as I can ...

How can I change QT GUI widgets on a QMainWindow from a QThread which is a member?

I have my main form made QT Designer and inheriting from QMainWindow and the UI. I need to have other threads running, and I need those threads to change things on the main form, eg progress bars, LCDs. How do I give the other thread access to the widgets on the main form? Thanks for any help. ...

Representing Date in http header using QDateTime

HI, Date in http header is represented according to RFC 822 (As Updated by RFC 1123), like Wed, 15 Jul 2009 12:16:22 GMT. Able to represent in QDateTime using QDateTime testDate = QDateTime::fromString("Wed, 15 Jul 2009 12:16:22","ddd, dd MMM yyyy HH:mm:ss"); but without the timezone, wants to represent server time in UTC. Is it po...

Saving QPixmap to JPEG failing (Qt 4.5)

Hello. I have the following code. QString fileName = QFileDialog::getSaveFileName( this, tr("Output Image file"), (""), tr("PNG (*.png);;JPEG (*.JPEG);;Windows Bitmap (*.bmp);;All Files (*.*)") ); if(fileName != "") { QwtPlot* pPlot = ... QSize size = pPlot->size(); QRect printingRect(QPoint(0, 0), size); QPi...

[QTCreator 1.2] set include path with environment variable value

We are trying to use the MITK library with Qt on Linux. Unfortunately MITK has no install functionality and it also depends on ITK and VTK. So we end up with header files scattered in many directories. We would like to specify the list of directories to add in the include path in an environment variable like this : INCPATH+=$MITK_INC...

QT + How to call slot from custom C++ code running in a different thread.

Hello, I am new to QT and I am doing some learning. I would like to trigger a slot that modify a GUI widget from a C++ thread(Currently a Qthread). Unfortunatly I get a: ASSERTION failed at: Q_ASSERT(qApp && qApp->thread() == QThread::currentThread()); here is some code: (MAIN + Thread class) class mythread : public QThread ...

Qt4 QMenu items sorting

I am using QT4 and dynamically adding entries to a QMenu. Is it possible to sort the entries in the QMenu without deleting it and creating a new one? I originally thought there was a function to insert at a specific location so I could sort on insert, but I have not been able to locate it. ...

What did QWidget* QApplication::mainWidget() become in Qt4?

I am porting an application from Qt3 to Qt4, and need a Qt4 replacement for QApplication::mainWidget() which used to return the top-level widget in Qt3. Does anyone know how to do this in Qt4? ...

Qt 4.5 Why does a QGraphicsItem::scenePos() keeps returning (0,0)

I have been toying with this piece of code: QGraphicsLineItem * anotherLine = this->addLine(50,50, 100, 100); qDebug() << anotherLine->scenePos(); QGraphicsLineItem * anotherLine2 = this->addLine(80,10, 300, 300); qDebug() << anotherLine2->scenePos(); Where the this pointer refers to a QGraphicsScene. In both cases, I get QPointF(0,0...

PyQt: how to handle auto-resize of widgets when their content changes

I am having some issues with the size of qt4 widgets when their content changes. I will illustrate my problems with two simple scenarios: Scenario 1: I have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the one-line string doesn't fit into the widget at its current size anymore. I must select ...

Gui for KDE and Gnome

I want to write a gui to an application that is now CLI that needs to "look good" in both KDE and Gnome DE's, taking optimal advantage of a users settings for appearance. If I select Qt or GTK+ will I be able to do this? Do they integrate well with both DE's? Or does a KDE user need gnome libs and vice versa to run them? My developme...

Problem with qhttp example qt 4.4.3

hi i'm new here. i'm trying to use qhttp for a update app. but there is a problem for me wich i can not solve. here is the problem: i try to download a file(works perfectly) but if there is no connection to the www the file is created but has 0byte, so that my old file is overritten, which is not so good for the application trying to use...

QT 4.6 release date

Can't find when QT 4.6 will be available (not even on Trolltech's site). Any ideas? EDIT: I don't understand the down votes, especially since I've received an answer with 6 up votes. If you're voting a question down, it would be nice to add a comment explaining why. ...

How do I best organize a Visual Studio 2008 + Qt Codebase?

I have a legacy MFC app I am building in VS2008 with both x86 and x64 builds. I'm trying to add Qt support to it so I can innovate more quickly in the UI. It appears Qt has a large number of compile options that I may want to tweak specifically for my app (not source code changes...I want to be LGPL and generate the normal QtCore4.dll,...