qt

how to create & call slot in other class than MainWindow?

Currently Im using QT Creator which created UI file for view and I'm a QT starter. There is a part I am curious is that how can i create another Class for, let say a GraphicView, so that I can send signal and slot to that class instead of the main form? Side Question: why I can't edit Singal and Slot in other place than MainWindow in E...

Binding Qt to LLVM

What is the best way to create a Qt binding to a language that sits on top of LLVM? Try to parse the Qt header files and generate an interface to C from that, call the C interface from LLVM? Or maybe try to get SWIG to interface Qt? Or is there a better way? ...

How to Customize ListView in QT

HI.. i am new to QT,i want to know how to customize the listview in QT i.e i want to add multiple icon in single row.. etc.. i tried lot i am not getting how to do that.. i tried with Qlistwidget, in tat i can only insert single row with one image.. i am not able to place multiple icon with desired locations.. please assist me, which...

Looking for QT styling with borderless window Tutorial or how to

Hello all im new to qt c++ i downloaded the latest windows version dome some tutorials and its great i saw some styling options that the qt framework has and its great , but now i need to build my application that its main windows (form) it designed/skinned with image without the rectangle borders (borderless ? ) . how can i do it wit...

Auto close QMessageBox

I'm building a Qt Symbian Project and I want to show a notification for the user that should auto close after some seconds. I have seen that Nokia uses this a lot in their ui. Right now I'm using the code below so that the user can close the QMessageBox but I would like it if it was possible to auto close the QMessageBox after 1 or 2 s...

How can I implement Google Maps-like tile scrolling in Qt?

I'm using Qt/C++ and trying to draw a large and complex QGraphicsScene. Once I add a lot of objects, panning and zooming become unpleasantly slow. (No surprise here, of course). I've played with device coordinate caching (helps with panning to a point) and minimal viewport updates and so on, but eventually there's just too many object...

Does Qt provide a class that represents an IP address?

I thought QHostAddress was it, but it strangely does not provide methods for validating whether or not the IP address is valid (anymore, got deprecated to Qt3). Does anyone know? ...

in Qt, How do I make a window be the current window?

My QT app has multiple windows and sometimes, even though the windows are already open but burried under other windows, the user will select an option to open one from the mainwindow menubar in which case I want to simply bring it up and make it the current one. Now using QWidget->raise makes this window go on top of all other windows b...

Embedded JPG resources not loading in Qt application

I have a Qt application that has some embedded JPG files that I want to display. When I compile and run both the debug and release versions on my machine, everything works perfectly. When I copy the application to a thumb drive and run it from there on my machine, it works fine. On the thumb drive and another developer's machine: OK. ...

Checking if a folder exists (and creating folders) in Qt, C++

Quick question: In Qt (C++), how do I check if a given folder exists in the current directory? If it doesn't exist, how do I then create an empty folder? I couldn't seem to find any references online for it (or in qt's help) Thanks. ...

Qt 4.6 - How to drag and drop into a QGraphicsView in QtCreator?

Hello, I've been trying to figure out how to drag and drop an image into a QGraphicsView using Qt and the QtCreator IDE. I have read the documentation here: http://doc.trolltech.com/4.6/qgraphicsscene.html#dragEnterEvent This documentation is too general for me to understand. Can anyone give me an example that works? I also found a ...

How to get the paint event for Buttons in QT

Hi.. i am new to QT, i tried lot searching samples of how to get the button paint event in QT.. i am not getting the way to do it.. how to set the delegates for pushbutton in QT?. how to get the paint event for pushbutton? i read so many articles, it says we can get the paint event of button we can customize too. but i didnt get the ...

Qt, Python and Memory Management

Hello , Thanking everybody before starting. I have a serious issue with a GUI implemented in Qt,say,QGui. Through Python APIs,say,qpread etc. I accesses the hardware resources. What i does is through Python script I calls these APIs according to my requirement. This QGui mostly crashes while running the script whether it is for long...

What does the following function do?

I am looking for Qt's implemention of the function QObject::qt_metacall(_c, _id, _a); this is where a given function name is converted into index. But I am not able to find the function implementation anywhere in their source code. int ssObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _...

Qt - QScrollArea widget clipping contents

I'm trying to add scrolling to a drag and drop example source that I modified. The example simply draws several draggable QLabel widgets. I was modifying it in a way that a larger number of various different length widgets would be created. I made a class that would be called by main and would contain the scrolling widget, that in turn ...

Qt: Defining a custom event type

I have created a custom event in my Qt application by subclassing QEvent. class MyEvent : public QEvent { public: MyEvent() : QEvent((QEvent::Type)2000)) {} ~MyEvent(){} } In order to check for this event, I use the following code in an event() method: if (event->type() == (QEvent::Type)2000) { ... } I would like to b...

QWebElement manipulation of a QWebPage in a separate thread

Hi, I have a QWebPage created in the main thread (you can't create it anywhere else). I would like to manipulate this page using the QWebElement API introduced in Qt 4.6, but in a separate thread. So that thread would acquire a reference to the page and perform the necessary tree walking and attribute changes I need. As the Threads and...

Binding a QT model to an existing data-structure

I've a tree-like polymorphic data-structure, where the nodes are instances of class Node (implemented by me) or any its subclass. My application heavily uses Boost and the nodes are actually represented by boost::shared_ptr type rather than Node*. Now, I want to create a QT model to wrap my tree data-structure. Therefore I need a way to...

Qt build that can link statically out of the box?

I have used Qt to build a small application. It turns out that I need to reconfigure and Qt from scratch in order to be able to link statically. I've done it before, and I remember that it was a very long process. So does anyone know a Qt SDK installer that provides the ability for static linking out of the box? ...

Qt::How to lower the text in a qspinbox

I'm using a spinbox with a custom font which looks too high in the spinbox. How do I move the text lower? I have already reimplemented Qstyle and made the font lower in another widget but I can't find where to do it with the spinbox, there must be a qrect somewhere where you can just move the top of it but I don't know and can't seem to ...