qt

Get time of execution piece of code

How do I get milliseconds time of execution of a piece of code in Qt/C++? ...

How to set visibility for textblocks in QTextEdit?

Hi everyone, i tried to hide textblock's in QTextEdit, but it doesn't work: block = textedit.document().begin() block.setVisible(False) This code works fine for QPlainTextEdit, but not for QTextEdit. In documentation i haven't found any mention of how it should work for QTextEdit, just following: void QTextBlock::setVisible ( bo...

How do I execute QTcpSocket in a different thread?

How do I execute QTcpSocket functions in a different thread? ...

jamvm1.5+classpath-0.96+qt4.3 QPixmap: It is not safe to use pixmaps outside the GUI thread

jamvm -Dawt.toolkit=gnu.java.awt.peer.qt test QPixmap: It is not safe to use pixmaps outside the GUI thread I'm new to Qt, I don't know how to deal with it. ...

How to use QSerialDevice in Qt?

Hello, I am trying to use QSerialDevice in Qt to get a connection to my serial port. I also tried QextSerialPort before (which works on Windows Vista but unfortunately not on Windows XP ..) but I need an API which supports XP, Vista and Win7... I build the library and configured it this way: CONFIG += dll CONFIG += debug ...

Qt - invalid conversion to child class

I'm drawing polygons using the Graphics View framework. I added a polygon to the scene with this: QGraphicsPolygonItem *poly = scene->addPolygon(QPolygonF(vector_of_QPointF)); poly->setPos(some_point); But I need to implement some custom behaviour like selection, mouse over indicator, and other similar stuff on the graphics item. So I...

Set icon without *.pro

Hi all. I have an application written with Qt (I use VS + Integrator). Need to set an icon for it. I read "Setting the Application Icon" tutorial, but i can't use this method because I have no *.pro file. Googled for an hour and found no solution :( Any suggestions? ...

c++ property class structure

I have a c++ project being developed in QT. The problem I'm running in to is I am wanting to have a single base class that all my property classes inherit from so that I can store them all together. Right now I have: class AbstractProperty { public: AbstractProperty(QString propertyName); virtual ...

I need to get 32 bit qt libs

Is there a quick way to obtain a set of 32 bit qt libraries? I need to put them on my 64 bit ubuntu os which already has qt installed (64 bits). ...

ISO C++ forbids declaration of 'QPushButton' with no type in QT Creator

I am running QT Creator on a Linux Ubuntu 9.10 machine. I just got started with QT Creator, and I was going through the tutorials when this error popped up while I was trying to build my project: "ISO C++ forbids declaration of 'QPushButton' with no type". This problem appears in my header file: #ifndef MAINWINDOW_H #define MAINWINDOW_H...

Static linking in Qt --> link errors in VS 2008

Today I dediced to make static linking in Qt. I used Qt4 with Visual Studio and static C runtime article. The 3rd step took quite a long time. When it was finished I opened my project in VS 2008, made Build->Clean Solution and try to Release. Unfortunately I got link errors: warning LNK4098: defaultlib 'libcmt.lib' conflicts with...

QT Jambi HTML5 Video

Is it possible to use the HTML5 <video> element within a QT Jambi QWebView? I have set up a basic app, but it doesn't display <video> elements. ...

What are the real-world benefits of declarative-UI languages such as XAML and QML?

I'm currently evaluating QtQuick (Qt User Interface Creation Kit) which will be released as part of Qt 4.7. QML is the JavaScript-based declarative language behind QtQuick. It seems to be a very powerful concept, but I'm wondering if anybody that's made extensive use of other, more mature declarative-UI languages like XAML in WPF or Sil...

STL container to pop() by priority?

I'm writing a thread-pool for Qt as QRunnable doesn't handle event loops in new threads. Not too familiar with STL, what would be the best way to pop() something by priority? Priority should probably be a property of MyRunnable imo, but I can always give that info to an STL container when adding the runnable to the queue. ...

How do I define an Icon in QT with a compile time predefined image?

I have a png file on disk at compile time. I'd like to have it included into the compiled executable. How do I define such an icon in Qt? ...

Spacer between elements in visual studio

What shall i use to make a spacer between elements in visual studio like that in QT http://www.tuxradar.com/files/qt_menq_spacers.jpg ...

Displaying (rendering) HTML from a string in QT

I have html in a QString, what widget can I use to display it? (QWebView is not necessary as I dont access Internet) ...

Trying to make a plugin system in C++/Qt

I'm making a task-based program that needs to have plugins. Tasks need to have properties which can be easily edited, I think this can be done with Qt's Meta-Object Compiler reflection capabilities (I could be wrong, but I should be able to stick this in a QtPropertyBrowser?) So here's the base: class Task : public QObject { Q_OBJECT ...

how code a Image button in PyQt?

Im trying to do simple audio player, but I want use a image(icon) as a pushbutton. ...

How to shift pixels of a pixmap efficient in Qt4

Hello, I have implemented a marquee text widget using Qt4. I painted the text content onto a pixmap first. And then paint a portion of this pixmap onto a paint device by calling painter.drawTiledPixmap(offsetX, offsetY, myPixmap) My Imagination is that, Qt will fill the whole marquee text rectangle with the content from myPixmap. Is ...