qt4

Qt: Defining a custom event type

I have created a custom event in my Qt application by subclassing QEvent. class MyEvent : public QEvent { public: MyEvent() : QEvent((QEvent::Type)2000)) {} ~MyEvent(){} } In order to check for this event, I use the following code in an event() method: if (event->type() == (QEvent::Type)2000) { ... } I would like to b...

Qt4: QMap causing "strict-aliasing rules" compilation error

I'm trying to create the following data structure in Qt 4.5 in C++: QMap<int, QMap<QString, QVector<QPointF> > > animation; However, the inclusion of this line in my code results in the following error: cc1plus: warnings being treated as errors In file included from XXX/XXX/XXX/MainWindow.qt.C.tmp.C:113: /usr/lib/qt4/include/QtCore/q...

To connect Gstreamer with Qt in order to play a gstreamer video in the Qt Widget

I tried using phonon to play the video but could not succeed. Off-late came to know through the Qt forums that even the latest version of Qt does not support phonon. Thats when i started using Gstreamer.Any suggestions as to how to connect the Gstreamer window with the Qt widget?My aim is to play a video using Gstreamer on the Qt widget....

Embedding VLC on Windows

How to access the webcam on windows (XP)? On Linux, I'd use the MRL "v4l2://", as in: libvlc_media_new(libvlc_new(),"v4l2://",&libvlc_exception_t) And let it detect it automagically. I know, this could fail sometimes. ...

QSize ( int width, int height )

how can i get dynamic size? const size its work " static const QSize resultSize(470, 470); // Bildgröße" but not dynamic ...

Picture control in QT

Hi, i am learning QT, i am not getting how to get the picture control in QT?. in .net we have picture control right same way i need in QT. i know text edit support pictures but is there any alternatives. please tell if so. Thanks ...

How do I prevent Qt buttons from appearing in a separate frame?

I'm working on a PyQt application. Currently, there's a status panel (defined as a QWidget) which contains a QHBoxLayout. This layout is frequently updated with QPushButtons created by another portion of the application. Whenever the buttons which appear need to change (which is rather frequently) an update effect gets called. The e...

Transparent image in QT

Hi.. i am new to QT, i got to know how to load a simple image on a window. i want to know how to make transparent?. please tell me the way to achieve it. Thanks ...

QT4: update() or repaint() fails to trigger paintEvent()

I have a QScrollArea fathering my awesome scrolling widget. I like to do updates on the contents on various occasions. For this I did an override of paintEvent(QPaintEvent *). Then everytime I want it to be done I call update() on the widget. Problem: paintEvent() is never called by this! What I tried in troubleshooting so far: Use ...

QList memory deallocation

I'm trying to free memory after using QList, but it doesn't seem to work properly. Here's my code: QList<double> * myList; myList = new QList<double>; double myNumber; cout << "CP1" << endl; getchar(); // checkpoint 1 for (int i=0; i<1000000; i++) { myNumber = i; myList->append(myNumber); cout << myList->size() << endl; ...

Qt installation error

i got an error when am trying to configure Qt. Erro : execute: File or path is not found (nmake) execute: File or path is not found (nmake) Cleaning qmake failed, return code -1 // installion files. InterBase...............no Sources are in..............E:\xampp\Qt\4.6 Build is done in............E:\xampp\Qt\4.6 Ins...

Problem with selection rectange

Hi.. i m trying to make Customized listview in QT for symbian OS. i am facing some problem, i am able to draw everything like icon,text etc.. where ever i wish but the problem is, it is not getting selected by default.. i hope u got it. to do selection i need to draw the rectangle manually.. it could be a problem if them get changed o...

Using C++/Qt4 application as backend for web application

Hello, for one of my applications I'd like to provide a minimal web interface. This core application is written in C++ and uses Qt4 as a framework. Since I'm also using some libraries I wrote to calculate some things and do some complex data management, I'd like to use this existing code as a backend to the web interface. Idea 1: Using...

Trouble with progressbar in QT

Hi.. i m facing problem in giving animation to progressbar in QT. where is the mistake in the following code, i am getting continues progress bar, but its not animating QApplication a(argc, argv); QProgressDialog *dialog = new QProgressDialog(); QProgressBar *pbar = new QProgressBar(dialog); pbar->setMinimum(0); pbar->setMaximu...

What is the mistake in my code. please help

Hi..i am new to QT the sample code mentioned below is not compiling ..please tell me the reason. #include "QprogressBar.h" #include <QtGui> #include <QApplication> #include<qprogressbar.h> #include <qobject.h> lass myTimer: public QTimer { public: myTimer(QWidget *parent=0):QTimer(parent) {} public slots: void recivetime(); };...

Qt4 parent pointer usage

I'm having some problem with understanding usage of parent pointer in QT4. class firstClass : public QWidget { Q_OBJECT public: firstClass(QWidget *parent = 0); ~firstClass(); void doSomething(); private: secondClass * myClass; }; class secondClass : public QWidget { Q_OBJECT public: secondClass(QWidget...

Penalty of using QGraphicsObject vs QGraphicsItem?

I currently have a hierarchy of items based off of QGraphicsItem. I want to move to QGraphicsObject instead so that I can put properties on my items. I will not be making use of signals/slots or any other features of QObject. I'm told that you shouldn't derive from QObject because it's "heavy" and "slow". To test the impact, I deriv...

What happens when I call QWidget->close()

I would like to know what happens when I call QWidget-close() I called it after a setup function I coded and this disabled some of my slots to get called. before(creates odd behavior): pGrpCfg->setupGrpConfig(); pGrpCfg->close(); pGrpCfg->show(); after(ok): pGrpCfg->close(); ...

PyQt4: Hide widget and resize window

Hi everyone: I'm working with several widgets but the solution just won't come out. What I have is a series of buttons in series of QHBoxLayouts. Some buttons are hidden by default, but they will appear when needed. To solve space issues, all buttons have a minimum and maximum size so they always look well packed. Also I have a QTextEdi...

How to place one widget over another in QT

Hi.. i have a window in QT, on that i am drawing a picture. now i want to place the progressbar over it. how can i do that?.. steps i am following to do 1) Create a window, 2)draw picture in paint event of window 3)then create QGridLayout layout, add your window 4) Display over it. suppose i want to add progress bar, over a portion...