qt4

A good ORM to use with qt4 (c++) ? (Django like...)

Does anyone have a recommendation for an ORM for qt4 (c++)? (Like a Django ORM). ...

Can't build full html table in QTextEdit with std::for_each...

Hi. Here is my code function: void ReportHistory::update(void) { ui.output->clear(); ui.output->setCurrentFont(QFont("Arial", 8, QFont::Normal)); QString title = "My Title"; QStringList headers = QString("Header1,Header2,Header3,Header4,Header5,Header6").split(","); QString html = QString( "<html>" \ "<head>" \ "<meta Cont...

Where to put app's code on a QT app?

I'm starting with QT4, I'm wondering where to put my application code. Here? void MainWindow::changeEvent(QEvent *e) {...} Or here? (where exactly?)int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } If I want my app not only react to user events, but to execute reg...

Eclipse/RCP (SWT) vs Qt Creator (Qt) as a framework for plug-in development?

I have known many good applications (including UG Team Center, IBM Lotus Expeditor etc.,) developed over Eclipse (RCP Framework). Of late, i find some application developed over Qt Creator exploiting its plug-in architecture (GCF, VTK designer etc.,). I wish to know the pros and cons of Eclipse and Qt Creator as base framework for deve...

How to produce Capital hexadecimal digits with QString::arg() ? [QT]

Hi, I'm trying to create a QString which is a hexadecimal number with its letter digits in Capitals instead of small caps, how can it be done? QString( " %1" ).arg( 15, 1, 16 ) yields f and I'd like F ...

Multi-dialog program in PyQT will not close (the sequel!)

Hello everyone. I have another problem with PyQT, this time I have an example that will be far more useful since it contains part of my code (defanged of course!) I have a hard time figuring out how to close the 'PROGRAM SELECT' dialog window by only using the 'LOGOUT' button. I could simply use the close button on the form, but I wan...

Database migrations with Qt4 (schema changes)

From Ruby on Rails I've learned about a comfortable and very manageable way to do database migrations. How would one handle such cases in Qt4? It does not need to be that elaborated as Rails' solution. I'd be fine with running SQL and code snippets to go up or down the version list of my data. I googled a little bit but there seems to ...

QTableView sorting signal?

I use QTableView + QStandardItemModel to show some data (data stored in some other data structure), and this table view is sortable. Since it is sortable, when sorting this model, I also need to sort the order of stored data. I try to implement a slot for the sorting signal, but I don't know what signal is emitted when clicking the head...

QT C++ Passing Widgets to function

Hi I am trying to write a simple function where I load a text file to a QComboBox, I am very new to QT and C++. Here is what i have right now: void frmVerification::openTextFile(QComboBox* qCombo, string filename) { using namespace std; string line; ifstream myfile(filename.c_str()); if (myfile.is_open()) { whi...

(C++)Code:: blocks does not recognize QT4 classes

So far I have worked in the console and a few days ago decided to try the QT GUI. I downloaded the QT SDK , install it, adjust the location of QT and set up the PATH Environment Variable -> per the instructions on the site. I opened a new Qt4 project in Code:: Blocks-in and it seemed that everything was OK. There is by default an exampl...

How to tell the mouse button using QApplication::mouseButtons() in a "click" slot??

I have a QMainWindow, and want to handle the "clicked" signal from a smaller widget (such as tableview) inside it. Originally I connect the signal to a slot of this QMainWindow, this is the most common approach. Now I need to tell which mouse button is clicked, and do different things for left and right button, I found that the "clicke...

Qt QVariantAnimation instantiation runtime crash; symbol lookup error: undefined symbol: QVariantAnimation QObject

I'm getting this weird runtime crash when instantiating QVAriantAnimation or QPropertyAnimation. It appears this happens when the program doesn't link appropriately the class. But I have double checked my simple project and can't see anything wrong. #include <QtCore/QVariantAnimation> #include <QtCore/QEasingCurve> class MyAnimacion : ...

What's the standard way of trapping system messages in Qt4?

I've been looking for a way to trap and retrieve system messages in Qt4, specifically the WM_DEVICECHANGE messages among others. I know how to in C# but can find any conclusive text on how to in Qt4. Thanks in advance.. ...

How to manually configure Qt in Eclipse for existing C++ project.

I know this sounds like a stupid question but for some reason the way I'm doing it keeps giving me crashes with "symbol lookup error"/"undefined symbol". This is what crashes: #include <QVariantAnimation> #include <QDebug> class MyAnimacion : public QVariantAnimation { public: MyAnimacion() : QVariantAnimation() {} ~MyAnimacio...

(C++)Code::Blocks possible wrong setup for Qt4

OS : windows xp SP2 , compiler : Code::Blocks ver. 10.05 , Qt 4.6 I recently started to learn Qt. At first all went well with simple tut examples. I soon came across an example that can not compile and and realized that something is wrong. Here is the code : #include <QWidget> #include <QApplication> #include <QPushButton> #include ...

How to print QGraphicsTextItem in MFC application

I have used QGraphicsTextItem in my MFC applications for text editing, then converted the results to a bitmap to show in the view (screen). But it has issues when printing. For example, if I print to a PDF file, the text is not scalable since it is a bitmap and the file size is also big. How can I print the QGraphicsTextItem in the MFC ...

setTransformOriginPoint is not applied on a QGraphicsRectItem

Hi, I am trying to apply a transformation on a QGraphicsRectItem I draw on a scene. I need to modify the origin point for these transformations so I run the setTransformOriginPoint with the new center as argument. My problem is: the origin point for transformations is not changed. Is there something I forgot ? ...

Qt Designer - How to get a widget to span columns?

I created a simple form. I added a PushButton in the bottom right, and then a TabWidget above that. I highlighted the main window, and chose Grid Layout. The PushButton was stretched, so I added a spacer to the left of it. Now, my Tab Widget only occupies the left most column. I want it to span into Column1 as well. I looked through eve...

Signal - Slot connection inside loop

In my code I am creating new objects of same type inside loop and connecting a signal to object slot. Here is my trial. A * a; QList<A *> aList; int aCounter = 0; while(aCounter < 2) { a = new A; aList.push_back(a); connect(this,SIGNAL(somethingHappened()),aList[aCounter],SLOT(doSometing())); aCounter++; } When somethingH...

Reduce a table view's cell padding or margin

I'm using a Table View. I'd like to remove the cell padding (or margin) so I can squeeze more cells in less space. How can this be achieved? The cells size is set to 32 pixels on QT designer, if I set it smaller, the cells contents don't show and an ellipsis appears. (...) ...