qt4

Show Editors for All Cells in Row in QTableView

Hello, I would like to display editors for all cells in a row when a user begins editing any cell in a QTableView. I have made several attempts but I cannot obtain the correct behaviour. The only way to open multiple editors is by QAbstractItemView::openPersistentEditor() - attempts to successively call QAbstractItemView::edit() resul...

Distinguish between designer and runtime code

I have two processes which exange messages each other. Process A is a normal (i.e non-qt) program which sends messages to process B. Process B is a QT GUI application showing received messages into a text box. I created a customized widget (called ShowMessages) which inherits from QPlainTextEdit and reads messages from a pipe when a tim...

Simple inter-proccess communication in Qt4

I need to make so that my application can have only one instance running at a time. Also when it's launched with a command line parameter ( like when registered to open certain file types ) it should pass the parameter to an existing instance and quit immediately without displaying graphical interface. You all probably know what I mean. ...

Qt4 existing slots are not recognized.

Hi I am currently trying to complete a project using Qt4 and C++. I am using buttons to switch between states. While trying to connect the buttons' clicked() signals to the textEdit to display the relevant state, I got stuck on an error: Object::connect No such slot QTextEdit::append("move state") Object::connect No such slot ...

How to scroll automaticaly within a Tkinter message window

Hello together, I wrote the following class for producing "monitoring" output within an extra window. Unfortunately it doesn't scroll automatically down to the most recent line. What is wrong? As I also have problems with Tkinter and ipython: how would an equivalent implementation with qt4 look like? Here is the code: import Tkinte...

In qt, how do I implement a widget that stays consistent with variables in the code.

Here's a sample of a SpinBox that writes its changes to underlying variables. The main problem that I'm having is valueChanged is called when the widget is constructed. Is there a more elegant way to do this? I think it's weird that I connected a widget to itself, but valueChanged isn't virtual. class ValueWriterInt: public QSpinBox ...

Mystery: In Qt, why would editorEvent be called, but not createEditor?

I'm subclassing QAbstractItemDelegate. This is my code. Suggestions are welcome: QWidget *ParmDelegate::createWidget(Parm *p, const QModelIndex &index) const { QWidget *w; if (index.column() == 0) { w = new QLabel(p->getName().c_str()); } else { if (p->isSection()) return NULL; w = p->createControl(); ...

Is there a way to list current processes using Qt on windows ?

Is it possible to know which processes are running using Qt 4? I'm looking for a way to wait until an application is closed by the user to make an operation. ...

non-breaking space not being displayed correctly in QTextEdit

QTextEdit t; t.setHtml(" "); displays a small 'a' with acute accent instead of a non-breaking space. This happens only on Windows not Linux or FreeBSD. What might be causing this? A bug in Windows/Qt? How can I fix this? (Qt 4.5 on Windows Vista x64 pro. My locale is the default 'C'.) Update: I have a feeling that this is bug in ...

How do i cause a qtabwidget instance to automatically resize when child tabs are added to it?

I am trying to get the QTabWidget automatically resized to fit the child tab when the child is added but have been unable to do so. I have created a form using Qt Designer and have inherited this using the single inheritance approach as follows. class MyWidget : public QWidget { Q_OBJECT public: MyWidget(QWidget *parent = 0); p...

In Qt, how do you properly implement delegates?

I followed the model/view/controller paradigm. I am pretty sure that the model and view are right, but I think I'm doing some things wrong in my delegate. Everything "works", except the first click to a control just "lights up the control" and the second one interacts with it. Is this how delegates are usually implemented? My impleme...

Best way to store data in C++

I'm just learning C++, just started to mess around with QT, and I am sitting here wondering how most applications save data? Is there an industry standard? Do they store it in a XML file, text file, SQLite? What about sensitive data that say accounting software would need to save? I'm just interested in learning what the best practic...

Command line parser for Qt4

I am looking for a command line parser for Qt4. I did a small google search, and found this: http://www.froglogic.com/pg?id=PublicationsFreeware&category=getopt however it lacks support for "--enable-foo" and "--disable-foo" switches. Besides that, it looks like a real winner. EDIT: It seems Frologic removed this. So the best opt...

How to create a vcproj with qmake such that its filters reflect the directory structure?

Hi, I use qmake (Qt 4.5.1) to create my vcproj files. I would like to create customized filters for the output vcproj, such that not every *.h file ends up in the "Header Files" filter, *.cpp in "Source Files" etc. For example, a project containing the files foo\foo.h foo\foo.cpp bar\bar.h bar\bar.cpp should have a vcproj file with ...

How could I use the QColorDialog inside another widget not as a separate dialog?

I would like to use QColorDialog not as a dialog window but as a widget which I could insert into a layout. (More specifically as a custom sub menu in a context menu) I looked into the QColorDialog sourcecode, and I could probably copy over a part of the internal implementation of the QColorDialog to achieve this, but is there a cleaner...

Qt & double buffering - are there any neat tricks to capture pixels or manipulate the back buffer?

I'm migrating an application to Qt from MFC. The MFC app would use GDI calls to construct the window (a graph plot, basically). It would draw to a memory bitmap back buffer, and then BitBlt that to the screen. Qt, however, already does double buffering. When the user clicks and drags in the graph, I'd like that section of the window ...

<programname>.exe exited with code -1073741819, What is the solution?

Hi, I am trying to integrate Qt with OpenCV. Here is the example: http www opendesktop org/content/show.php/Qt+Opencv+webcam+viewer?content=89995 But in the function: putImage(IplImage* cvimage) It is giving exit error code: 1073741819, wherever following..: cvimage->depth .. is being used. I have solved this problem long ago ...

QGraphicsItem : emulating an item origin which is not the top left corner

My application is using Qt. I have a class which is inheriting QGraphicsPixmapItem. When applying transformations on these items (for instance, rotations), the origin of the item (or the pivot point) is always the top left corner. I'd like to change this origin, so that, for instance, when setting the position of the item, this would ...

After setting a breakpoint in Qt, gdb says: "Error accessing memory address"

I wrote a very simple Qt program here: int main(int argc, char* argv[]) { QApplication app(argc, argv); QTableView table(&frame); table.resize(100, 100); table.show(); return app.exec(); } And when I try to set a breakpoint where the table gets clicked, I get this error from gdb: (gdb) symbol-file /usr/lib/libQt...

How to compile Qt 4.5.1 on Windows XP for WinCE?

I'm trying to compile Qt 4.5.1 on Windows XP targeting wince50. I have the prerequisites installed (VS2008, WinCE50SDK, ActivePerl 5.10) and have downloaded the qt-embedded-wince-opensource-src-4.5.1.zip which has been installed in c:\Qt\4.5.1 and c:\Qt\4.5.1\bin has been added to the path. From a VS command prompt, I navigate to c:\Qt...