qt4

How does QT4 compare to .Net

Just curious. Does anyone have experience with both. My gut feeling is that QT is better for cross platform applications but the UI won't be as slick. Also is QT faster since it compiles to native code with no Virtual Machine? I think also QT is C++ so unmanaged, so there is more chance of memory leaks etc? If I wanted to develop a non ...

QThread, threaded, rly?

Hi for some time I am fiddly now to get a massive time/cputime drain action running behind a nicly responding UI. Unfortunatly I can't seem to get it running and "I think" the problem is that the slot is not processed in the QThread worker but the GUI thread. The ThreadIDs differ as expected though. I allready read this http://doc.trol...

[SOLVED]How to propagate keyPressEvent on different qt QMainWindow

I have 2 different QMainWindow, the first is the parent of the second. I want press some keys in the children windows and propagate the event in the parent. I create for everyone the function void keyPressEvent(QKeyEvent* event); but when i press key on the children the event is not propagate to the parent. Why? This is the code... //P...

Qt4 C++ Pointer to const QList of pointers.

I got stuck with pointer to const QList of pointers to Foo. I pass pointer to myListOfFoo from Bar object to Qux. I use pointer to const to prevent making any changes outside Bar class. The problem is that I'm still able to modify ID_ executing setID in Qux::test(). #include <QtCore/QCoreApplication> #include <QList> #include <iostream>...

Adding custom widgets to QMenuBar

Hello, Qt3 used to provide QMenuBar::insertItem with QWidget* parameter. This way any custom widget could be added to menu bar - for example a clock-widget. In Qt4 there is no such overloaded method. What would be the best way to reach the same goal - adding custom widgets to a menu bar? The custom widgets should be integrated in the lay...

Qt model-view: how to suppress model::data DecorationRole when the QTableView cell editor is active

I have a delegate to create a QLineEdit control when you want to edit a cell in my subclass of QTableView. In the data function of my model, I recently added a case to return an icon for Qt::DecorationRole for some items. As the user edits a cell that has an icon, the value they enter may cause the icon to disappear. That is all worki...

How to animate widget transparency in Qt4?

I need to animate widget transparency. It seems to me, that I should use QPropertyAnimation. But how could i define widget translucent? Should I use something like this? ...

QTableView - Selection background color

Hi, I am using the following code for set the style for the table in simulator(S60)(Nokia Qt SDK). searchTable->setStyleSheet("background: rgb(255,255,255);color:rgb(0,0,0); font-family:Arial Narrow;font-size:20px; border: 4px outset rgb(255,255,255);gridline-color: #669933;" "selection-background-color: qline...

Writing XML Nodes in QtXML (QDomElement)

Hi, I would like to write Nodes like <name>Peter</name> (with start and end tag) into a QDomDocument. When I create QDomElements and append them as child to a parent element: QDomElement node = doc.createElement("node"); parent.appendChild(node); They are added as <node/> to the parent element. The parent automatically gets ...

Qt4 Wrapper results in Segmentation fault(s)

I'm currently writing a set of wrapper functions of Qt4 for an application as plugin (because I personally think that writing extensions in plain C is easier to accomplish). At first I though this could be done by simply abstracting the following: #include <QApplication> #include <QPushButton> int main(int argc, char *argv[]) { QA...

Qt problem with GUI application

Hello. I have a simple code in Qt, as below: #include "mainwindow.h" #include <QWidget> #include <QGroupBox> #include <QLabel> #include <QLineEdit> #include <QGridLayout> #include <QVBoxLayout> class classA; class classB; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { classA * objA = new classA(this); classB *...

Qt Widgets seem to be overlapping other widgets when they shouldn't

I used setGeometry() to move and size some buttons and a list on a Window. The problem is that the buttons and list have a certain order and are overlapping strangely. I don't even want them to overlap and don't understand why they are overlapping in the first place. As they are in the code below, the only thing I can click is BtnPlay. ...

How to use main application objects from Qt plugins (under Windows) ?

Hello, I'm developing a Qt application, a core system and plugins to extend the core. In plugins I am using objects compiled in the main binary. Under GNU/Linux (Fedora 13 and Debian 5.06) there is no problems. I even don't need to link the plugin with Qt, all Qt's objects are instantiated from the main binary. But under Windows, when...

Why is there a segmentation fault error if I include an array of widgets in Qt?

I'm a little new to object oriented programming, and very new to Qt and GUIs in general. I am now playing with this example in Nokia's Qt tutorial: http://doc.qt.nokia.com/4.1/tutorial-t5.html I tried to extend the code; this is what I have now: #include <QApplication> #include <QFont> #include <QLCDNumber> #include <QPushButton> #incl...

QComboBox replacing edit text if case differs from existing item.

Hi I'm having a problem with QComboBox not allowing me to change the edit text to anything existing item of differing case. Example code is below. What I'd like to do is enter 'one' into a combo box already containing the item 'One' without the side effect of the text being changed to 'One'. Currently it's changed back to 'One' as...

How to write my own download manager using c++?

hello i want to write my own download manager using c++(qt4) but i have no idea about that so please suggest me from where should i start if you know any good tutorial or link the please post it. i also want to implement the pause/resume and multiple download features also. i already know that there is a long list of download mana...

How to encrypt/decrypt file contents using Qt?

Hi All, This question has been asked many times before by others, but somehow the answers made me more confused. In my Qt application (for symbian devices), I have a file with user details (Email ids n passwords) which I store in target device, so want to encrypt this data in the file to keep it secure. I don't need a super secure encr...

Qt4 Program Crashing Unless SDK Installed

I've written a Open Source program that I've released as GPL built using the Qt4 LGPL SDK. This program has the ability to search an optional Sqlite3 database for data. Here is what is making me lose my mind. I compile the program on the development machine. When I try to run it, I can errors about missing DLLs. I copy those dlls into t...

Qt QComboBox with different background color for each item?

Greetings all, Is there a way to set a different background color for each item in a QComboBox ? Thank in advance ...

Make QFormLayouts inside multiple QGroupboxes have the same column widths.

I have a dialog in qt that has multiple groupboxes, each using a form layout. Something like this: https://dl.dropbox.com/u/4494367/Groupbox_Layouts.png Is there a way to get the form layouts to link, so that the have the same column widths? ...