qt4

What is the purpose of the garbage (files) that Qt Creator auto-generates and how can I tame them?

Hello Everyone, I'm fairly new to Qt, and I'm using the new Nokia Qt SDK beta and I'm working to develop a small application for my Nokia N900 in my free time. Fortunately, I was able to set up everything correctly, and also to run my app on the device. I've learned C++ in school, so I thought it won't be so difficult. I use Qt Creator...

Cannot run an executable binary file on another Linux System??

I'm using Ubuntu 10.04 and Qt4.6, and I've created an executable binary file on my own computer through QtCreator. Now I want to put my executable file on CentOS 5, but it seems that this executable file cannot run on CentOS. The error message is bash: ./[filename]: cannot execute binary file Now I know this comes from 32-bits and ...

QtCreator on linux: 32-bits vs. 64-bits.

My laptop is 64-bits, so when I start to use Qt, I chose 64-bit QtCreator. Now I'm facing a problem, I wish that the executable files I generated are runnnable on 32-bit linux system. Can I set QtCreator to generate 32-bit executable files? So that I can decide I want to generate 32-bit ones or 64-bit ones. I don't want to install anot...

Singleton class issue in Qt

i created a singleton class and trying to access that class in other class but getting error "cannot access private member" Setupconfig is my singleton class and i am trying to access this class in other class which have QMainWindow Error 'Setupconfig::Setupconfig' : cannot access private member declared in class 'Setupconfig' /////...

Error building QtDeclarative with Qt 4.6.2 on Mac OS X

I tried hard to build QtDeclarative with Qt 4.6.2 on Mac OS X (Leopard) and did lots of Googling without finding any cure. Could anyone please help to solve this problem? Thanks. Here goes the error: Undefined symbols: "QObjectPrivate::isSignalConnected(int) const", referenced from: QmlGraphicsKeysAttachedPrivate::isConnected(ch...

QGraphicsView ensureVisible() and centerOn()

Hi, I am going to do pan/scale stuff on QGraphicsView. So I read the documentation of QGraphicsView and see some utility functions like ensureVisible() and centerOn(). I think I understand what the documentation says but I can' t manage to write a working example. Could you please write/suggest me an example code to understand the issue....

QT and custom menu item (QLineEdit)

Hi How can I use QLineEdit as a menu item in QMenu? Is there any solutions to do this? Just to do something like this (look at the edit box under the avatar): ...

QWinWidget's position is always 0 (zero)

I hosted a QWinWidget in a CView and want it to stay at a designated position when resizing. But QWinWidget always moves to (0, 0), i.e. left-top corner of the CView. I tried to debug in this way: QWinWidget* pWidget = new QWinWidget(pCView); pWidget->move(50, 50); QPoint pos = pWidget->pos(); Note that: the pos is always (0, 0). Wh...

Implement a multithreading environment

I want to implement a multithreading environment using Qt4. The idea is as follows in c++-alike pseudo-code: class Thread : public QThread { QList<SubThread*> threads_; public: void run() { foreach(SubThread* thread : threads) { thread.start(); } foreach(SubThread* thread : threads) { ...

How do I use foreach with QDomNodeList in Qt?

Hi Everyone, I'm new to Qt and I'm learning something new every day. Currently, I'm developing a small application for my Nokia N900 in my free time. Everything is fine, I am able to compile and run Maemo applications on the device. I've just learned about the foreach keyword in Qt. (I know it is not in C++, so I didn't think about it ...

Qt Won't Compile (10.5 Intel Mac)

Hi all, I am trying to compile the latest version of Qt for the mac (from Gitorius). When I try to compile this (by doing ./configure and then make), I get the following error while running make: ../../include/QtCore/../../src/corelib/kernel/qvariant.h: In function ‘T qvariant_cast(const QVariant&) [with T = QVariant]’: ../../include/Q...

Basic QT Event handling / Threading questions ?

Greetings , I am new to QT (4.6) and have some basic questions regarding its event mechanism.I come from Swing background so I am trying to compare it with QT. 1) Does Event-processing-loop run in seperate thread? (like EventDispatch thread in Swing) ? 2) If we open several 'QMainWindow' do they run in several threads? 3) Whats the be...

how to change headers data

hello i have the following class class AssetTableModel(QtCore.QAbstractTableModel): def __init__(self,filename=''): super(AssetTableModel,self).__init__() self.fileName=filename self.dirty = False self.assets = [] self.setHeaderData(0,QtCore.Qt.Horizontal,QtCore.QVariant('moayyad'),QtCore.Qt...

How QRectF::adjusted() works

My custom graphics item has (0,-60 60x60) boundingRect. When I adjust the coordinates with rect.adjusted(-5,-5,5,5) new boundingRect returns (-5,-65,70x70). I read the documentation here and I think boundingRect should return (-5,-65,65x65) Do I misunderstand the doc? ...

Cannot press QPushButton in a simple program

Basically, I want a simple pushButton with a colorful text which when pressed exits the application. Why cant I press PushButton in this simple program. I am using QT 4.6 on Arch x86_64. #include <QtGui/QApplication> #include <QLabel> #include <QPushButton> #include<QtGui> int main(int argc, char *argv[]) { QApplication a(argc, a...

Should the name of my classes begin with 'Q' in Qt?

Hello Everyone, When I first started working with Qt, it was extremely annoying that every class has a name beginning with 'Q', but now I've got used to it. I'm using Qt Creator, and it highlights code quite well. However, it only highlights class names beginning with 'Q'. And it highlights everything beginning with 'Q' even if there i...

dumpbin equivalent in Qt

Is there any utility similar to dumpbin(Visual Studio) in Qt that allows me to check the functions that are exposed in a Qt-Creator compiled dll ?? I need to know what methods are exposed in a given dll so that I can load the method dynamically at runtime using QLibrary. Thanks, De Costo ...

Type-aware rendering (and editing) of tabular data in pyqt4

I would like to have a very short / minimal example of how to create some tabular widget with different types of item in it. In the first round let's say I'd like to render [["Hello", 12, True], ["World", 13, False]] (Hello as string, 12 as number (right-align), True as a checkbox for eg.), but it would be nice to have Dates, Colors, an...

Using MAC STYLE with Qt

How do I apply the "mac style" on my forms and windows? Using Qt (C + +) ...

ctypes and PySide

I'm building an app with PySide, there's some image manipulation that needs to be done and using Python code for this is way too slow. Therefore I hacked out a .dll file that will do it for me. The function definition is as follows: extern "C" { QRectF get_image_slant(QImage *img, float slantangle, float offset) { Now I can load th...