qt4

Qt localization: loading the localizable string probelm

Hi, i want to load the localized string in Qt application. for this i am following few steps, correct me if i am wrong. Note: it works fine for QString but not for const char* 1)update the pro file with translation language 2)generate .ts & edit using Qt linguist. Generate .qm file using lupdate and lrelease. 3)load the .qm file from ...

"real time" update a Qt TextView

Hi, I have a Qt application with an embedded script/jit. Now I'd like to receive the output from the script on an QTextEdit (more specific QPlainTextEdit). For this purpose callbacks are being issued. The problem I'm facing is that whatever I try the output to the TextEdit is either delayed until the script has finished or gets stuck af...

How to find active QMainWindow instance ?

Greetings all, In my QT Application I have several QMainWindow instances. I keep track of opended QWindow objects in a Application Context object; At onepoint ,when a Menu item is clicked , I want to go through all this QWindows and check which Window is active and execute some operations. Please refer to following code snippet : //J...

Handling MouseEvents in Qt c++

Hi, Sorry for my beginner's question... What is the easiest way to define procedures, which are executed when MousePressEvent or MouseReleaseEvent occurs? For now I am defining my own class (MyGraphicsView class), which inherits QGraphicsView and I am reimplementing mouse events (which are virtual functions). It works fine but is ther...

Qt Artificial mouse clicks doesnt work properly

Small toy app can be found here: http://gist.github.com/517445 I am trying to send artificial mouse event to widget and I use QApplication::sendEvent for that, next I check ev.isAccepted() and it returns False, even worse! Widget I've sent event to doesnt handle it (it is calendar widged and no date is picked) and I am in doubt that it ...

Create a desktop widget (gadget) with QT 4

How do I create with QT 4 a window that remains anchored to the desktop as a widget ? (Eg like Yahoo Widgets or Google Gadgets). I intend to give the same characteristics of a widget to a normal window: Remove the edges (easy to do) The window must not move (how ?) Must be displayed only when other windows are minimized (how ?) ...

Is it possible to connect with QT to net remoting server?

Hi all. I have server application writed in .net. To connect with this server I'm using net remoting interface. Is it possible to connect to this server application with QT library? ...

How to strip HTML from a text property of a Qt4 widget?

What's the easiest way in terms of coding effort, to change a text property of a Qt4 widget, e.g. QLabel.text, so all HTML tags are removed? The HTML is simple, typically just one to three tags like or and their closing partners. ...

How to optimize PyQt QSortFilterProxyModel filter reimplementation?

I have a reimplemented QSortFilterProxyModel acceptRows to achieve custom behavior, i want it to not filter out items which have a valid child. class KSortFilterProxyModel(QSortFilterProxyModel): #FIXME: Funciona pero es endemoniadamente lento def __init__(self, parent=None): super(KSortFilterProxyModel, self).__init__(parent) s...

How to get a QModelIndex from another QSqlQuery used for searching the database (needed for selecting the found items)

Hi there, I have a problem when dealing with my QSqlQueryModel. I want to search the database for some items and select them in my QTableView with QItemSelectionModel which needs a QModelIndex. What I don't understand is how should I search in order to get the corresponding QModelIndex for my model/view architecture. I can't possibly u...

HowTo get work Microsoft Visual Studio 2010 and Qt Visual Studio Add-in?

Greetings everyone! Question: does any one have a success with combining Microsoft Visual Studio 2010 with Qt Visual Studio Add-in? I have tried to use MSVS2010 with Qt VS Add-in 1.1.5, but no luck. PS: no never mind what exactly arch or OS, I used Win7 x32... Thanks! ...

What is the best way to present a list of images in Qt?

I want to load a number of images into a widget that will show me the images in a list. It can be many images so it needs to be fast, also I'd like to attach a check box for each image presented. What will be the best way to implement it in Qt 4.6? ...

qtmessaging: no such file or directory (Qt-Mobility)

I had a problem while I'm compiling the existing example in Qt-mobility. It's a code example shows how to use messaging API in Qt for symbian. After run the program there was an error occured: Cannot open include file : 'qtmessaging.h': no such file or directory So what to do for use the qtmessaging library? Thanks in advance. ...

How to save QListView items to file

How to save QListView items to text file? ...

Rows never inserted into DB in QSqlRelationalTableModel

I've sublassed QSqlRelationalTableModel for one of the tables in my app. Basically I've added custom header data and custom flags so some columns are non-editable. Also a custom setData() function to reject null primary keys. The table's edit strategy is QSqlTableModel::OnRowChange. My app has a button that inserts a new row when pressed...

How to get a QModelIndex of a row, found by a SELECT-query (QSqlQuery) without modifying the original QSqlQueryModel

Hello, I already asked the question but I was misunderstood, so I try to precicise the problem. I am using a QSqlQueryModel for showing data from a SQLite Database, for the view I use a QTableView. Now I want to implement a "Search/Find/Replace" dialog, so I search the database with an additionally created QSqlQuery and let's say I fi...

Duplicates in QSet

For a class X and a QSet< X* >, how is it possible to make sure that the QSet doesn't contain duplicate elements? The unique property in each object of type X is a QString that can be fetched using getName(). I've implemented the qHash(X*) function, the operator==(), operator<() and operator>(), but the QSet still accepts duplicate elem...

How to "Reveal in Finder" or "Show in Explorer" with Qt

Is it possible to open a folder in Windows Explorer/OS X Finder and then select/highlight one file in that folder, and do it in a cross platform way? Right now, I do something like QDesktopServices::openUrl( QUrl::fromLocalFile( path ) ); where path is a full path to folder I want to open. Obviously, this will just open the folder, an...

QT/WebKit GUI pass selected HTML element data to Qt app

Hello, I'm going to collecect form inputs on web pages to fill them next time automatically based on input field name. How to pass selected/howered HTML element data in QtWebkit to qt application? Like Firebug does. Qt version: 4.6 / 4.7 Thanks. ...

[Qt]Customising QTreeWidgetItem

I want to customise QTreeWidgetItem. I wish to add to it, two Toolbuttons and a string. Also I wish to add these to only one column in the treewidget. I tried to subclass QTreeWidgetItem but realised I coult not "paint" on it as it is not derived from QWidget. I then tried using QTreeWidget::setItemWidget(QTreeWidgetItem *item, int co...