qt4

Qt: Animating the 'roll down' of a QWidget

I have a QWidget that contains various other widgets. I want to animate it appearing on the screen by gradually revealing it from the top down, increasing it's height from 0 to whatever it's natural height would be. The way I have it currently is: mAnimation = new QPropertyAnimation(this, "maximumHeight"); mAnimation->setStartValue(0)...

Printing complex widgets in Qt

I have a complex widget with tons of different subwidgets, e.g. subclasses of QLabel. I want to print this widget, but obviously I do not want to print the background, I want to print with differing text colors or have the style of frames slightly modified. As I do not really want to iterate through all subwidgets with a special "print"...

How do I determine the height of a QTextDocument?

Given a specific width, I want to find out the height of a QTextDocument. In other words, if the QTextEdit that contains the QTextDocument is w wide, what is its minimum height h in order to fully display the document without the need for scrollbars? ...

How to determine the number of charecter will fit to screen in Qt

Hi, how to determine the number of character of particular font will fit to screen. how to implement it. Thanks ...

Events with QGraphicsItemGroup

In my application I want to use QGraphicsItemGroup for grouping items into one item. I played with it a little and not sure using it because when I want to catch events, events are merged together but I want to handle specific event with specific child. How can I achieve this? ...

How to install the Qt mobility ?

Hi, i have installed Qt 4.6.2 and developing the application for symbian. Now i want use Qt mobility API for accessing the contacts.. how can i install the Qt mobility and acces the API.. my build environment is windows XP :) Thanks ...

kdevelop intellisense

How can I enable the intellisence in KDevelop using C++ and QT? ...

Qt4 book says "make release", reality disagrees

According to various soures, for a Qt4 app you build the release or debug versions with "make release" or "make debug". In real life, these give errors. make: *** No rule to make target `debug'. Stop Only bare naked "make" works. I'm not sure what it produces. Running "strip" does reduce the executables' size, but gdb isn't find...

Qt Direct Connection

Hello I have created Qt tree control( and its nodes ) in different thread than the main thread. In the main thread I want to show context menu for the clicked node, so I am connectiong the actions in the menu with appropriate slots in the main thread. The connect function returns true , but slot is never executed. If I explicitly say i...

Qt4: QPrinter / QPainter only prints the first document

The problem is that my application only prints the first document fine. The second document is empty, only the page number is printed, the rest of the page is empty. In Qt4, I'm initializing the printer in the main.cpp in the following way: mw->printer = new QPrinter(QPrinter::HighResolution); mw->printer->setPaperSize(QPrinter::A5); m...

Coordinate confusion

I subclassed QGraphicsItem and reimplemented paint. In paint I wrote something like this for labeling the item: painter->drawText("Test",10,40); After some time I think It may be useful to handle labeling with seperate item. So I wrote something like this. QGraphicsTextItem *label = new QGraphicsTextItem("TEST",this); setPos(10,40);...

Features that require Q_OBJECT macro in Qt 4 other than signal - slots mechanism

Hi, I am using Qt 4.5 in windows XP. I know we have to use Q_OBJECT macro for signal - slot connection mechanism. But besides that, is there are any other reasons to use the Q_OBJECT macro? I recently come to know that for some other meta-object features we require the Q_OBJECT declaration. What are those features beside the Signal-slot...

Qt4.6: QTextDocument <HR> tag prints only very thin, almost invisible hair lines

When printing a QTextDocument with doc->print() I almost cannot see the horizontal rules inserted by <hr>. When printing to PDF these are clearly visible. But when printed to a printer these lines are very very thin lines, almost invisible on the paper. How do I fix this? I currently helped myself by inserting an <img> with a black pixe...

Is it possible to connect slots of a model object to the GUI in QT4 -Designer?

So I try to build a Model-View window using QTDesigner and C++. For that reason I created a QOBject derived class as my model. It provides slots and signals to access it like: setFileName(QString) or fileNameChanged(QString). I got a little into using signal drag and drop in QTDesigner and found it quite VA-Smalltalk-Like nice. After a...

How to create a compact Qt4 vBoxLayout

Hello all, I've got a vBoxLayout which contains 3 simple buttons, when I increase the size of the widget containing the layout, the spacing between the buttons increases. I would like to stop this behaviour and keep the buttons in a consistent and compact layout, regardless of the size of the parent widget. This is what I've got so far, ...

Qt/PyQt dialog with togglable fullscreen mode - problem on Windows

I have a dialog created in PyQt. It's purpose and functionality don't matter. The init is: class MyDialog(QWidget, ui_module.Ui_Dialog): def __init__(self, parent=None): super(MyDialog, self).__init__(parent) self.setupUi(self) self.installEventFilter(self) self.setWindowFlags(Qt.Dialog | Qt....

Declaration of struct variables in other class when obtained by getters

Hi, I am using Qt 4.5 so do C++. I have a class like this class CClass1 { private: struct stModelDetails { QString name; QString code; ..... // only variables and no functions over here }; QList<st...

QT- QImage and multi-threading problem.

Greetings all, Please refer to image at : http://i48.tinypic.com/316qb78.jpg We are developing an application to extract cell edges from MRC images from electron microscope. MRC file format stores volumetric pixel data (http://en.wikipedia.org/wiki/Voxel) and we simply use 3D char array(char***) to load and store data (gray scale valu...

Qt Console Application Tutorial?

Are there any Qt Console Application example/tutorial? I am looking for one that utilize the event loop. Most of the examples I have seen does not use the loop. ...

what's the best way to learn C++ and Qt at the same time?

Hi I did A Google search and couldn't find anything, so I wanna learn Qt/C++ my University (I'm a first year CompSci Student) won't be teaching C++ next year which is a big disappointment I already know Python and dabbled in LaTeX, Javascript, C++ I'm currently helping out a free software project Clementine but it's programmed in Qt/C...