qt4

How to efficiently select a subset of rows of a QTableView that match certain criteria?

I have a QTableView using a QSqlTableModel. In the underlying database (postgresql) table there is a timestamp column. How can I select all rows in the selection model where the underlying timestamp column is NULL? Pointers in the right direction would help. UPDATE: The main issue I have been having is performance. Each method I ha...

How to Create OpenGL 3 Context with Qt 4?

I would like to learn graphics programming with OpenGL. And since I will just start learning it I decided to learn the new/OpenGL3 way of doing things.As far as I can see one has to create an OpenGL 3 context for this (Core profile in the new OpenGL 3.2 if I understand this correctly). Well I thought about using Qt for this, currently us...

Qt4 Stylesheet Pseudo-states

Hello, I'm attempting to change the style of a button using the :checked and :unchecked pseudo-states, but have not been successful. I have tried a variety of different combinations to no avail. #btnOnOff:checked { ... } #btnOnOff:unchecked { ... } #btnOnOff.QPushButton:unchecked { ... } None of these seem to be working. ...

Is there a workaround for Qt 4.4 visual artefacts on Mac OS X 10.6 (snow leopard)

My software is written in Qt 4.4.2 using XCode on Mac OS X 10.5. It runs fine on Mac OS X 10.5. But when it is run on Mac OS X 10.6 it shows some strange visual artefacts when drawing the drop-down menus of QComboBoxes. Apparently it affects every QComboBox. 4 people with Mac OS X 10.6 who have tried it have reported the same behaviour,...

Wrong Mac OS X framework gets loaded

I've compiled a Python module using my own Qt4 library located in ~/opt/qt-4.6.0/, but when I try to import that module, the dynamic libraries that get loaded are from my MacPorts Qt4 installation. $ /opt/local/bin/python2.6 >>> import vtk objc[58041]: Class QMacSoundDelegate is implemented in both /Users/luis/opt/qt-4.6.0/lib/QtGui.fr...

How to hide handles in QSplitter widget?

Is it possible to completely hide handles from QSplitter widget? I've tried to hide() them but it doesn't work — handles are still on the screen and isVisible() reporting false. QSplitter::setHandleWidth doesn't work as expected — it doesn't hide handles when calling it with 0. ...

Handling gui with different threads

I'm new in qt and c++, and I have a problem with threads. For example, if I have a gui with two QPushButton and one QTextEdit, is it possible to set values to the QTextEdit from a thread (different from the gui main thread) without freezing the gui? // These are the values that I want to set from the thread for(i=0;i<100;i++){ ...

Qt4 DNS Proxy QUdpSocket

Hello, I'm essentially trying to make a DNS proxy application using Qt4. If I set my DNS nameserver to 'localhost' then I want to forward all DNS requests to the server specified in the remoteSocket object. Everything seems to be working fine except sending the data from the remoteSocket object back to the localSocket object which is ...

Slot seemingly not recognized in Qt app

Hello, I have been working on learning C++ and Qt4 recently, but I have hit a stumbling block. I have the following class and implementation: class Window : public QWidget { public: Window(); public slots: void run(); private: //... }; and Window::Window() { //... connect(runBtn,SIGNAL(clicked()),this,SLOT(run...

Qt4 DNS Server using QUdpSocket

I am writing a DNS server for an application I'm working on and I'm running into some difficulties. I want to bind to port 53 on localhost and listen for DNS lookup requests, then send back the response. Unfortunately, when I call QUdpSocket::bind() the resulting socket is not writeable. Is there a flag I need to pass to make it so I ...

QT 4.5 - QGraphicsItem is assigned to parent scene of 0x0

This is a rather strange situation here. I have a class which derived from QGraphicsScene class DrawingScene : public QGraphicsScene { ... } Whenever I add any item within the derived class, the item ended up attaching to a parent of 0x0. The thing is that despite that, the graphics item appearing within the scene as normal, and ca...

How signal and slots are implemented under the hood ?

Hello This question is already asked in this forum but I don't understand the concept. I was reading around and it seems that signal and slots are implemented using function pointers i.e the signal is one big function which inside it calls all connected slots (function pointers). Is this correct? And what is the role of the generated m...

Help with Python/Qt4 and QTableWidget column click

Hi folks, I'm trying to learn PyQt4 and GUI design with QtDesigner. I've got my basic GUI designed, and I now want to capture when the user clicks on a column header. My thought is that I need to override QTableWidget, but I don't know how to attach to the signal. Here's my class so far: class MyTableWidget(QtGui.QTableWidget): ...

How to display a Dialog on window created using XCreateWindow in QT 4.5.2

I am doing work on project. In which I have developed a full size screen displaying images using XCreateWindow. Now I want to display a dialog on this screen. I have created a QDialog it does'nt show on the full size screen but it is displayed on screen when it is not full size. Any Help. My code for creating screen and dialogbox is as f...

Qt4: How to call JavaScript functions in a page from C++ via QtWebkit?

Greetings everyone, I'm trying to write a simple log viewer using Qt4's WebKit port/implementation. My HTML code looks like this: http://pastie.org/613296 More specifically, I'm trying to find out how to call the add_message() function which is defined in the <script> section in the HTML document from my C++ code. // Doesn't work...

Device Independent rendering using QT 4.5

I am developing application using QGraphicsView/Scene architecture. I am drawing rectangles & lines. I want drawing to be device independent. Screen resolution changes should not affect my application drawing. Please give me information about how to do device independent drawing using QT ? ...

Basic doubt in QT using C++ about making objects...

int main (int argc, char* argv[]) { QApplication app(argc, argv); QTextStream cout(stdout, QIODevice::WriteOnly); // Declarations of variables int answer = 0; do { // local variables to the loop: int factArg = 0; int fact(1); factArg = QInputDialog::getInteger(0, "Factorial C...

How to hide "Cancel" button in QInputDialog in QT using C++?

#include<QtGui> int main (int argc, char* argv[]) { QApplication app(argc, argv); QTextStream cout(stdout, QIODevice::WriteOnly); // Declarations of variables int answer = 0; do { // local variables to the loop: int factArg = 0; int fact(1); factArg = QInputDialog::getInteger(0, "Factorial Calculator"...

Simple Qt Application won't compile on OS X

I've downloaded the Qt SDK and am trying to get started on my first Qt application using Qt Creator. Using the wizard from the opening splash screen I selected "Qt4 Gui Application" and it threw together a little project for me. When I try to build that project (without making any changes) I get build errors: Running build steps for ...

which linux to use for embedded-linux-qt 4 development ?

Hi Friends, I want to start development using qt-embedded on my embedded device project. Can you tell me which linux should I use on my computer for development. Well, It should have VMWARE-tools support ( Fedora Core 11 does not have it ). Thanks, Sunny. ...