qt

How do I resize QTableView so that the area is not scrolled anymore

I want the size of the QTableView to be the same as the table it contains (and fixed) so that it does not have a scrollbar ...

Calling static pointer to a list from a shared library in c++

Hi, I have a static class member class bar {...} class foo { public: static QHash<qint64,bar>* barRepHash; } Now I call a function which accesses this member within a shared library, I get a memory error whereas when I access the function through the main program, it works fine. I've tested this under a number of circu...

What is the recommended way of passing keyboad events to QProcess transparently?

I have a GUI application, which creates a QProcess inside, catches its output and shows it on a form. I need to somehow catch key events from the form to pass them to QProcess (to make it fell as close as possible to real terminal window). So, I suppose, I should process keyReleaseEvent() and somehow transform either event.text() (which...

No output from QProcess

Why does the following print a blank line instead of 'Hello QProcess'? import sys from PyQt4 import QtGui, QtCore proc = QtCore.QProcess() proc.start("echo 'Hello QProcess'") proc.waitForFinished() result = proc.readAll() print result proc.close() I'm on Windows XP, btw. ...

qt soap client + ASP.net Web service

Hi, I'm writing Qt client for ASP.NET web service with FORMS based authenitcation. The service consists of 3 methods: Login(user,pass) Helloworld() - this method returns info oabout athenticated user. Logout() Every thing working fine on the dot.net client with CookieContainer. The problem begins with HelloWorld() methods. it return...

Play RTP video stream using Qt?

I want to create a Qt widget that can play incoming RTP streams where the video is encoded as H264 and contains no audio. My basic plan for implementation is this: Create a Phonon MediaSource object (Stream type). Connect it with a QIODevice subclass that provides the data Obtain the video data using either: The JRTPLIB client librar...

No readyReadStandardOutput signal from QProcess

Why do I never get the readyReadStandardOutput signal when I run the following? import os, sys, textwrap from PyQt4 import QtGui, QtCore out_file = open("sleep_loop.py", 'w') out_file.write(textwrap.dedent(""" import time while True: print "sleeping..." time.sleep(1)""")) out_file.close() def started(): p...

How to group Widgets in my Qt app?

Easy question (I hope!). This is my first Qt app and I'm struggling with how to have groups of elements on my Gui. I need about 8 standard QWidgets (labels, edits, buttons) for each File object, which can be added or removed dynamically. So ultimately I need to put all the File objects inside a QVBoxLayout inside a QScrollArea. But fi...

QCheckBox: is it really not possible to differentiate between user-induced changes to state and those made programmatically? If so, should it be considered an inconsistency?

Do I miss something or there is really no (ready / built-in) way to programmatically change the state of a QCheckBox without emitting the "void stateChanged ( int state )" signal? The above-mentioned signal is emitted regardless of whether "void setCheckState ( Qt::CheckState state )" was called or the user changed the state via the ui,...

Qt, text on a black and white screen

I'm using Qt (embedded) to make a GUI on a black and white screen. The problem is Qt renders text with shades of grey so it is unreadable on the black and white screen. Does anyone have any idea how to make the text just use 1 bit per pixel, or purely black and white? Thanks, Mark ...

Displaying multiple icons in a single cell of a QTableView

I am writing a small gui app with QT4.5 in QtCreator. The main screen on the app contains a QTreeView with two columns, the first is text the second is a group of icons. These icons represent the last few states of the item displayed in the row. I am not sure what the best way to do this is. I have currently implemented this by gener...

Deleting And Reconstructing Singleton in C++

Hi all, I have an application which runs on a controlling hardware connected with different sensors. On loading the application, it checks the individual sensors one by one to see whether there is proper communication with the sensor according to predefined protocol or not. Now, I have implemented the code for checking the individual s...

Is there a way to prevent a header defined c++ function from being treated as inlined.

Hi, I am making a Qt application and as I was coding, I took the habit of defining my slots in the header. I found it was easier for me to develop that way though I still define normal functions in the .cpp (unless the function is really small). But now there are some worries from my colleague that putting these in the header is bad p...

Qt QString cloning Segmentation Fault

Hi, I'm building my first Qt app using Qt Creator, and everything was going fine until I started getting a strange SIGSEGV from a line apparently harmless. This is the error: Program received signal SIGSEGV, Segmentation fault. 0x0804e2fe in QBasicAtomicInt::ref (this=0x0) at /usr/lib/qt/include/QtCore/qatomic_i386.h:120 By back...

Persistent Qt Local Socket IPC

I'm developing an application that uses IPC between a local server and a client application. There is nothing particular to it, as it's structured like the Qt documentation and examples. The problem is that the client sends packets frequently and connecting/disconnecting from the server local socket (named pipe on NT) is very slow. So w...

QT: Context menu (QMenu) reference from the QTableWidget.

I want to add a submenu in my context menu which is created like this: self.widget_alignment.setContextMenuPolicy(Qt.ActionsContextMenu) where widget_alignment is QTableWidget. I created a new QMenu instance: exchange_bases_menu = QMenu(self.widget_alignment) added some actions, and I found a method QAction QMenu.addMenu (self, QM...

Removing custom widget from QVBoxLayout

I've got a QFrame with a QVBoxLayout and I'm adding my own custom widgets to the layout to simulate a QListWidget but with more information/functionality in the items. I add the widget to the layout and keep a reference in a member variable (this is Python): self.sv_widgets[purchase.id] = widget self.vl_seatView.addW...

Notifying subclass of QAbstractItemModel about changes

Hello. I've got a question about notifying a model of the changes made to some other object which it stores a reference to. I'm aware of the signal dataChanged(), but I'm not sure how to use it. For example, my model stores a reference to some other object (let's call it myObjPtr). The model queries myObjPtr for its contents only when t...

Qt tells me that my SLOT doesnt exist, but with a make clean, make it doesnt complain anymore

when i download a fresh copy from our SVN, make then run my program, Qt tells me that one of my SLOTS doesn't work but with a handy-dandy make clean then make, it seems to solve the problem. i continue to make changes in the code on my PC and that message never shows again. C++ Qt 4.6 gcc has anyone had this problem? and ideas? thanks...

QSqlTableModel.insertRecord() is very slow

Hello, I am using PyQt to insert records into a MySQL database. the code basically looks like self.table = QSqlTableModel() self.table.setTable('mytable') while True: rec = self.table.record() values = getValueDictionary() for k,v in values.items(): rec.setValue(k,QVariant(v)) self.table.insertRecord(-1,rec) The table curr...