qt4

How to delete a QProcess instance correctly?

Hi everyone! I have a class looking like this: class FakeRunner : public QObject { Q_OBJECT private: QProcess* proc; public: FakeRunner(); int run() { if (proc) return -1; proc = new QProcess(); QStringList args; QString programName = "fake.exe"; connect(comp, SIG...

Speed of QHash lookups using QStrings as keys.

I need to draw a dynamic overlay on a QImage. The component parts of the overlay are defined in XML and parsed out to a QHash<QString, QPicture> where the QString is the name (such as "crosshairs") and the QPicture is the resolution independent drawing. I then draw components of the overlay as they are needed at a position determined dur...

How to get decimal value of a unicode character in c++

For one of my opensource project, i need to compute decimal equivalent of given unicode character. For example if tamil character L'அ' given, output should be 2949 . I am using c++ in Qt environment. I googled and couldnot find a solution for this. Pls help if you know a solution for this. ...

Start and run a class member function in background, in QT/C++

Once a minute I want to run a task, not blocking other GUI functions. I heared somthing about QConcurent::run ... Or should I use signals and slots? ...

How to use QCOMPARE Macro to compare events

Hi, I have MyWindow class which popus a blank window, which accepts a mouse click, I need to unit test the mouse click event Code snippet: void TestGui::testGUI_data() { QTest::addColumn<QTestEventList>("events"); QTest::addColumn<QTestEventList>("expected"); Mywindow mywindow; QSize editWidgetSize = mywindow.size(); QPoint clickPoin...

Qt 4.6 Adding objects and sub-objects to QWebView window object (C++ & Javascript)

I am working with Qt's QWebView, and have been finding lots of great uses for adding to the webkit window object. One thing I would like to do is nested objects... for instance: in Javascript I can... var api = new Object; api.os = new Object; api.os.foo = function(){} api.window = new Object(); api.window.bar = function(){} obvious...

Simple menubar using Qt4

Hi all i'm trying to make a simple GUI with QT 4.6. i made a separete class that represents the menu bar: MenuBar::MenuBar() { aboutAct = new QAction(tr("&About QT"), this); aboutAct->setStatusTip(tr("Show the application's About box")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); quitAct = new QAction...

How to get the application font color in Qt

Hi, I want to put some text on my UI, I am drawing the text in paint event of a widget using painter.. Here is the sample code, which shows how I am drawing the text.. QWidget::paintEvent(painter); QPainter paint(this); paint.drawText(QPoint(10,30),"Duplex"); but, the text color is looks like the default theme color, how to set the...

How to connect to NetRemoting server with Qt4?

Hi everyone. Is it possible to connect to net remoting server with qt4 library? If this is possible how to do it? Where can I find any informations about it? ...

Qt4 2D Game Engine

Are there any 2-D Game Engines for Qt4 out there? I want a game engine that has collision detection, and runs smoothly with lots of sprites on screen. ...

Show a download list with qt4

What is the best way to show a list of downloads using QT4? 1 QListWidget 2 QTreeWidget 3 QTableWidget Thanks ...

QTextBrowser line spacing after a wordwrap

How do I set line spacing after a wordwrap in QTextBrowser? Ie. how dow I set line height? ...

building qt on windows 7 with visual studio 2010

Hi, was anyone able to build Qt on windows 7 (64-bit) with visual studio 2010? I've tried different compilers and -no-webkit option for configure, every time nmake fails with error code U1077. Would be very greatful for suggestions. Thanks in advance, Daryna ...

Using richtext in QTextEdit

What is exactly richtext and how do I format data in richtext in QTextEdit? ...

QLabel: interlinea/linespacing in WordWrap mode

How do I set line height in QLabel when in WordWrap mode? ...

QLabel: set color of text and background

How do I set color of text and background of a QLabel? ...

Is there a way to implement OnReady() callback in Qt4?

I want to do something which will access network when a QMainWindow is ready. I suppose I should not do it in the constructor, so I try to find a signal the widget will get and try to implement something like a OnReady() call back in other UI library. But I still can not find a way to do this. Thanks a lot in advance. ...

In QT 4.6 w/ Webkit: How to handle popup window requests (WebView::createWindow)?

Hi all, I'm new to QT and have been trying to create a test browser. What I'm trying to do now is to handle js-based popup requests. After reading the QT documentation, I learned that I need to re-implement the QWebView::createWindow method to do just that. Now I've re-implemented this method, but it seems to be not called when I try t...

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...

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...