qt4

QT 4.5 - How do I enable LTCG in VS2005 when linking to QT libraries?

While attempting to link with QT 4.5 release, I run into this error message fatal error C1047: The object or library file 'c:\qt\2009.02\qt\lib\qtmain.lib' was created with an older compiler than other objects; rebuild old objects and libraries I have been using the same compiler for my current projects to compile QT 4.5 ...

Header dependencies in qmake using MSVC Express

Hi, I'm using QtCreator on windows using MSVC compiler (the compiler from Visual c++ express edition) and qt 4.5.2 open source. When I modify a header on the project and press build all, nothing is actually built, only If I modify a .cpp file the modified cpp is compiled. That causes that every time that I have to change some header f...

Qt 4.5 .NET framework dependency

I'm currently developping an application with Qt 4.5 on Windows Vista and Visual Studio 2008 as IDE. The problem is that the program crashes on Windows XP SP2 (works perfectly with XP SP3 and Vista). This can be fixed installing the .NET framework 3.5, but I want to avoid that. Is there a way to prevent that given that I have to use th...

How do I make a QVector of widgets?

How do I make a QVector (or some other container class) of a dynamic number of widgets, such as QPushButton or QComboBox in Qt 4? I've used the following in my window class's constructor: QVector<QComboBox*> foo; // Vector of pointers to QComboBox's And now I want to fill it with some number of controls which can change dynamically: ...

Transform flat image into nice rounded image with 3D highlight, a la iPhone, using Qt

On the iPhone, you give it your 45x45 flat image for the app icon, and the SDK rounds and highlights it for you automatically, giving it a new 3D effect. Does anyone have sample code or recommendations on how to emulate this using Qt4 APIs? Thanks, --DD ...

QTableView - not allow user to edit cell

I created a QTableView with a QSqlTableModel. By standard, double-clicking on the cells will mark them and the user can edit them. I want, that the user isn't allowed to do that. He is allowed to mark the whole row by clicking on a single cell, but not to edit the cell. How can I do that? ...

In Qt, how do I align form elements in different group boxes?

Hello, I'm trying to create a standard two-column form, where the first column is a text label (QLabel) and the second column is an interactive widget, typically a text field (QLineEdit). We have decided to place form rows that share a common theme inside a QGroupBox, and thus in a separate layout than the main layout. Thus, the form el...

Selecting QComboBox in QTableWidget

One cell in each row of a QTableWidget contains a combobox for (each row in table ... ) { QComboBox* combo = new QComboBox(); table->setCellWidget(row,col,combo); combo->setCurrentIndex(node.type()); connect(combo, SIGNAL(currentIndexChanged(int)),this, SLOT(changed(int))); .... } In the handler function ...

C++ and QT4.5 - is passing a const int& overkill? Does pass by reference helps in signals/slots?

Two questions rolled into one here... I have a number of functions which are called multiple times per frame for a real-time video processing application. Taking advice about const and pass by reference, the functions have a signature somewhat like this void processSomething(const int& value); As I keep typing the few extra character...

Qt4Dotnet on Mac OS X

Hello everyone. I'm using Qt4Dotnet project in order to port application originally written in C# on Linux and Mac. Port to Linux hasn't taken much efforts and works fine. But Mac (10.4 Tiger) is a bit more stubborn. The problem is: when I try to start my application it throws an exception. Exception states that com.trolltech.qt.QtJamb...

How to connect a slot to signal QProcess::started() ? QT

Edit: Solved. Hi, I'm starting with QT, I try to connect a slot to signal QProcess::started() but can't. QObject::connect() returns false. Any idea what am I doing wrong? Here's part of the code: class foo : public QObject { public: QProcess *process; public slots: void process_started(); } foo::foo() { process = new QPro...

How to design Floating tool bar in Qt 4.5.2

How to make Floating tool bar in Qt, just like the top floating panel of Microsoft Windows RDP client, any code example? Regards ...

Placement of Qt4 widget on windows

Hi, How can I place a Qt4 widget just above the system tray on windows. Since exact coordinates may depend on resolution and even the size and placement of the task bar(top or bottom of the screen etc.)? I think there is probably a method for getting the screen resolution, but is there any method for getting the size of the taskbar and...

qt moc.exe not generating *.moc file

Hi, I'm trying to build the qtestlib/tutorial1 example, but the testqstring.moc file isn't being generated when I run nmake (I'm running QT 4.5.2 on Windows XP SP3). I copied testqstring.cpp from the tutorial directory to my build directory (C:\sandboxes\testqstring) and from the QT command prompt ran vsvars32.bat file from my MS Visual ...

QCalendarWidget as "Pop-up", not as new Window?

Hi there. I want to create a Settings-Widget, where I can choose a Date. Because it isn't nice to create 3 QLineEdits to call the QDate-Constructor with QDate(int year, int month, int day), I thought it would be better, if you can push a "show calendar"-Button for example, where you can choose the date. But I don't want to show this cal...

Set a custom icon for a QAction when disabled

Is it possible to have a custom icon displayed for a QAction when it is disabled? E.g. display icon A when the tool is enabled and icon B when the tool is disabled. ...

Checking available room in QT Dock

I'm using QT4 and I have a menu option that programatically adds a new dock widget into a dock area. Unfortunately, if the dock area is already full, adding a new dock widget will cause it to resize the dock widgets below their minimum size, leading to overlapping widgets and worse. How can I verify there is enough space in a dock area...

QT4 Drag Window Without Title Bar

The application I'm working on has a custom UI that required me to remove the title bar from the main window. Unfortunately, I can't figure out how to make it so I can move the application on the screen :) The code I have which is removing the title bar is the following: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent...

Single file Qt4 demo

Sometimes you need to create a very simple single file application in Qt4. However it's problematic since you are always doing the CPP/H separation, and then the main() is in another file... Any ideas how to do this in a single file? As quick as dirty as possible. ...

How do I find a dimension of aspect ratio 4:3 which fits within a predetermined size?

The problem here is I have a display window of size x by y, and I need to display an image inside the window without any scrolling, and to maintain the aspect ratio of 4:3. I have the following snippet of code: // Lock the current height, calculate new width of the canvas and scale the viewport. // get width of the movie canvas qreal wi...