qt4

How to map a resource file in QT 4.5?

Is it possible to map a resource in QT 4.5? For example: QFile file(resource_name); file.open(QIODevice::ReadOnly); uchar* ptr = file.map(0, file.size()); When I try this, ptr == 0, indicating an error. It works fine if I try to map a regular file. I am running qt on linux, which supports QFile::Map. ...

In qt 4.5, is it possible to have resources in a statically linked plugin?

I have a custom QT plugin module that has embedded resources. I want to statically link this plugin with an application: LIBS += -lstatic_plugin_with_resources In the application I am using the Q_IMPORT_PLUGIN() macro, which allows the application to use the plugin; however the plugin can not access its embedded resources. Using the...

Microsoft Visual Studio: Loading resources in Qt application (without plug-in)

We don't have a Qt plug-in installed for MSVS, and it makes me wonder how/whether it is possible to load resources (images, etc) to the application. ...

How do I respond to an internal drag-and-drop operation using a QListWidget?

I've got a Qt4 application (using the PyQt bindings) which contains a QListWidget, initialized like so: class MyList(QtGui.QListWidget): def __init__(self): QtGui.QListWidget.__init__(self) self.setDragDropMode(self.InternalMove) I can add items, and this allows me to drag and drop to reorder the list. But how do ...

selected Rows/Line in QTableView copy to QClipboard

Hi. First of all, sorry for bad English. It's about C++ and Qt. I have a SQLite-Database and I did it into a QSqlTableModel. To show the Database, I put that Model into a QTableView. Now I want to create a Method where the selected Rows (or the whole Line) will be copied into the QClipboard. After that I want to insert it into my OpenO...

Qt dialog with no window icon (system menu)

Is there a way to create a window (such as a QDialog), without a window icon on the top-left corner? I have tried using a transparent icon but it leaves a blank space there. Edit: richardwb's solution below removes the system menu, but also removes Minimize/Maximize/Close (caption buttons) as well. This might do for now, but hopefully t...

Qt HTTP authentication with QNetworkAccessManager

I'm working with a webservice which requires a valid username/password. From PyQt, I'm accessing the webservice using QNetworkAccessManager which emits the authenticationRequired (QNetworkReply*, QAuthenticator*) signal when (obviously),authentication is required. When I fill in the user and psswd for QAuthenticator, everything wor...

Does a Qt application work in Google Native Client?

I'm not familiar with Qt or with Google Native Client. Is it possible for a TRIVIAL Qt console application to be ported to Google Native Client? I understand that some work would be involved. But the question is, how much if it's even possible? ...

GNU make --jobs option in QMAKE

I am using qmake to generate MinGW32 Makefiles for a small Qt C++ app we are developing. My problem: all those dual/quad core CPUs are sitting there idly while only one thread is doing the building. In order to parallelize things I tried passing --jobs 4 to make, but the problem is that qmake generates a generic makefile inside of which ...

How can I create a custom QLayout (and ensure it's updated) in PyQt?

I'm trying to implement a custom QLayout using PyQt. setGeometry gets called, and I loop through and call setGeometry on all the widgets I'm managing, but for some reason the widgets never get painted, despite all having the correct geometry. Also, invalidate, update, and activate never seem to get called on my Layout. Does anyone hav...

how to get properties for PyQt4 widgets which could be addressed through style sheets?

i know that there is a documentation page on qt web site but i was wondering if that's possible to get dynamically through python. ...

Prepend/Append Makefile to a QT generated Makefile

I have a building environment where I add some prepending and appending lines to each Makefile generated. It would be nice if I could put this lines into the qmake generated file via my project file (*.pro). Of cause I can do this via some easy shell scripting but it would be much nicer to do it from inside of the project file. Is ther...

How to encrypt and decrypt a file with Qt/C++?

I want to create a program, which can encrypt and decrypt a complete file with an individual password. Is there any way to manage this in Qt and/or C++ and how? ...

QT 4.5 - Is emitting signal a function call, or a thread, and does it blocks?

I am not sure about the nature of the signal/slot mechanism in QT 4.5. When a signal is emitted, is it a blocking function call or a thread? Say this emit GrabLatestData(); // proceed with latest data Will all the signal/slot chain be resolved before proceeding to the next line? ...

stdout/cout from application launched from qt creator?

I've been learning qt on windows for a little while (background in unix/embedded) and would like to have stderr/stdout dumped out somewhere (unit test/event logging/debug) from my win32 qt GUI app. That seems to be a tall order in windows and I found this post on stackoverflow which explains why. I find myself wondering why qt doesn't ...

Morphing multiple executables into a single application

I have three legacy applications that share a lot of source code and data. Multiple instances of each of these applications be executed by a user at any time, e.g. a dozen mixed application executions can be active at a time. These applications currently communicate through shared memory and messaging techniques so that they can maintain...

QT 4.5 - how do I perform a queued connection with a template type?

I am trying to do a connect with a std::vector& using queued connection connect(this, SIGNAL(process(QVector<FrameData*>&)), this, SLOT(beginProcess(QVector<FrameData*>&), Qt::ConnectionType::QueuedConnection); What parameters should I pass for QRegisterMetaType for this to work? Thanks in advance! ...

Qt 4.5 - QList::QList(const QList&) - is this a deep copy constructor?

I am getting confused about the QList copy constructor by the documentation. QList::QList ( const QList & other ) Constructs a copy of other. This operation takes constant time, because QList is implicitly shared. This makes returning a QList from a function very fast. If a shared instance is modified, it will be cop...

overriding qt4 compile time settings

Hello, I'm trying to compile a qt app with qt4 sdk + tools we've checked into our source control server(p4). Specifically, I've converted the qt4 project (.pro) file into a visual studio project file which is syntatically correct and accepted by VS. The problem is the location of the resource and MOC compilers. Qmake is configuring the ...

Multiple keyboard shortcuts for action in Qt Designer

I'm having a weird problem with Qt designer. I have the following shortcut for a refresh action:F5,Ctrl+R The idea is that on Macintosh, Ctrl+R maps to Command+R which is more intuitive and on Windows, F5 does the job. The problem is that only the first shortcut seems to be active. Is there a way for me to change the action's shortcut ...