qt

How-to override KeyPressEvent for an editable QComboBox ?

Hi, I have a class named ValidableComboBox that derives directly from QComboBox. Every instance of ValidableComboBox has setEditable() set to true. My goal is to add some signal that will be emitted whenever someone presses return key in the QComboBox. To do so, I reimplemented void KeyPressEvent(QKeyEvent* e) in ValidableComboBox. Ho...

QObject: Cannot create children for a parent that is in a different thread

I am using Qt Creator 1.3.0 with Qt 4.6.0 (32 bit) under Windows 7 Ultimate. Consider the following QThread: Header class ResultThread : public QThread { Q_OBJECT QString _post_data; QNetworkAccessManager _net_acc_mgr; signals: void onFinished(QNetworkReply* net_reply); private slots: void onReplyFinished(QNetworkRep...

How to compile Botan and Qt on Windows?

I'm writing a Qt application that uses Botan. For the Windows version I decided to use the precompiled DLL, so I downloaded the installer, installed Botan in C:\botan and added: win32:INCLUDEPATH += C:/botan/include win32:LIBS += -L"C:\botan" -lbotan to my .pro file. However I'm getting linker errors (undefined reference to...) during...

how to convert Xmlstring to Xmlfile or QDomDocument

If I have a string which contains proper xml format and I want to convert it to an XML file so I can use Xpath to parse it properly. How do I do this? please give me some valid example and i also want to load those each xml node value into Qtablewidgetitem how can i do..please help mee ...

Redrawing QGLWidget with 3D+2D graphics

Hi, I have a QGLWidget which draws both 3D and 2D graphics (just like in Qt's overpainting example). The thing is after I added drawing 2D graphics (moved code from paintGL() to paintEvent(), etc.), the widget stopped redrawing most of the times. It didn't redraw after resiging, after loading, and so on. So I put repaint() calls, it he...

QT: Is it a good idea to base my domain objects on QObject?

Hi, I'm reasonably new to using the QT framework in combination with C++. I was wondering: Is it a good idea to base my domain classes on QObject? Or should I only do this for classes higher up in the hierarchy? (closer to the user interface level). The QT documentation isn't clear on this: Taken from the QT documentation: The meta...

Hook a QT Application with C++ to capture textname of the application

Hi guys, I have a simple QT application running on Win32 platform. I need to write a C++ program described as: the input is the windows handle of that QT application, which is already available, the output is the text name ( AKA caption ) of the application. I hope someone will show me the way to do this right. Thanks a lot. Smile ...

How to compile (build) my Qt application to run on many linux distributions?

Hi, I have created a Qt GUI application and I want to provide a linux executable that runs on as many distributions as possible. Is this possible or do I have to provide a separate executable for each distribution? Thanks for your help ...

[Qt]paintEvent not getting called in custom button derived from QAbstractButton

I'm trying to create a custom button, derived from "QAbstractbutton". I have overridden the paintEvent. However, my button is not visible in my widget. What I see is that the paintEvent is not getting called even after calling update/repaint/show on my button. What could be the missing link here? Thanks! ...

Qt + XCompositeRender problem

I want to render the contents of the window in to QWidget ( or QPixmap ) using XComposite and XRender. The Issue I'm facing is that I can't get the picture be rendered in the QWidget. The code below has been written using the following tutorial: http://ktown.kde.org/~fredrik/composite_howto.html The window ID is hardcoded, so there can b...

Qt: Add poppler library

I have downloaded Qt SDK (with the libraries) for Linux from the Qt website. Now I want to add the poppler library to it so that I can read PDF files. But the problem is if I install libpoppler-qt4-dev from the Ubuntu repos it pulls all the Qt libs which are already there in the SDK. How can I simply install poppler without the extra bl...

QWidget - resize animation

Say I have a QHBoxLayout where there are 2 QTextEdits and between them a button with an arrow to the right. So when you click on the button, the right-side QTextEdit gradually closes by moving the lift borther untill it meats the right one. Simulutaniously, the right border of the left QTextEdit thakes the place which the right QTextEdit...

Verify the structure of a database? (SQLite in C++ / Qt)

Hello, I was wondering what the "best" way to verify the structure of my database is with SQLite in Qt / C++. I'm using SQLite so there is a file which contains my database, and I want to make sure that, when launching the program, the database is structured the way it should be- i.e., it has X tables each with their own Y columns, app...

QSlider - how to color the space

Dear developers... i need to design my QSlider ... I have start point and end point on the slider bar the start point and the end point is movable by the user now i need to color the space between the start point and the end point Please let me know your helps and suggestion on this ...

QFileDialog for directories that have certain content

I would like to build a dialog similar to QFileDialog::getExistingDirectory() for which the OK-button only is enabled when the selected directory contains certain files. I know I cannot achieve this with QFileDialog, instead I would have to come up with my own QDialog that has a QTreeView coupled to a QFileSystemModel. How can I limit...

Parse .pls / .m3u in phonon (Qt)

Hi Can i get some help to parse .pls / m3u formats in phonon player. So far i know phonon doesn't support playlist. When any playlist is entered in open location it gives an error like codecs text/text-uri not found. ...

Qt - How to specify and make constant an element size in a layout?

Say there is a QHBoxLayout and some widgets in it. How to specify a widget width and hight in the layout, so that while resizing the widget which containes the layout the given width and hight stay constant? ...

HowTo find Subitem in QAbstractItemModel and QTreeView class?

Hello. Question: how to find sub item, in a QTreeView loaded QAbstractItemModel model with model->match() method? Problem: model->match() can't find sub items, wtf?! Here is the example: As you can see from the picture, I'm trying to expand Layouts sub item with this code: void Dialog::restoreState(void) { // get list QSet...

Why it is not possible to animate the "maximumWidth" parameter of the QWidget?

I wanted to animate the QWidget maximumWidth in order to change thd widgets size in a layout with animation, but it does not work. I have tried to do the following: QPropertyAnimation *animation1 = new QPropertyAnimation(m_textEditor2, "maximumWidth"); animation1->setStartValue(0); animation1->setEndValue(100); animation1->start(); ED...

how to use QT graphic view for drawing

hello im trying to use the graphic veiw of QT to draw lines it's possible to draw a multiple objects in the scene but is it possible to do a (real time lines ) drawing inside the Qt scene , and how ? a sample code would be highly appreciated thanks in advance ...