qt4

getOpenFileNames dialog is not centered to the main window.

Why the opened dialog is not centered to the main window? void MainWindow::on_FileOpenAction_triggered() { QStringList fileNames = QFileDialog::getOpenFileNames( this, "Open Image", QApplication::applicationDirPath(), "Images (*.jpg);;All Files (*.*)" ); } The documentation says that is should...

Blocked waiting for a asynchronous Qt signal

Hello! I know, there are some similar questions to the following out there, but I couldn't find a concrete answer that helps me. So here's my problem: I work on an application that does some gui-initialisations on start up. One of the things I have to do, is calling NetworkConfigurationManager::updateConfigurations () This is a asyn...

Setting a plain background color for a QGraphicsView widget

I'm trying to display a little square of solid color. I've created a QGraphicsView widget myGraphicsView and call: ui->myGraphicsView->setBackgroundBrush(QBrush(Qt::red, Qt::SolidPattern)); But it stays white. What am I doing wrong? ...

Only one row of ListView populated in QML app, any idea why?

Hi, I'm trying to create a simple QML application that will get an RSS feed with my active chess games and do stuff with it. At this point I am just trying to populate a list view with the feed contents, but it only shows one item even when there should be 11 items in the feed. Is this a bug or am I not getting something right? Here's ...

QList acting strange

Hi! I don't have much experience with Qt but somehow I think this is acting strange. Compiled with VS2005: class Entry { public: Entry(const QString& aName, bool checked) : name(aName), isChecked(checked) { // empty }; public: Entry(const Entry& entry) : name(entry.name), isChecked(entry...

QFile open file on a shared drive

I have the following: Q_ASSERT(QFile::exists("\\.host\Shared Folders\username On My Mac\Desktop\New Deck.txt")); The file is picked from QFileDialog but when check if it exists with QFile::exists it returns FALSE; Is there any reason why QT cannot open a file on a shared drive. Btw, this path is a valid one on Windows and is generat...

How to set accessible name of QActions contained in a QMenu

Hi, I'm trying to set the accessible properties of a QMenu's sub items. I can set the accessible property of the parent menu using setAccessibleName() since it inherits QWidget. Unfortunately, the QActions that you add to the menu aren't widgets child classes, they inherit QObject directly. Is there a way to set the menu items accessi...

Qt Application Blocking System Shutdown

Hi, I have a Qt 4.6.2 application, running on a Windows XP SP2 x64 system. When I press the physical power/shutdown button on the system, when my application is running nothing will happen, the app will not close and the system does not Shutdown. If I go to start menu and click shutdown, then my application will close but the system w...

OS X transparent panels in Qt?

Is there a way to create a transparent panel as described by the Apple Human Interface Guidelines in Qt 4.6 (built for OS X 10.6/Cocoa)? If not, are there any alternatives similar in look and function? I understand that Qt is a cross platform toolkit, but I want my application to feel as »native« as possible… ...

QT Open default file explorer on *nix

I have the following: QProcess *process = new QProcess(this); QString path = QDir::toNativeSeparators(QApplication::applicationPath); #if defined(Q_OS_WIN) process->start("explorer.exe", QStringList() << path); #elif defined(Q_OS_MAC) process->start("open", QStringList() << path); #endif How I can achieve the same behavior for le...

Baffling gcc complaint about usage of Qt4 setValidator

We're stumped as to why gcc complains about this line in our app: doubleFrom->setValidator(new QDoubleValidator(doubleFrom)); with these complaints: error: expected type-specifier before 'QDoubleValidator' error: expected `)' before 'QDoubleValidator' error: no matching function for call to 'QLineEdit::setValidator(int*)' candidates ...

Targeting Qt child widget with gstreamer

I have a gstreamer pipeline which ends with a xvimagesink element. To have the video displayed in a particular window, I can use the x_oerlay_interface : gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvsink), winid); So far, so good. However, it only works if winid is the idea of a top level window, which is not the case of child widget....

QT widget alignment problem

I've created a form with code and I have a big problem. Every element aligmented to the bottom. I painted the clear and aligned space blue on the picture. How can I set every alignment to top? If you need the code in this question you'll find it: http://stackoverflow.com/questions/3574147/qt-heap-memory-corruption ...

How to use Model for QCombobox

Hi guys I want to use QCombobox as a the Combobox of Swing in Java. So i need to use Model for holding my object. How can i hold my object in QCombobox. (I think that I should hold data in Model because QCombobox was designed according to MVC Pattern ... ) Any help will be appreciated. ...

How to pass data from a QDialog?

In Qt, what is the most elegant way to pass data from a QDialog subclass to the component that started the dialog in the cases where you need to pass down something more complex than a boolean or an integer return code? I'm thinking emit a custom signal from the accept() slot but is there something else? ...

Programatically scroll QScrollArea

I have a Widget with QScrollArea in it and I want it to be scrolled down right after the widget containing it is shown. I tried: scrollArea->ensureVisible(0,100, 20, 20); It works only when invoked by user (pushing button for example). Putting it in widget contstructor or showEvent doesn't work. Can it be done automatically? ...

How to minimize application in qt

Hi all! How can I minimize my application by clicking on some button in the application on Windows Mobile and Symbian platforms under QT. Thanks in advance! ...

What are some good tutorials/books to get me started to QT programing?

I'd like to develop a Linux(here mainly KDE)/Win/Mac application using QT. The thing is this would be my first contact with QT framework, so can you please recommend some good tutorials/books for a newibie to get started with QT? ...

How to draw a QPoint on a QGraphicsView/Scene

It's really not clear to me how to simply draw a 2d point in QT. I want it to overlay a QPixmap item, but every piece of documentation I find talks about drawing polygons with brushes. Thanks in advance - ...

Using Qt Solution (Qt Service) with FOSS.

I am creating a piece of FOSS to handle all the extra buttons ony my keyboard (through g15daemon). As part of this, I wish to create a daemon to handle parsing events. I am planning on using the Qt Service solution provided by Qt. My question is: should these files be included with the project or handled seperately? Since the Qt-Servic...