qt4

QGraphicsView/Scene - multithreading nightmare

Am I correct in thinking that the QGraphics* classes are not thread-safe? I am porting an old app to Qt and in the process attempting to make it multi-threaded too. I looked at the update code and I see no locks whatsoever. I started off right, all my processing is done in a set of worker threads so that the GUI does not have to block. ...

Set a QComboBox or QSpinBox to a value not allowed

I am maintaining an application which tries to help the user get his parameters to work together, as there are many interdependencies. Now there is a default value of x for a variable Y. When the user changes some other variable Z, there might be a new minimum value for Y which is greater than x. This is set as a minimum for the spinbo...

qprocess output in file

QProcess procWriteProject .. ... 1) procWriteProject.start("qconf",QStringList() << " -sprj " << projectList[0] << " >> " << "\"/tmp/testing.txt\""); 2) procWriteProject.start("qconf -sprj " + projectList[0] + " >> " + "/tmp/test_settings"); what is the possible way to make this command work. I need that after this command is execute...

Building optimized Qt4 - "./configure" flags and their meanings

Hey everyone, I recently followed a discussion on the Qt4-interest mailing list about whether it is legal or not to build a commercial/proprietary application and statically link Qt4 into it. While there are some non-proven ways of doing so (by providing object files and a Makefile, etc. to the customer), it doesn't sound like such a go...

Hidden features of Qt.

A little is hidden in Qt given splendid documentation. But given vastness of Qt functionality paradoxically many useful features have been overlooked by me (and reimplemented or work-arounded). What Qt functions you wish you have noticed earlier? ...

Qt - what is required for a QTDIR to be considered valid by build tools?

A client of mine has built Qt against VS2005. They are now wanting to put this into source control, but they don't want anything they don't need. What's the proper way to remove temporary stuff like the "tmp" directories, without deleting output libs/DLLs or invalidating the tree for use as a QTDIR target? If there's no prebuilt way t...

PyQt subclassing

The usual way to use Qt widgets from Python seems to be to subclass them. Qt widget classes have a great many methods, so inevitably I'm going to end up adding a method to the subclass, with the same name as one inherited from the Qt widget. In Python, all methods are virtual, so what I'm concerned about is that some Qt code might end u...

QCheckbox/QRadio line wrap Qt4.6.0

Hi, I'm trying to have a multi-line checkbox/radio with Qt using standard QCheckbox/QRadio. I didn't find the direct solution since QRadio{wrap:true;} has no effect. The only thing possible would be to access to the QRadio->label->setLineWrap(true) but I'd like to do that from the designer not having to rewrite a widget Any id...

Qt for Symbian - odd network sockets behavior

I grabbed the 4.6.0 release, and immediately tried writing a little test app for it. This application simply shows an edit box for a host address, and a checkbox if it's to use an encrypted connection or not. There are also simple 'Connect' and 'Disconnect' buttons. It tries to download and show an image in a QListWidget, showing debu...

Remove a sublayout in qt?

In PyQt 4.5, I have a layout inside another layout. I'd like to remove the sublayout from its parent, and hide it. I can say parent_layout.removeItem(child_layout) to remove the layout from its parent, but it still shows on the widget. I can't find any way to hide it in one step, as QLayout doesn't have a hide() method like QWidget do...

Is QImage able to open and render pure 16-bit images?

I think the headline already explains what I want to know. Is there a possible way to open and save images with 16-bit with Qt? And I don't mean the 3*8=24bit or 4*8=32bit, what is quite the same as a pure 8-bit image, I mean pure 16-bit for R, G and B. ...

How do I use QTextBlock?

Hi all, I'm completely new to c++ and Qt. I want to populate a QTextEdit object with QTextBlocks, how do I do that? e.g. If I have the sentence "the fish are coming" how would I put each word into its own QTextBlock and add that block to QTextEdit, or have I misunderstood how QTextBlock actually works? ...

Linker error 'unresolved external symbol' : working with templates

I have a template based class [Allotter.h & Allotter.cpp]: template <typename allotType> class Allotter { public: Allotter(); quint32 getAllotment(allotType*); bool removeAllotment(quint32, int auto_destruct = 0); private: QVector<QPair<quint32, allotType*>> indexReg; int init_topIndex; }; and it's usage is shown as [ActiveListe...

QtRuby: loading HTML file into QTextEdit

How do I load a custom HTML-file into QTextEdit while in runtime? ...

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,...

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...

Qt4 compatible RegExp for URL highlighting

I'd like to automatically highlight and extract URLs from a QWebView or QTextEdit. I've found a lot of RegEx examples on the web which allows to do just that, but most of them seem overly complicated, don't work properly or are not compatible with Qt4's RegExp implementation. So I'm asking here for a Qt4-specific RegExp pattern which al...

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...

QPlainTextEdit for single line of input

I'm using Qt to write a database type program where the majority of inputs will be single lines, not documents of arbitrary length. Do I understand correctly that QPlainTextEdit is the most appropriate widget for this kind of input? If so, how do you set parameters for this kind of input? In particular: Height to the right value to co...

GUI for touchscreen panel

Hi Geeks, I am planning to design an embedded device which will have atom processor platform and linux OS in it. It will have an 7" touchscreen panel. In stead of going for KDE and GNOME desktops I want to design my small desktop environment for the device. Can anyone please suggest which GUI tool I should use to design a desktop from s...