qt

Is there an easy way to customize a QProgressBar?

I would like to have a QProgressBar that ends with a dot ( that has a bigger width than the width of the line ). What do I have to override, or what property/attribute would I have to set to achieve this effect ? EDIT : here is a pic of how I would like it to look like : Where would I have to start? What should I do? ...

qt trouble overriding paintEvent

I'm subclassing QProgressBar in a custom widget, and I overwrote the paintEvent method with the following code : void myProg::paintEvent(QPaintEvent *pe) { QProgressBar::paintEvent(pe); QRect region = pe->rect(); QPainter *painter = new QPainter(this); QPen *pen = new QPen; painter->begin(this); painter->setBrus...

Slow selection in QTreeView, why?

I've recently hit a wall in a project I'm working on which uses PyQt. I have a QTreeView hooked up to a QAbstractItemModel which typically has thousands of nodes in it. So far, it works alright, but I realized today that selecting a lot of nodes is very slow. After some digging, it turns out that QAbstractItemModel.parent() is called way...

Run a Qt app in a different language?

I'm working on a Qt application that used to be a KDE application. In the old days, I just had to use some syntax like: KDELANG=de ./my_app That ran my_app in German, and only my_app. It might not have been KDELANG, but it was some environment variable like that. I've spent a ridiculous amount of time trying to coax this answer out...

Qpainter.rotate() question - qgis

Hi, I am customising QuantumGIS that uses Qt's Qpainter to draw and paint... I am trying to draw a polyline on the canvas that is coming as a update through message queues..the draw is very fine...but in the polyline or polygon objects that i get as an update also include an angle field that is to be used for rotation of an object. Th...

How do i cause a qtabwidget instance to automatically resize when child tabs are added to it?

I am trying to get the QTabWidget automatically resized to fit the child tab when the child is added but have been unable to do so. I have created a form using Qt Designer and have inherited this using the single inheritance approach as follows. class MyWidget : public QWidget { Q_OBJECT public: MyWidget(QWidget *parent = 0); p...

Qt signals & inheritance question

I am relatively new to programming with Qt and had a question. Short version: How do I inherit signals defined in superclasses? I am trying to subclass someone else's nicely made QTWidgets to change some of the default behavior: //Plot3D is a QWidget that defines a signal "rotationChanged" class matLinePlot : public QObject, public...

How modern is C++ language used in Qt?

I heard Qt API is written in pretty outdated C++ language. Is it true? Are there any plans to make it use more modern C++ language? Are there any official information on this? Are there any projects with the aim to wrap current Qt API constructs with more modern C++? UPDATE That's more to this question than templates and that's not the...

A ListView of checkboxes in PyQt

Hello, I want to display a QListView where each item is a checkbox with some label. The checkboxes should be visible at all times. One way I can think of is using a custom delegate and QAbstractListModel. Are there simpler ways? Can you provide the simplest snippet that does this? Thanks in advance ...

QT: having problems responding on QWebView::linkClicked(QUrl) - slot signal issue

I am preaty new with QT. I want to respond to linkClicked in QWebView... I tried connect like this: QObject::connect(ui->webView,SIGNAL(linkClicked(QUrl)),MainWindow,SLOT(linkClicked(QUrl))); But I was getting error: C:/Documents and Settings/irfan/My Documents/browser1/mainwindow.cpp:9: error: expected primary-expression before ',...

How can I find out when a PyQt-application is idle?

I'd like to know when my application is idle so that I can preload some content. Is there an event or something similar implemented in PyQt? (I could also do it with threads, but this feels like being too complicated.) ...

Mixing Qt with STL and Boost - are there any bridges to make it easy?

Are there any bridges to make mixing Qt with STL and Boost as seamless and easy as possible? This is a followup to Mixing Qt and Boost, where no specific answers how to accomplish this were given. ...

Visual Studio or Eclipse - which one is better for Qt on Windows?

Visual Studio or Eclipse - which IDE is better for Qt on Windows? Taking into account Eclipse is free I'm especially interested in Express version of VS but I'm open to non-free versions if this would allow much better integration with Qt. Before posting you might take a look at similar questions on SO to avoid writing what I've already...

In Qt, how do you properly implement delegates?

I followed the model/view/controller paradigm. I am pretty sure that the model and view are right, but I think I'm doing some things wrong in my delegate. Everything "works", except the first click to a control just "lights up the control" and the second one interacts with it. Is this how delegates are usually implemented? My impleme...

How to disable the up/down buttons within the QDoubleSpinBox

I have a QDoubleSpinBox in QT. I would like to conditionally disable the step up and/or down buttons. I am not sure how to do this. I saw that in the QAbstractSpinBox there is a flag called StepEnabledFlag. But i am not sure how to set that. Can anybody help me out with this. Thanks Arjun ...

For QDoubleSpinBox, can I give an range 0.0<min<max<1.0. If yes how do I get the step buttons to work with it

I am using a QDoubleSpinBox, And during sometime, I have a range where min and max is less than 1 and greater than 0. If I set that range, when I hit the step down the value in the spin box changes to 0.0 and step up would result in 1.0 eventhough they are out of range. I would like to know if there is a particular way to avoid this pro...

Resources on methodologies for testable C++ GUI applications

What resources would you recommend on the subject? What I am looking for is practical advice on the differences of different approaches (MVC, MVP, Presenter First, Humble Dialog), their implementation details (setting it up, passing messages around, connecting) and unit / automated integration testing approaches. My main interest would b...

how can I find out why a custom widget isn't showing up in the Qt Designer?

I created a custom widget by following the instructions provided in Qt Creator's help. I followed everything exactly as they said there. My widget isn't showing up with the other widgets. I even tried their WorldTimeClock example. That doesn't show in the Qt Designer either. How can I debug this? ...

How can I pass the output of a command as a compiler flag through a Qt project file?

Hi, I'm trying to add the output of "git describe" to the about window of my application, so it's easier to find out what version of the application people use. I can do it by adding the following compiler flag: -DAPP_VERSION="$(git describe HEAD)" But since the project is based on qmake, I would like to find a way to put this into th...

How to know when a new USB storage device is connected in Qt?

I want to know when a USB device is connected to the computer that my Qt application is running on (in Windows). In my main QWidget, I've reimplemented winEventFilter like this: bool winEventFilter ( MSG * msg, long * result ) { qDebug() << msg; return false; } I'd expect qDebug to send at least something when I connect a USB ...