qt4

How to use QMetaMethod with QObject::connect

I have two instances of QObject subclasses and two QMetaMethod instances of signal in one of objects and slot in another object. I want to connect this signal and slot with each other. I've looked through the qobject.h file and find that SIGNAL() and SLOT() macro are just add "1" or "2" character to the beginning of method signature so ...

How to draw QGraphicsItem in a MFC view

I'm starting using Qt in my application. My application is MFC based. I want to draw some QGraphicsItems in my currect MFC view, is it possible? You may say that it could be done by hosting QGraphicsView with QWinWidget in the MFC view, that don't work, however. Because my Canvas (MFC view) supports zooming and rotating while the QGraph...

QT NOOB: Add action handler for multiple objects of same type.

I have a simple QT application with 10 radio buttons with names radio_1 through radio_10. It is a ui called Selector, and is part of a class called TimeSelector In my header file for this design, i have this: //! [1] class TimeSelector : public QWidget { Q_OBJECT public: TimeSelector(QWidget *parent = 0); private slots: /...

QTest::keyPress is not returning nativeScanCode

Hi, I am simulating F1 key using QTest::keyPress() method to test keypress event, on simulation of F1 key when i check for nativeScanCode, it returns 0 value. can any one help? //Code snippet //To simulate F1 key press QTest::keyPress(&kboard, Qt::Key_F1); //To check keypress Event void keyboard::keyPressEvent(QKeyEvent* ke) { if ( ke...

What is a QT Plugin?

What is a QT Plugin? What are differences between a qt plugin and a custom made qt library? Thanks. ...

changing cell background color in qt

hello .. i'm new to pyqt , and i'm still facing some newbie problems :D i have a QTableWidget that is item delegated on a QChoice control ( hope i said it right ) i need to have the cell background color changes whenever a user change the choice control selection briefly: how to change a cell background color in a table widget ?? i...

Context Menu on QGraphicsWidget

Hi, In my application I have two object type. One is field item, other is composite item. Composite items may contain two or more field items. Here is my composite item implementation. #include "compositeitem.h" CompositeItem::CompositeItem(QString id,QList<FieldItem *> _children) { children = _children; } CompositeItem::~Composit...

MVC in Qt vs Gtk+

I am a Qt C++ programmer with some interest in Gtk+. I wonder how Gtk+ has implemented Model-View-Controller. In Qt they basically screwed it up, and have basically admitted that themselves. I can try to explain the flaws in Qt and for those who know Gtk+ perhaps you can answer whether Gtk+ has the same or worse problems: Access to any ...

Can I un-check a group of RadioBottoms inside a group box?

radio bottoms inside a group Box will be treated as a group of bottoms. They are mutual exclusive. How can I clean up their check states?? I have several radio bottoms, one of them are checked. How can I "clean" (uncheck) all radio bottoms?? "setChecked" doesn't work within a group, I tried to do following things but failed. My code is...

Why can't QFile read from the "~" directory?

I've tried the following short example to find out about a bug in a bigger program I am working on. It looks like QFile doesn't support unix (or the shell's) notation for the home directory: #include <QFile> #include <QDebug> int main() { QFile f("~/.vimrc"); if (f.open(QIODevice::ReadOnly)) { qD...

Getting values from pro files in Qt

Hi, I am using Qt 4.5 in Windows XP. My pro file has the variable VERSION = 1.0. Now i need to read this variable and get its value (1.0) from the source code. So that I don't have to maintain another variable for version inside my source code. I just read from the pro file and update it. So that the value remains consistent all over my...

I'm following Qt Tutorials and got a simple question

If I want to create my own class MyWidget which inherits from QWidget Tutorial tells me to write constructor like this... MyWidget::MyWidget(QWidget *parent) : QWidget(parent){....} I'm wondering what is the role of : QWidget(parent) Does it mean explicit call for QWidget's constructor? ...

Background image not showing on Qwidget

HI, i am designing a window using QWidget and set a background image, when i run my code i am not getting background image but showing window with default background. Can anyone help me what may be the reason. ...

Ovveride, the paintevent of the Qwidget.

Hi, I want to put a background image in mt QWidget, can anyone help me on this. how to Ovveride, the paintevent of the Qwidget and draw a image there ...

How to put an imageor icon over a pushButton

hi, Can anyone help me on putting an image or icon over a push button. I tried with style sheet but not working. Please help ...

How to invoke make install for one subdirectory of Qt project

I'm working on custom library and I wish users could just use it by adding: CONFIG += mylib to their pro files. This can be done by installing mylib.prf file to %QTDIR%/mkspec/features. I've checked out in Qt Mobility project how to create and install such file, but there is one thing I'd like to do differently. If I correctly under...

setting up qt for xcode debugging

I just installed QT 4.6 on snow leopard 10.6.3. I wrote a really simple program. I can generate a xcode project using qmake, but I can't step into QT function. How can I set it up? ...

Can I get build warnings from a custom build step in Qt Creator?

I have the following script that I run as a custom build step in Qt Creator: git ls-files . | egrep "\.cpp$|\.h$" | xargs vera++ Which then gives output: foo/bar.cpp:1: no copyright notice found Another script I also use is: cppcheck . --template gcc -q --enable=style,unusedFunctions With the output: apple.h:8: style: The class...

Poppler compiling using QT4 under Visual Studio 2008

How can I compile poppler 0.13.3 using Visual Studio 2008, and with QT4 support? I want to use poppler as a static lib. Can anyone help, or has anyone done this? Thanks ...

Need QT Creator Source files

I want to create a similar GUI as QT Creator main layout and thus I am looking for QT Creator Source files. Can anyone direct me from where to download. Thanks in advance. ...