qt4

WYSIWYG with Qt - font size woes

I am creating a custom Qt widget that mimics an A4 printed page and am having problems getting fonts to render at the correct size. My widget uses QPainter::setViewport and QPainter::setWindow to mimic the A4 page, using units of 10ths of a millimetre which enables me to draw easily. However, attempting to create a font at a specific ...

Getting started with Qt4: which book to read?

I'm trying to learn Qt4. I have written code in C, C#, Python, PHP, Java and JavaScript before, but not in C++. Is there a book on Qt4 that you can recommend me? I've found some books I might like, but they're a little on the expensive side. I'm not ready to commit to Qt before I've played with it for a while, so I'd prefer to keep it u...

Connecting click signal to QGraphicsView

Hi, how can I connect a clicked() signal to a widget which doesn't seem to handle it (like QGraphicsView). If I try to rely on autoconnect, I get only: QMetaObject::connectSlotsByName: No matching signal for on_xxx_clicked() What's the solution for situations like that? Thanks ...

How to remove index number from QTablewidget

Hi, Please help. How can i remove index from QTableWidget ...

QT4 - MDI model or Dock Windows?

Greetings, In the QT application we develop we need to display several 'Viewer windows'(to display data in XY plane ,YX plane,XZ plane and in 3D). We were hoping to use MDI application model ,but later client asked for a requirement to drag and view 'Viewer windows' in multiple desktops.(using multiple monitors). This can not be done u...

Animated text with QPainter

Is it possible to draw an animated text with QPainter? I only want to change color of text periodically. If possible how to achieve? ...

how to get selected item in pyqt Qmenu

hello is there any way to get the selected item in a qmenu ? i want to bind all items in that list to one function and get the item once user click it . i've been looking for a way to get the item's label or index for 3 days , but couldn't find it . any ideas ? thanks in advance ...

HowTo set Icon to Qt Application, created with Qt Visual Studio Add-in?

Hello. Here is what I have: Visual Studio 2008 (on 32-bit Windows XP) Qt libraries 4.6.2 for Windows (VS 2008, 194 MB) Visual Studio Add-in (44 MB) After I installed all the software, I created simple Qt Application project, with Visual Studio: menu File | New | Project... and Qt4 Projects | Qt Application. Build it, and here is th...

QGraphicsItem repaint

I want to change text color inside a rectangle periyodically Here is my trial: TrainIdBox::TrainIdBox() { boxRect = QRectF(0,0,40,15); testPen = QPen(Qt:red); i=0; startTimer(500); } QRectF TrainIdBox::boundingRect() const { return boxRect; } void TrainIdBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt...

QT4 Designer - Implement Widget

I'm currently trying to get into QT4 and figure out a workflow for myself. While trying to create a widget which allows the user to connect to a hostname:port some questions appeared. The widget itself contains a LineEdit for entering the hostname, a SpinBox for entering the port and a PushButton which should emit a connect(QString host...

I want to run the examples of QtOpenCl, i.e. Qt in OpenCl. Installation and setup help?

The thing is I have to run the OpenCl examples, as given here:http://labs.trolltech.com/blogs/2010/04/07/using-opencl-with-qt/. The problem is that I have no clue where to start. I downloaded the source for QtOpenCl but it needs a valid OpenCl installation. I have Qt installed already. How do I install OpenCl? I don't have a GPU at hom...

Qt QPainter error. Rotating an ellipse using horizontalSlider. Help?

Well I have to create a simple box which rotates an ellipse and some text depending upon value from horizontalSlider/spinBox. The widget has to be resizable, And size of the ellipse has to change depending upon that. For now only the ellipse is being painted. The text painting will be added if this works. The problem is that if the windo...

What is the mistake in this code

Hey, can you geeks can tell me the solution for this, i have a listview, when i tap on any item,a pop-up list should appear, after that based on the selected item from pop-up list i will update my UI. i have written a code to get the popup list after tapping on any item from my view. my problem is once i tap on any item, will get a p...

Qt: How to find why QTextEdit is being closed?

Hello everyone, I write a simple MDI text editor using Qt 4. When a text window (MyDoc derived from QTextEdit) is being closed, I want to know whether it is being closed by pressing [X] on that child window or by closing the whole application. Then I will use this info some way (say, I want to issue a message box with an additional ques...

PyQt blocking version of show()

I've got a fairly cpu-intensive application, but all of the cpu-intensive stuff is started by clicking a QPushButton. When the button is clicked, a hidden QLabel is show()n. Apparently, show() is non-blocking. Unfortunately, this means that the cpu-intensive stuff is practically half-done before the label show()s up. How can I make s...

Hook key & key combinations from keyboard with Qt 4.6

Let's say I have a window-less application which has only an icon on the Taskbar (Windows, Mac OS X & Linux). I want it to capture some key & key combinations, let's say Right Control + Right Shift. Upon keying in correct, combination, it will do something, say take screenshot. I can do window-less app, icon on the Taskbar and screen cap...

QT4, paginated showing elements

I am going to write an application that uses QT4 (with C++ or python it isnt important in that moment). One of functionality is "Showing all items in database". One item has a Title, author, description and photo (constant size) And there could be very many items. Let's say 400. There won't be enough space to show'em all at once time. ...

compiling qBittorrent on Windows

I'm trying to compile qBittorrent on Windows using QtCreator/MingW. http://qbittorrent.sourceforge.net/download.php I need help with getting this to compile, but I'm fairly confused by these boost errors. createtorrent_imp.cpp: In member function `virtual void torrentCreatorThread::run()': createtorrent_imp.cpp:263: error: call of overl...

Using custom coordinates with QGraphicsScene

I am experimenting with a WYSIWYG editor that allows a user to draw shapes on a page and the Qt graphics scene support seems perfect for this. However, instead of working in pixels I want all my QGraphicsItem objects to work in tenths of a millimetre but I don't know how to achieve this. For example: // Create a scene that is the size...

QTableWidget::itemAt() returns seemingly random items

I've just started using Qt, so please bear with me. When I use QTableWidget->getItemAt(), it returns a different item from if I used currentItemChanged and clicked the same item. I believe it's necessary to use itemAt() since I need to get the first column of whatever row was clicked. Some example code is below: MainWindow::MainWindo...