qt

Qt: QSettings on Windows with INI files and comments

I have an application I'm writing using Qt 4.5.2 on Windows. I'm storing some settings in an INI file and using QSettings to load and save the settings. I'd like to have some comments in the INI file. For example: ; Meta-info to store with the file [General] MainWindow\size=@Size(1280 600) MainWindow\pos=@Point(0 300) Debugging=true ...

QT drawing without erasing widget

Hello, If I have a derived object of QWidget class and on slot function in it I have an update(). here is some pseudocode: *.h slot: updateNow(); *.cpp constructor() { setPalllete(QPallete(QColor(250,250,200))); setAUtoFillBackground(true); } updateNow() { update(); } paintEvent() { QPainter painter(this); painter.d...

Thread pool in Qt 4.3

Is there some way to use thread pool with Qt 4.3? I know it has now been implemented in Qt 4.5. But is it somehow available in Qt 4.3 also? ...

Convert video file to TIFF with ffmpeg.dll or avcodec.dll? Is "on-the-fly" possible?

I want to create a program, which gets a video-file from Qt, converts that video file to TIFF-files and sends them to an algorithm which handles these TIFF-Files. My questions: is it possible with ffmpeg or avcodec not to convert a video-file to TIFF-files first on harddrive and send them to the algorithm after that, but to convert f...

Qt portable IPC: only QSharedMemory?

Hi, I'm looking for suggestions about choosing a portable way to achieve local IPC in a robust way, since i'm new to C++ and would like to avoid common pitfalls of fiddling with shared memory and locks; therefore I was thinking about message-passing style ipc. I was planning to use qt for other reasons anyway, thus i took a peek to Qt ...

QObject::findChild returns wrong address when used with a custom widget plugin

When I call QObject::findChildren(), the address I receive is not the right address but it points to an exact copy of what im looking for. This error happens for the only case where im trying to find a custom widget plugin I have created. Whats up with that...do i need to add something to the plugin project? ...

Getting the bounding box of a constant size item in Qt graphics views

I need to get the bounding box (in scene space) of QGraphicsItems that have the QGraphicsItem::ItemIgnoresTransformations flag set. According to the docs, you need to use QGraphicsItem::deviceTransform() to do that. I tried this: // Get the viewport => scene transform vp_trans = view.viewportTransform(); // Get the item => viewport tra...

Supporting multi-add/delete (and undo/redo) with a QAbstractItemModel (C++)

Greetings, I've been writing some nasty code to support the undo/redo of deletion of an arbitrary set of objects from my model. I feel like I'm going about this correctly, as all the other mutators (adding/copy-pasting) are subsets of this functionality. The code is nastier than it needs to me, mostly because the only way to mutate the...

Any UML-like modeling tool for QT signals and slots?

Hello. Is it any uml-like modeling tool available that can design (draw) classes and can visually represent QT signals and slots, they connections? ...

Can a class inherited from Qthread behave as a normal class?

Hello All, Can a class inherited from QThread and having run method can have other methods and can it be used like another normal ( not inherited from QThread) class? ...

[Qt/Opengl] Accelerate 2d Drawing

I'm triying to make a 2D real-time plot. I've tried with modifying the osciloscope example of qwt, tried to use QGraphicsView, and QPainter to reach high framerate drawing. I'm using 8 channels to plot data wich is arriving from a rs232 port. I take a sample every 10 ms. Maybe i've used the QPainter in a wrong way, but i couldn't draw ve...

How to handle different situations in mouse event handler properly?

In my Qt application in the event handler for mouse press events I have such ugly code void Render::Viewer::mousePressEvent(QMouseEvent* e) { switch (e->button()) { case Qt::LeftButton: switch (mode_) { case Render::Viewer::ModeView: switch (e->modifiers()) { case Qt::NoModifier: ... b...

How to decode "application/x-qabstractitemmodeldatalist" in Qt for drag and drop?

I've created a child class of QTreeWidget that I want to be able to drag items from another tree widget too (I want to handle the insertion myself though), as well as from a QListWidget. I've overridden the dropEvent method in my class, and it looks like the mimetype of the data I'm getting from my QTreeWidget is application/x-qabstract...

Qt Increase QTabWidget's QTabBar size

I need to make the tabs that I have oriented at the bottom of my QTabWidget larger. We'll be using a touch-screen, so the default sizes are a little too small. I see no easy way to do this (currently seeing no good way to even do it at all. The only methods pertaining to the QTabBar that I see in QTabWidget are protected, and I don't se...

Does Qt have a C interface?

I've found conflicting answers on the web - some say it does, some say it doesn't. I was unable to find any details in the official Qt documentation either. So does Qt have C bindings or not? ...

Qt widget update later but when?

I'd like to know what happens exactly when I call a QWidget's update() method. Here is the documentation: http://doc.trolltech.com/4.5/qwidget.html#update This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop. This permits Qt to optimize fo...

Link errors on Snow Leopard

I creating a small desktop application using Qt and Poco on Mac OS X Snow Leopard. Qt works fine, but once I started linking with Poco I get the following warning: ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libPocoFoundation.8.dylib, file is not of required architecture Also when I link against the 10.5 SDK: ld: wa...

Drag & drop with .ui files

Hi, I'm having big troubles with drag & drop. I've created a new Qt Designer Form Class in which I have one QListWidget and one QWidget. Now I want to enable dragging & dropping between these two widgets. The problem is, where can I add dragEnterEven(...), dragMoveEvent(...) etc. functions? I only have these class.h, class.cpp and clas...

Getting only one dimension of indexes from the getSelectedIndexes function in QT?

I'm working on a small project in QT (well, pyQT4 actually, but it shouldn't matter too much) and I've run into the following problem. I have a QTableView with several rows and columns. I have set the selection mode to be rows only. When I call getSelectedIndexes() on my QTableView, I get an index for every row and column, which in the c...

Is there a way to have all radion buttons be unchecked

I have a QGroupBox with a couple of QRadioButtons inside of it and in certain cases I want all radio buttons to be unchecked. Seems that this is not possible when a selection has been made. Do you know of a way I could do this or should I add a hidden radiobutton and check that onen to get the desired result. ...