qt

How to integrate the Qt libraries in SparxSystems Enterprise Architect

Hey, I like to know how one can integrate the Qt libraries into an Enterprise Architect project. I do not know if it is possible at all but I tried it with partial success: I added a new package to my project tried to import qt through Context Menu / Code Engineering / Import Source Directory and started with the directory src/corelib/k...

QFontMetrics::leading() returns 0

Hello guys, Why next function returns 0 ? (My environment is: Windows Vista, vc++9, Qt4.5) int func() { QPushButton button("Blah blah"); QFontMetrics fm = button.fontMetrics(); return fm.leading(); } Calling to "fm.height()" returns reasonable results (16 px in my case). Calling to "fm.lineSpacing()" returns same resu...

Sharing widgets between PyQT and Boost.Python

Hello, I was wondering if it was possible to share widgets between PyQt and Boost.Python. I will be embedding a Python interpreter into an application of mine that uses Qt. I would like users of my application to be able to embed their own UI widgets into UI widgets programmed in C++ and exposed via Boost.Python. Is this possible and ...

QWT plugin for QT 4.5

Hi, I have gotten the latest QWT 5.1.2 for QT 4.5 and managed to get it to complie. I am now trying to get the plugin to work in QT Designer (with VS intergration). I have placed the plugin files into the plugin/designer folder, but when attempting to load, I hit this error Cannot load library qwt_desginer_plugin5.dll: The specified mo...

destructors in Qt4

I'm very confused about using destructors in Qt4 and hope, you guys can help me. When I have a method like this (with "Des" is a class): void Widget::create() { Des *test = new Des; test->show(); } how can I make sure that this widget is going to be deleted after it was closed? And in class "Des" i have this: Des::Des() { ...

Is it possible to use Qt threading without inheriting any Qt object?

The only way to enable threading demonstrated in qt documentation is through inheriting QThread and then override its run() method. class MyThread : public QThread { public: void run(); }; void MyThread::run() { QTcpSocket socket; // connect QTcpSocket's signals somewhere meaningful ... socket.connectToHos...

Store QList<T> in QVariant and stream to QDataStream?

Hi, Here's the demo code: QList<Custom> L; QVariant v(QVariant::fromValue(l)); QDataStream d; d << v; The problem seems to be that d doesn't know how to stream v, because v doesn't know how to do a metatype save on L. I have registered Custom and L as metatypes and I've also registered their IO streams, but L has no meta object, and I...

Change compilation flags in Qt under Mac OS X?

I installed Qt for Mac, and am compiling my Qt project after adding in the .Pro file CONFIG(release, debug|release):QMAKE_CXXFLAGS += -O3 -fomit-frame-pointer to optimize for speed. However, I always see that the command where g++ is ran, includes -Os, which optimizes for size. I would like to remove it. I tried several approaches, ...

Why "Follow symbol under cursor" does not work in QT Creator for Mac OS X?

Hi I'm using QT Creator under Mac osx, but "Follow symbol under cursor" option, to allow me to jump for class and methods' definitions, does not really work... it only works for local symbols. neither does "Switch between method declaration/definition" any ideas? thanks much for any thought Lior ...

How to set the line where a QToolBar is displayed?

Hello, I would like to ask if anyone knows how to display 2 QToolBars in two lines, one on top of the other? I found the class QStyleOptionToolBar, but I don't know how to use it... It is easy to drag one toolbar with the mouse to be placed below the other, so I think there must be a way how this can be done from the source code as wel...

Trouble using Qt with Visual Studio

I am looking to do Qt development with Visual Studio 2005. I have built the Qt libraries for Visual C++ and have downloaded the Qt plug-in using the steps outlined here. I've set the QTDIR environment variable to point to the newly built Qt environment (C:\Qt\vc). However, when I start Visual Studio, I get the following message: Th...

Switching from wxWidgets to QT for porting to Mac?

We are selling an image processing application (about 120k lines of code) developed with wxWidgets. We planned everything to be as most cross platform as possible in case the porting from Windows to other OS was needed. And in fact we are going to realiza a version for Mac. We haven't tested wxWidgest on Mac yet, but we haven't read very...

Turn off opaque resizing of QMainWindow / QDockWidget separator

Is it possible to turn off opaque resizing on QMainWindow / QDockWidget separators? (i.e. the central widget only resizes once the separator is dropped, and not during the drag.) ...

Qt using std::use_facet with wstring

I need crossplatform code to skip leading spaces for wide string. It's looking that g++ (and Qt obviously) doesn't initialize slots for wide string at all So following code works fine for VC++ but almost g++ fails with bad_cast exception: #include <string> #include <locale> #include <iostream> int main() { typedef std::ctype<std::...

qt GUI connecting

I am just starting out with QT. I have read through some tutorials, and I think I have an understanding of signals and slots. I am writing a GUI that has various buttons that change the state of my main program. So for example in a drawing app, you would pick different drawing tools (using various buttons). What is the best way to go ab...

qmake and multiple MSVS versions

From Visual Studio 2008 Command Prompt I run this command to generate .vcproj file: >qmake -spec win32-msvc2008 And get a warning message: WARNING: Generator: MSVC.NET: Found more than one version of Visual Studio in your path! Fallback to lowest version (MSVC.NET 2008 (9.0), MSVC.NET 2008 Express Edition (9.0), MSVC.NET 2005 (8.0), ...

How to avoid entering library's source files while debugging in Qt Creator with gdb?

How can I configure Qt Creator and/or gdb so that while debugging my program using Qt libraries the debugger would avoid stepping into Qt's source files? ...

How many threads does Qt create to work in the background?

Hi, I use qt a lot. I want to know something: how many threads does Qt create do to things in the background? like handling signals and slots.. Also, any GUI toolkit creates Event threads too (i seem to remember java does). Does Qt create one too? EDIT: when I say "how many threads", I really mean which threads Thanks, jrh ...

Variables that persist across .pro files from a subdirs pro file

Greetings, I've got a .pro file that looks like: TEMPLATE = subdirs SUBDIRS = foo bar I want to set a variable, or define, or something in my subdirs .pro file that can be read in both the foo and bar .pro files. I've tried to set an environment variable with: export TEST=something but that does not work, message($$(TEST)) always...

Advantages of knowing for a client, how big the package sended by the server is

I'm really new at network-programming, so I hope this isn't a complete Newbie-question. I read a tutorial at the Qt-Homepage how to build a little server, and I found this: QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out << (quint16)0; out << "..."; // just some text out.device()->seek(0); out << (quint16)(block.s...