qt

Subsequent insertion of records with QSqlTableRecord fail after first error

Hi, I have a problem with inserting data into SQLite database using QSqlTableModel. The table is created like this: QSqlQuery createTblSMS("CREATE TABLE sms_tbl(" "isRead BOOLEAN NOT NULL," "readTime DATETIME," "arrivalTime DATETIME NOT NULL," "sender TEXT NOT NULL," "receiver TEXT NOT NULL," ...

Qt - Real time drawing

Hi, I want to show a car's path in a window in real time, how to do that, and what classes I have to use. Is there anything like drawing area, in Qt. Any Help will be appreciated. ...

My QT static builds run out of memory on other systems

When I build my application statically, it comes out to just over 5Mb, so it's a small, simple program. However, any system that has under 3Gb of ram can't run the program, saying there's not enough memory. There is nothing very memory intensive in the program, and I did nothing to allocate memory specifically. Any thoughts on whats caus...

Add a define to qmake WITH a value?

How do I add a define with qmake WITH a value: For example, this does not work (as I expected) in my .pro file: DEFINES += WINVER 0x0500 nor DEFINES += "WINVER 0x0500" How do I define WINVER as 0x0500 before anything starts compiling so it's definition is not affected in any way by compilation or include order? ...

Qt Visual Studio Add-In Problems

Hi, I am using Qt 4.6.2 with the latest version of the Visual Studio Add-In(1.1.5) with Visual Studio 2005 Professional. I am finding that whenever I restart Visual Studio or switch build targets(I am building Win32 & x64, Debug/Release builds) all of my moc, uic & rcc files will be regenerated even when the .h/.ui/.qrc files have not ...

Preferred way to handle UTC/local time in Qt's QDateTime?

I have some code where I write a QDateTime to a file... someQDateTime.toUTC().toString(Qt::ISODate) and when I read it back using QDateTime::fromString(), I get the time interpreted as being in the system's time zone. I can manually append "Z" to the string when I write it out, or use setTimeSpec() after I read it, and then everything...

how to sort durations with Qt?

i'm trying to make QSortFilterProxyModel sort items by duration. preconditions: hours and minutes must not have leading zeros if duration is less than an hour, then hours must not be displayed, but only minutes and seconds if duration is less than a minute, then 0 minutes and the corresponding number of seconds must be displayed [0:42...

va_list create dynamically.

All: I have faced such a problem. I have a function void foo(int cnt, va_list ap); I need to use it, and but requirement is quite strict, number of va_list vary and it will change during run-time. What I would like to do is: create a va_list (which expects char*) form QList<Contact*> where Contact is a defined class class Cont...

Help Integration in Qt/C++ Application

Hi, I am using Qt 4.6 so do C++. I have a User Manual (.chm) for my application which has the help required for the users to run the application. Now I want this help to be integrated into my application, so that when the user selects for help from the application, the user manual will be opened with the corresponding help page displ...

Where to find Qt's commits?

Hello, There's a regression in Qt 4.6.2 on Windows (setting border color from stylesheet does not work) that I decided to fix myself. This bug was originally reported in Qt 4.4, and was fixed in Qt 4.5, around December 2008. Unfortunately I cannot find the corresponding commit in http://qt.gitorious.org/, probably because the commit is...

How to make Qt widgets do not react on mouse click

I need on my form ordinary widgets (e.g. buttons) do not react on mouse clicks but NOT to be disabled (it change look to grayed one -- not good). I wonder is there some neat small hack for this? ...

With QT, is there a way to specify different UI layouts for different UI styles?

I've got a cross platform Qt app, and no matter how I tweak the UI, it always looks good on some platforms and bad on others, due to the differences between UI styles. For example, margins seem to be universally set, even while the underlying elements shift in size dramatically from one platform to another. What's the recommended way t...

Can the QPropertyAnimation update interval be increased for ultra-smooth animation?

The new Animation Framework in Qt 4.6+ is based on QTimeLine which has 'void setUpdateInterval(int interval)' public function. Based on QTimeLine as well, QGraphicsItemAnimation could access this function, but the new animation framework classes (e.g. QPropertyAnimation) can't! Is the animation framework locked to the about 60 updates pe...

Aspect Orientated Programming in Qt

I'm trying to get my head around AOP and some Qt Code would really help. From wikipedia here is some sample code (easy for a Qt/C++ programmer to read): void transfer(Account fromAcc, Account toAcc, int amount, User user, Logger logger) throws Exception { logger.info("transferring money..."); if (! checkUserPermission(user)){ ...

Console output in a Qt GUI app?

I have a Qt GUI application running on Windows that allows command-line options to be passed and under some circumstances I want to output a message to the console and then quit, for example: int main(int argc, char *argv[]) { QApplication a(argc, argv); if (someCommandLineParam) { std::cout << "Hello, world!"; return 0; ...

QT app i made exited with code -1073741515

Hello , I have coded a program in QTcreator on linux and when i tried to port it to windows. Program compiles without any errors. But when i run the program it exits automatically Starting C:\Projects\LIG\debug\LIGenerator.exe... C:\Projects\LIG\debug\LIGenerator.exe exited with code -1073741515 I tried to debug it using QT creator d...

QT and SQLITE problem during building

Hi, I'm developing a simple application to use sqlite, the problem is that the following code /* ... */ QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName("hellogoodbye"); if (!db.open()) { QMessageBox::critical(0, qApp->tr("Impossibile aprire il database"), qApp->tr("Non ...

How can I access the data from javascript by Qt?

I used webview to show the webpage, view->setUrl(QUrl("C:\\Qt\\2010.07\\qt\\serbest\\googleSearch.htm")); in the HTML code I put some ajax code googleSearch. After I execute the program, the webview runs and there are results (pages links). When I clicked any of the links they do not open. So what do I do to open the links I clicked...

Qt QTableView how to have a checkbox only column

We are using a QTableView with Qt 4.6.3, and need a column that only has a checkbox in each cell. We're using a custom subclass of QAbstractTableModel as the model for the QTableView. Right now, we have a checkbox by setting the Qt::ItemIsUserCheckable flag. But we can't figure out how to get rid of the blank textbox next to the check...

Qt Creator, LGPL, and the Nokia N900

I am interested in creating closed source applications for my Nokia N900 using Qt Creator and the LGPL License, but I'm unfamiliar with how exactly I'm able to do this. I understand that I should use dynamic links vs static links when creating my application, but I'm not certain how this is done when using Qt Creator. I'm under the impre...