qt

Qt model's tree view and table view

I have a list of Product objects ( as rows ), each object has several data fields ( like product id, product family, etc ) - as columns. I managed to create a table model subclassing QAbstractTableModel, and display the datas in a QTableView. What i want is provide a "grouped" view of the model in a tree-like structure. For example I wa...

Qt -- pass events to multiple objects?

I basically have 3 layers (Window > Scene > View) that each need to handle a mouseMove event without blocking the others. It seems only the youngest child is getting the event though. I was hoping I could process the event and then call event->ignore() to pass the event back up the stack, but it doesn't seem to be working. Some relevant...

Get visible rectangle of QGraphicsView?

I've been pulling my hair out with this one for hours. There's a thread here about it, but nothing seems to be working. QGraphicsView::rect() will return the width and height, but the left and top values aren't set properly (always 0 -- ignoring the scrolled amount). I want it in scene coordinates, but it should be easy enough to transla...

Qt LGPL license exception?

I'm using the Qt/Mfc Migration Framework to begin to convert some UI code from MFC to Qt. I'm wondering whether I absolutely have to keep the Qt migration code in a seperate library or if it would be possible to include it in my project. In order to do that, I would have to modify it slightly (add #include "stdafx.h" for example and chan...

Qt jpg image display

I want to display .jpg image in an Qt UI. I checked it online and found http://doc.trolltech.com/4.2/widgets-imageviewer.html. I thought Graphics View will do the same, and also it has codec to display video. How to display images using Graphics View? I went through the libraries, but because I am a totally newbie in Qt, I can't find a c...

Set a custom icon for a QAction when disabled

Is it possible to have a custom icon displayed for a QAction when it is disabled? E.g. display icon A when the tool is enabled and icon B when the tool is disabled. ...

Checking available room in QT Dock

I'm using QT4 and I have a menu option that programatically adds a new dock widget into a dock area. Unfortunately, if the dock area is already full, adding a new dock widget will cause it to resize the dock widgets below their minimum size, leading to overlapping widgets and worse. How can I verify there is enough space in a dock area...

Single file Qt4 demo

Sometimes you need to create a very simple single file application in Qt4. However it's problematic since you are always doing the CPP/H separation, and then the main() is in another file... Any ideas how to do this in a single file? As quick as dirty as possible. ...

How to make one widget from multiple widgets in designer

Hello I have multiple edit boxes and buttons on my dialog form in qt designer. I want to make one widget from my edit boxes, something like this : <widget class="QWidget" native="1" name="widget_2" > <item> <widget class="QLineEdit" name="lineEdit_2" > </item> <item> <widget class="QLineEdit" name="lineEdit_3" > </item> </widget> ...

Problem synchronizing QThreads

Apart from main thread, I've ThinkerThread object _thinker whose finished() signal is connected to main thread's slot: connect(&_thinker, SIGNAL(finished()), this, SLOT(autoMove())); The slot autoMove() causes _thinker to initialize and run again: _thinker.setState(/* set internal variables to run properly */); _thinker.start(); Th...

Bind QTcpSocket on dual-homed host

I have an application that is being built using Qt. It will be running on machines that will have two (or more) network cards. I need the ability for my application to select which ethernet interfaces for a TCP connection. Before anyone suggests it I cannot guarenteed that routing tables will be setup correctly. I know how to do this...

What to learn first - C++/STL/QT or .NET/C# - if I have limited time while learning and working?

I am currently a CS student at a 4th year(of total 5). I`m studying and working. At work I use ASP.NET. So, while working and studying, I have not so much time to learn new languages and techniques. What do you suggest to learn first - C++/STL/QT or C#/LINQ/WPF? I mean, C++ and its libraries are stable and do not change as fast as .NET t...

Qt 4.5 third-party installer programs

Are there any good setup builders for Qt 4.5 projects on Windows? I have heard there is an installer that you just point at your Qt Creator project, and it figures out the dependancies and creates an .MSI setup file. I haven't located anything like that so far. What are others using? ...

QComboBox textchange event capture problme

I am developing a QT application on redhat linux, I want to capture Carriage Return press event on QComboBox, I have written Signal for editTextChanged(), it is fired for every key press but not for Enter Key.. Why it is so? If there is any other way to capture carriage return..?? ...

Is Qt classified as a c++ library? If not a library, how would you classify QT?

I recently started looking into Qt (I installed Qt 4.5.2 and installed their Eclipse-CDT plugin called "qt integration v1.5.2" and I will do all my development in Linux-Eclipse-CDT-QTintegration). Originally I thought Qt was a straight vanilla C++ library but when I installed and started running Qt example code I saw lots of "weird" thi...

QT question: What is the purpose of the *.pro file?

I just started using QT and noticed that in each example code folder there is a *.pro file (and there is also a makefile created too... why?). What is the purpose of the *.pro file? ...

Why does Qt use it's own make tool, qmake?

I just started using Qt and noticed that it uses it's own make tool, qmake. Why does Qt use its own make tool? Is there something special that prevents it from using a standard make tool? Does qmake call the GCC C++ compiler? ...

Qt question: Can you use the standard GDB debugger with Qt executables?

I just started using Qt and I wanted to debug my Qt application. Can I use the standard GDB debugger with Qt executables? ...

QT question: What does the Q_OBJECT macro do? Why do all QT objects need this macro?

I just started using QT and noticed that all the example class definitions have the macro Q_OBJECT as the first line. What is the purpose of this preprocessor macro? ...

Qt question: How do signals and slots work?

How do signals and slots work at a high level abstraction? How are signals and slots implemented at a high level abstraction? ...