qt

Subclass of QGraphicsLayoutItem for stretchers?

The specializations of QGraphicsLayout (e.g. QGraphicsLinearLayout) include an insertStretch method. What kind of object do QGraphicsLinearLayout::insertStretch method insert in the list of items managed by the layout? Better asked: what type of object is returned by QGraphicsLayout::itemAt method when called for a stretch position? ...

Is it possible to have a QWidget as a child to a QObject?

Hi, My main application object is a QObject, that juggles a QSystemTrayIcon, a QDialog, a QWindow and a few other components. The app mostly sits in the tray, with some options dialogs etc etc. Now, I'd like to use QMetaObject::connectSlotsByName() to connect signals from these objects to slots in the main object. It's 10-15 of them, s...

Add QObject in the combo box of Qt

I have a custom class I created, say MyClass. Now how to add a reference to MyClass's reference as second parameter in the combo box below: this->ui->comboBox->addItem("item-1", ); Purpose is to when item changed even is fired, i want to get that specific class instance of MyClass and process accordingly. ...

Why can't I do SHOW PROCESSLIST with QtSql (PyQT)?

I am a Python and QT newbie. I am trying to do a little app with PyQT4 in order to supervise a home MySQL server of mine, so my first idea was to do the classic SHOW PROCESSLIST, parse it, and show in a pretty UI. Nothing big, really. But for some reason, the QtSql module doesn't return anything when doing this query, although it works ...

QGraphicsItem unselect redraw problem

Very simple Qt GUI application: On the scene I have multiple circles implemented as QGraphicsItem boundingRect returns square around this circle. Method 'shape' is not overridden. The problem appears when in paint() method I've added: if (isSelected()) { painter->drawRect(re); } Selection is drawn well, but unselection doesn'...

How can I insert a widget into a mainwindow generated by Qt designer?

I have a Main window build with Qt Designer and I also have a widget built with Qt designer (both in a separate ui file). How can I instantiate my widget into my mainwindow at runtime? ...

Embedded scripting engine for DSL

I'm working on a project which needs an embedded DSL to fullfill its expected requirements. The DSL would be user defined event based. Here goes a mockup of the desired syntax: user-defined-event-1 { // event body } user-defined-event-2 { // event body } Probably, most similar language I know based on events is LSL (from Sec...

n-values UUID generator, reusable IDs

I need a simple UUID generator. The ID is required to be unique for this single instance. Another requirement is, that it has n hashes coexisting at a time, and being releasable. I don't know wether this fits the UUID concept or not. I allrdy thought about a Stack with n-values using pop and push, but this practice seems bad memory wise....

cannot get makefile to work with Qt library

I have 3 files in my program: App_interface.h, App_interface.cpp, main.cpp. Im trying to compile my program which requires the Qt library. I just installed the Qt library in the default location. This is my makefile: if your wondering why i don't use moc in this makefile is because 1) i dont know how to do that. 2) i just want to stop g...

load libavcodec in Qt-Projekt

Hi. I want to include the libavcodec in my Qt-project. Should I do that with #include <ffmpeg/libavcodec.h> or with something more Qt, for example QLibrary mylib("libavcodec"); And also a question to understand if I really got it: To use libavcodec, do I need to import the source-files or the .dll? ...

Carbon, LSUIElement, and showing a window

I have a Carbon LSUIElement application, which runs in the background (possibly with an icon in the menubar, depending on a pref) and occasionally needs to show a dialog to the user - sometimes in response to a user event, but sometimes in response to a background task failing or similar. (I'm using Qt 4.5, so the application is Carbon ...

QtCreator and Command Line Arguments

Hi, Is there a way to send command line arguments to a program being debugged in QtCreator? ...

Is anyone using valgrind and Qt ?

I am trying to debug a large application build using Qt/C++ and valgrind is reporting a lot of memory leak from internal Qt stuff. Could anyone share a proper valgrind suppression file for Qt apps ? Thanks ! Eg. #include <qobject.h> int main() { QObject o; return 0; } returns: $ valgrind --leak-check=full --show-reachable=ye...

Qt Linking Error.

...

Qt splitter disable

Hi, I want to be able to stop a user from moving a QSplitter at runtime. Calling setEnabled(false) does this, but it also disables all child widgets - which isn't what I want. Is there a way to achieve this? Do I have to disable the splitter, and then manually re-enable all child widgets? That seems rather cumbersome, for something that...

Are Qt's stylesheets really handling _dynamic_ properties?

Is Qt's dynamic properties really so dynamic with stylesheets? I have the basic example from stylesheets and dynamic properties: /*stylesheet:*/ *[field_mandatory="true"] { background-color: "yellow";} And I have this happening at runtime somewhere in the code: /*code:*/ myWidget->setProperty("field_mandatory", field->isFilled() ); ...

How do I see the contents of Qt objects during debugging?

Many Qt classes uses pimpl, so they're very opaque to VS's debugger. This is bothersome when I want to check some internal Qt state to see if my code is doing it wrong or if I'm having wrong expectations of how things stand. I'm using the Qt VS add-in (1.1.0), but that doesn't seem to help. Any ideas? Update My autoexp.dat file is ...

How to set QWidget cursor outside the GUI thread

I am working on QT GUI project. In this application I have a QWidget as main window. I make the cursor from data coming from some source. When I set the cursor of widget. It gives me the following error. QPixmap: It is not safe to use pixmaps outside the GUI thread My code is as follows void ImageWindow::setMouseCursor(unsigned char* da...

can you have a private member of the same class as the base class you're inheriting?

Im using the Qt library. I'm currently trying to create my own QDockWidget (the class MY class is inheriting). Right now MY class has an ptr to QDockWidget. Does this even make sense? is that a legal statement? is there a better way to separate the QDockWidget from the rest of my program in Qt? Im a little lost on how to implement a new ...

Qwidget, how to highlight the widget under the cursor

Hi, I have created some QLabel type of widgets in QT, and added that to a QToolbar. I want to highlight the particular widget which is under the cursor. I am unable to understand how do I do that. Can somebody please help ? I need this information on QT 4. Thanks. ...