qt4

Qt - Dynamic list stuff

I'm fairly new to Qt4.5, and I'm unsure of the approach I should take to the following problem. I'm trying to create a QListWidget style widget, that can dynamically expand to an arbitrary length, probably no more than 300 elements. I tried to use the QListWidget, but I need to store three QStrings per line, and QListWidget is fairly l...

How can I disable clear of clipboard on exit of PyQt4 application?

I have a simple PyQt4 application (see the code below) that reveals next problem: if I select the text from QLineEdit and copy it to clipboard then I can paste it to another application only while my application is running. It seems that on exit PyQt application clears the clipboard so I can't paste the text after the application is clos...

Qt Application: Simulating modal behaviour (enable/disable user input)

I am currently working on an application that launches separate processes which display additional dialogs. The feature I am trying to implement is simulating modal behavior of these dialogs. More specifically, I need the application to stop processing all input, both mouse and keyboard, when the dialog is launched, and resume when it's ...

Show other data in QTableView with QItemDelegate

I have a QTableView connected with an QSqlTableModel. In the first column, there are only dates at this format: 2010-01-02 I want this column to show the date at this format (but without changing the real data): 02.01.2010 I know that I have to create an QItemDelegate for this column, but I don't know how I can read the existing data and...

Qt Animation: Appearing & Disappearing Objects

I'm writing a video annotation application with Qt4 in which users need to be able to seek to various points in a video, putting markers on various objects and then setting keypoints for those markers so that they stay on the objects in the video as they move around. QGraphicsItemAnimation seems like a great place to start for these mar...

QT4: Is it possible to make a QListView scroll smoothly?

I have a QListView in Icon mode with lots of icons, so that a scrollbar appears, but the scrolling is not smooth and this IMHO confuses the user since it jumps abruptly from one point to another at each scroll. I would like to make the scrolling smooth but I didn't find anything in the docs. Is it possible? ...

Differing DPI [font sizes] in QWebView compared to all other QWidgets?

Hello, I have a QWebView which displays some HTML content and I used CSS to style the text: body { font-size: 10pt; } The window with the QWebView also has a QTextEdit field, for which I have set the font like this: QFont newFont; newfont.setPointSize(10); myEditField->setFont(newFont); Unfortunately, the text displayed in the QWe...

Qt, VS2005, Qwt - Can't use Q_OBJECT in class derived from Qwt widgets

We've compiled QT 4.6 and QWT 5.2.0 for VS2005. We're trying to derive a class from QwtDial, and the derived class has slots. So, we need to add the Q_OBJECT macro. However, when we do that, the linker chokes out this error: error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtDial::staticMetaObject" ...

How can I simulate user interaction (key press event) in QT?

I need to simulate "Enter" key event in QT. How can I do this? ...

I just installed QT for Windows but I can't find the control toolbox anywhere. Where do I drag controls to a form?

I opened a starter application to see how it works but I only see C++ files, nothing in Python. How can I configure QT to work for Python? :S Also, where can I find the visual form? ...

PyQt4 signals and slots

Hello, I am writing my first Python app with PyQt4. I have a MainWindow and a Dialog class, which is a part of MainWindow class: self.loginDialog = LoginDialog(); I use slots and signals. Here's a connection made in MainWindow: QtCore.QObject.connect(self.loginDialog, QtCore.SIGNAL("aa(str)"), self.login) And I try to emit signal ...

Prevent a QMenu from closing when one of its QAction is triggered

Hi, I'm using a QMenu as context menu. This menu is filled with QActions. One of these QActions is checkable, and I'd like to be able to check/uncheck it without closing the context menu (and having to re-open it again to choose the option that I want). I've tried disconnecting the signals emitted by the checkable QAction with no luck....

PyQt4 Drag & Drop

Hi fellows! Qt4 has support for Drag & Drop actions and I've used them like in the tutorial. Now I want to be able to drag external elements (files) into the GUI form and perform actions based on that (like get the full path and copy it somewhere). I'm not sure whether this is a limitation like something Qt cannot do. Does someone kno...

playing an audio file in Qt 4.4 in windows XP

Hi I tried to play a audio file in Qt 4.4 in windows XP using phonon classes (MediaObject,MediaSource,AudioOutput). The code gets compiled and ran but the audio file is not playing. I enabled the phonon support and setup the backend as well. Someone can please help me with this. i attached my code also for reference. Also i dont want to...

How to intercept ALL signals emitted by a given event in QT?

I can imagine that there might be quite a few of them depending on the event, but at the same time, I guess this can be a best way to debug, and an interesting lesson. Why would I need it? I'm using some custom class based on the QWidget, which does not expand when I de-attach a QDockWidget based in the same window. Knowing what signals...

emit Qt signal from non Qt Thread or ouside Qt main event loop with at 4.5

Hi, I'm calling a "emit signal1()" from a non Qt thread. By non Qt thread I mean not from the GUI Event Loop and not from any QThread run() method or any QThread own event loop. It is simply a pthread (pthread_create()) that calls a method of a QObject which emits signals. ex: MyQbject: public QObject { ... void emitBunchOfSignals() ...

QProgressbar and QNetworkReply signals

Hello, i'm writing an application in C++ with the Qt Framework. It should download a File over http and display the download progress with a QProgressbar - but I don't get that part to work! Sample code: QProgressBar* pbar = new QProgressBar(); //calls the website and returns the QNetworkReply* QNetworkReply* downloader = Downloader->...

Segmentation fault in Qt Designer 4.6 with custom widget

Hi, I had a segmentation fault when using my new Qt Widget with Qt Designer 4.6. The problem arise when trying to preview the new widget. when using gdb I found that the problem is in qdesigner_internal::WidgetFactory::applyStyleToTopLevel: Program received signal SIGSEGV, Segmentation fault. qdesigner_internal::WidgetFactory::apply...

Simplest build of QMYSQL3

What is simplest way to build the QMYSQL3 driver with the full 4.6 SDK (2009.05) installed? Does the resulting DLL require a manual copy in order for the SDK to use it? ...

QT QImage pixel manipulation

Hi, I am building a QT GUI application and use QImage for opening images. My problem is that I can't figure out how to use QImage's bit() and scanline() methods to get access at per pixel level. I've seen this post http://stackoverflow.com/questions/857962/qt-qimage-pixel-manipulation-problems but this is only for the first pixel of ea...