qt4

QT4 designer doesnot accept '&' reference and ' ' space character in signal/slot editor

QT4 designer doesnot accept '&' reference and ' ' space character in signal/slot editor? As XML schema also doesn't support it ... is there any way to create a custom slot like onClickMyCustorSlot(const QStringList &) using QT4 designer or editing th ui-xml -Himadri Sekhar ...

Floating/Embedded QDockWidget in a QWidget (KXmlGuiWindow's CentralWidget designed in QT Designer)

I'm just trying to get into QT (and KDE) program, and have hit a snag trying to add a floatable, draggable QDockWidget to the .ui file (based as a QWidget) that is embedded into my KDE 4 program. This is all from the basic template provided by KDevelop 4, so while I understand what's going on, I just don't know the best way to change it...

QThread to send large queries to the database

Hi! I have created this class that inherits from QThread for send data to the database server, what do you think about it? Could be impreved? Thanks #ifndef QUERYTHREAD_H #define QUERYTHREAD_H #include class QSqlQuery; class QueryThread : public QThread { public slots: bool exec(QSqlQuery *query, Priority priority=Inherit...

How to convert QT Qimage to java awt Buffered Image?

I am trying to convert java qt QImage to BufferedImage using the following code, but it does't work QImage image = map.toImage(); byte buf[] = image.copyOfBytes(); InputStream in = new ByteArrayInputStream(buf); try { BufferedImage img = javax.imageio.ImageIO.read(in); File file = new File("newimage.bmp"...

PyQt: No such slot

I am starting to learn Qt4 and Python, following along some tutorial i found on the interwebs. I have the following two files: lcdrange.py: from PyQt4 import QtGui, QtCore class LCDRange(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) lcd = QtGui.QLCDNu...

Hiding row labels

I'm using Qt4 to create a table, using the QTableWidget class. I get something like this: Problem is: I want to hide the row labels (i.e. the numbers). I just care about columns. I want to get this: How can I accomplish this? ...

Programatically moving through a ListView in Qt (Ruby)

I'm making a small file-browser for my own use, in Ruby, and using Qt for the view. The idea is that it'll end up on my TV, where I can use the remote to move up and down and launch files. Everything works fine, until I'm going to move the selection using the remote. I managed to set up a D-Bus service, so I'll just call the methods us...

PyQt4: Databinding?

Coming from the .NET world over to Python and PyQt4. Was wondering if anyone is familiar with any functionality that would allow me to bind data to Qt widgets? For example (using sqlalchemy for data): gems = session.query(Gem).all() list = QListWidget() list.datasource = gems Is such a thing possible? ...

QListView clicked mouse button

Hi, I need to know what was the mouse button clicked when a QListView::clicked signal is emitted. How can I know the button. Regards ...

Using PyQT, how do you filter mousePressEvent for a QComboBox with custom list

I've got a QComboBox with a custom list object. Please see Screen shot The custom list object has a custom mousePressEvent so that when the user click on one of the circles with a +/- (a twisty), the list is expanded/collapsed. When I use the list with the combo box, when the user clicks on a twisty, the list is expanded/collapsed, ...

Convert a QVariant of a custom type to a QString.

I have a custom class called Money that I have declared with Q_DECLARE_METATYPE(). class Money { public: Money(double d) { _value = d; } ~Money() {} QString toString() const { return QString(_value); } private: double _value; }; Q_DECLARE_METATYPE(Money); Money m(23.32); I store that in a QVariant and I want to co...

how to force Qt widget to maintain equal height and width?

Hi all, I'm using Ruby Qt bindings. I'm trying to make a square widget (checker board), but it doesn't seem to work. This is the code that I tried What is the proper way to making a widget that maintains it's aspect ratio? ...

Dragging an item from a QTableView/QSqlTableModel

I want to be able to drag an item (actually a whole row) from a QTableView that has a QSqlTableModel as it's model. QSqlTableModel::flags(const QModelIndex &index) doesn't return Qt::ItemIsDragEnabled. Does that mean the only way I can get this to work is if I subclass QSqlTableModel and reimplement the flags() method? Thats seems like...

QSortFilterProxyModel.mapToSource crashes. No info why.

I have the following code: proxy_index = self.log_list.filter_proxy_model.createIndex(index, COL_REV) model_index = self.log_list.filter_proxy_model.mapToSource(proxy_index) revno = self.log_list.model.data(model_index,QtCore.Qt.DisplayRole) self.setEditText(revno.toString()) The code crashed on the second line. There is no exception ...

How do I send and receive broadcast messages using QT 4.5 and Linux?

Hi. I'm new to QT programming. Could anyone explain how I can send broadcast messages given a network adapter and its IP address? I also don't know how to receive datagrams using QT. Could anyone please help? ...

how to use default icons with qt

I'm using only Qt (though PyQt) and I don't get icons when I call e.g. QMessageBox.warning(). Is there a way to use the platform's default icons? Currently I'm using the more complete QMessageBox constructor and calling setIconPixmap. ...

Video capture on MacOS

Hi to all I'm wrtiting a C++ application with Trolltech QT Library and I need to capture video stream from a camera and some medical instrumentations. What kind of hardware can I use to do this? I've tried with OpenCV but it doesn't recognize my EyeTV 250. Can I use Pinnacle Video capture for Mac? thanks, Andrea ...

What`s wrong with qt 4.5.0 integration with Visual Studio 2008?

I downloaded and installed qt evaluation for vs2008 and expect it to be integrated with VS, but it is not. It is trial 30 days commercial license. What`s wrong with it or may be I got it wrong? ...

How to make a resizeable rectangle selection tool?

I'm trying to write a very simple photo editor using C# 2008 or QT4. How to make a resizeable rectangle selection tool like the photoshop did? ...

How do I use gdbmacros.cpp in QtCreator?

I'm trying to debug in QtCreator on Linux and I get the message: The debugged binary does not contain information needed for nice display of Qt data types. You might want to try including the file .../share/qtcreator/gdbmacros/gdbmacros.cpp into your project directly. Adding ~/qtcreator/gdbmacros/gdbmacros.cpp to my ...