qt

How do I develop a plug-in for QtWebKit?

I am trying to develop a plug-in for QtWebkit. But I am not able to find how to develop a plugin for QtWebKit, hopefully one that can be invoked by JavaScript. Does anyone know of any tutorials or documents that explain how to do this? Webkit has been intregated into Qt and this integrated package is called QtWebkit. They have provided...

embedding an application (in this case a terminal) within a QT application

Hello folks, I am writing a QT application and I need to embed a terminal (we say,xterm) within a QDialog, like some KDE application (see kdevelop/kate/...). I've been trying with: - QX11EmbedContainer placed into the QLayout of my QDialog - QProcess for the program I want to excecute I expect the QProcess running within the QX11Emb...

How to combine GUI applications in Windows

I have a Windows GUI application that's using the QT framework (currently version 3.3.5, might change to QT4). I want to combine other Windows GUI applications in the main application. I can't use the widgets directly in the main application due to several constrains which I can't control. The final layout should look like this: Curr...

Re-attatching an X server view of a lost process.

Hello. I'm running Xorg and my (Qt) program daemonises itself. Now I log out and restart the X server. When I log in again my process is still running fine, but I can't see it. Is there a way of attatching the new incarnation of the X server to the old process? If I don't restart the whole server, but log out and in again, is there a wa...

Using the QMDIArea with qt4.4

Hi I'm using the QMdiArea in qt4.4. What I'm doing: If a new project is created, I add a number of subwindows to a QMdiArea. And I'd like to disallow the user to close a subwindow during the runtime. The subwindows should be closed, if the hole application is closed or if a new project is created. As I have seen in the qt-documentaion,...

I can't connect KAction to slot on KMainWindow

I have a KMainWindow: //file.h class MainWindow: public KMainWindow { public: MainWindow(QWidget *parent = 0); ... ... ... private slots: void removeClick(); //file.cpp MainWindow::MainWindow(QWidget *parent) : KMainWindow(parent) {} void MainWindow::removeClick() { std::cout << "Remove" << std::endl; } I can c...

Profiling QT application that uses plugins

I have a medium sized application written in c++ using QT. I wanted to profile things to see where my least performant code was so I compiled everything with -pg. However, my application makes use of a lot of plugins using the QTPlugin mechanism (boils down to a dlopen and a dlsym of a instance object per plugin). I've noticed that gpro...

C++/Qt vs Adobe AIR

I have to choose a platform for our product. I have to decide between The Qt Framework and Adobe's AIR. I am well versed with Qt as I have worked for the last two years. I looked up at the Adobe's site but all the info about flex, flash, ability to coding in HTML/ActionScript is overwhelming and confusing. I cannot understand the followi...

Multiple QMainWindow instances?

Hi all, The QMainWindow is the main window in a Qt application. So usually you'd have only one, but would it be possible at all to have multiple QMainWindow instances in your application? I am working on integrating a Qt-based GUI application B into another Qt-based GUI application A. Both these applications have a QMainWindow, and I ...

When a Qt widget gets focus

I'm a new in Qt Designer 4.4.1 Open Source Edition. I used to program in Windows Borland C++ Builder and I've switched to Linux. I do not know how to gain the control when a widget (a LineEdit in the specific case) gains the focus, no mater if by tab or by clicking or by any other medium. My Focus Policy to the widget is "strongFocus", ...

QAbstractTableModel inheritance vtable problem

Here's another problem with qt: I extend a QAbstractTableModel, but I get a compiling error ( I'm using cmake) // file.h #ifndef TABLEMODEL_H #define TABLEMODEL_H #include <QAbstractTableModel> class TableModel : public QAbstractTableModel { Q_OBJECT public: TableModel(QObject *parent = 0); int rowCount(const QModelIndex &parent = QM...

How to know a QTreeWidget selected item?

I have a class that inherits by QTreeWidget, how can I know the actually selected row? I explain, usually we connect signals to slots by this way: connect(myButton, SIGNAL(triggered(bool)), this, SLOT(myClick())); I can't find nothing to similar for QTreeWidget->QTreeWidgetItem. The only way I found is this: redefining the mousePressE...

64-bit Qt and Postgres plugin in Windows

I have a 32-bit Windows/Qt application using Postgres plugin. Recently, I've been intrigued to turn the app into a 64-bit app. So I checked the Qt docs for instructions, built Qt and its libraries into 64-bit successfully. Now the problem is Postgres does not provide libraries for 64-bit Windows! Obviously, the Qt Postgres plugin won't c...

How to insert a null value with Qt?

Hello everybody! Tip me plase, how to insert a null value into table using Trolltech Qt 4.x SQL classes? QSqlQuery, I guess, or something else from QtNetwork. As analog of it, in .NET there is the System.DbNull class, which represents sql NULL. And what type should I use for some object's property, that can hold both null-value and QSt...

Building 32-bit Qt Mysql plugin fails with MinGw

I'm building a MySQL plugin for Qt 4.4.3 Open Source Edition (Qt documentation), and using command: cd %QTDIR%\src\plugins\sqldrivers\mysql qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro make I manage to build it to my 64-bit Qt just fine using 64-bit MySQL dev files (using...

Qt: set a default cursor for an application

In a Qt application, is there an equivalent to QApplication::setFont that sets the applications default cursor, to be overwritten by setting one on a specific widget? QApplication::setOverrideCursor overrides all widget specific ones, I want local ones to take precidene over this one, but still use my cursor if I didn't specify one. t...

Plugin API design

So I have an application that is based heavily on the QT API which using the QPlugin system. It's fairly simple to use, you define a class which inherit from an Interface and when the plugin is loaded you get an instance of that class. In the end it'll boil down to a dlopen/dlsym or LoadLibrary/GetProcAddress, whatever is appropriate for...

Signal and slott connection in .ui

Hi, I have started to play a little with Qt 4. And then I have come across a problem with the Qt Designer. In the Signal/Slots editor I can only setup the connections that is listed there, and not all the slots is listed. If I try to add it manualy in the .ui file, the connection would not work. If I add it in the ui_*.h file it workes f...

undo redo with an auto delete mechanism

My application is developped in C++ using Qt and is using signals and slots. Let's say I have the following classes (pseudo-C++ code) : class Ball { Color m_Color; int m_Size; }; class Player { public: setBall(Ball* pBall) { if (pBall != m_pBall) { Ball* pPreviousBall = m_pBall; ...

How to access to parent widget on qt?

I have an inherited QTreeWidget (called PackList) class and its parent is a KXmlGuiWindow. How can I access to the parent's slots? I've tried getParent()->mySlot() from the QTreeWidget class but I've got error: no matching function for call to 'PackList::mySlot()' Does anybody know the correct way? Thanks ...