Hi everyone,
I want to make editable cells with multi-lines content in QTreeWidget and I use for this purpose QPlainTextEdit as a delegate. I need to set proper size to all rows that switching between editing and displaying went smooth, without any visible changes.
rect = textEdit.blockBoundingRect(textEdit.firstVisibleBlock())
wit...
I was trying to inherit from QGraphicsEllipseItem 'cause i wanted to add some functionality to it. However i was faced with this error, which probably has something to do with the compiler/precompiler or moc?
error: 'staticMetaObject' is not a member of 'QGraphicsEllipseItem'
And here's the class code:
class MyEllipseItem : public ...
How can I add columns to QListView control. Found a method addColumn while seardhing, but in my Qt Creator 1.2.1 based on Qt 4.5.2(32 bit) QListView doesn't have such method at all !!!
So how would I add columns ?
Say I have 3 columns then what is the code to add a row ?
...
Hello all
im using one main QNetworkAccessManager that is in singleton class every time some part from the application
that looks like this :
NetWorkService::NetWorkService()
{
manager = new QNetworkAccessManager();
}
QNetworkAccessManager* NetWorkService::getManager()
{
return manager;
}
needs to preform http call it call...
I have a question relating to databases and at what point is worth diving into one. I am primarily an embedded engineer, but I am writing an application using Qt to interface with our controller.
We are at an odd point where we have enough data that it would be feasible to implement a database (around 700+ items and growing) to manage...
I'm trying to play background music along with sound effects using Qt. However, I can't get more than one sound to play at once. For example:
QSound::play("Music.wav");
QSound::play("Effect.wav");
When this code is run (on Windows), you can hear Music.wav just start to play, but then it stops and Effect.wav plays. Is there any way to ...
Hi Geeks,
I need to create a widget which shows battery status(in percentage) inside my qt application. Can anybody suggest me how to get the winXP api to know the battery status. Then as the api will return the percentage I will display on my widget....
...
What is the cause of following error:
QSqlDatabasePrivate::database: unable to open database: unable to open database
file Error opening database?
Code is 100% correct, this message appeared when I have reinstalled Windows, Python and PyQt.
EDIT: I have "read-only" flag in folder with .db file properties. It stays gray (half-checked) w...
Hi all,
I am having a QListView which having some items. Now i want to get the index of selected item. i.e. if i select 5th element i
should get 5. How i can get this?..
waiting for reply.
Thanks in advance
-S
...
hello i would like to know the java panel equivalent in qt..i mean which class we need to use in qt,i.e.. qframe or qwidget..i need to add many panels to my qt mainwindow
...
Hi,
I want to pass an array of objects from my QtScript to C++ but I have not been able to figure out how to achieve this. As soon as I create an array, the elements inside it are converted to strings before I can access them.
This is what I have been trying so far:
class myObject : public QObject, public QScriptable
{
Q_OBJECT
...
I'm using Qt and have some real basic problems. I have created my own widget MyTest that have a variable obj. I need to set this variable obj from an object outside of the widget so that the variable is copied not just a pointer to another object. I get an error message and can't figure out how to do this basic stuff. This is the code I'...
Hi everyone,
I have some problems with sizing row's height in QTreeWidget. I use QStyledItemDelegate with QPlainTextEdit. During editing text in QPlainTextEdit i check for changes with a help of:
rect = self.blockBoundingRect(self.firstVisibleBlock())
and if text's height changes i resize editor size and need row in QTreeWidget also ...
I have a compressed string written by PHP gzcompress($string)
I need to read it with C++ on QT.
Any help is very appreciated!
...
So let's say I'm trying to click a link in the QWebView, here is what I have:
// extending QWebView
void MyWebView::click(const QString &selectorQuery)
{
QWebElement el = this->page()->mainFrame()->findFirstElement(selectorQuery);
if (!el)
return;
el.setFocus();
QMouseEvent pressEvent(QMouseEvent::MouseButtonP...
I'm making an app wherein the user can add new data to a QTreeModel at any time. The parent under which it gets placed is automatically expanded to show the new item:
self.tree = DiceModel(headers)
self.treeView.setModel(self.tree)
expand_node = self.tree.addRoll()
#addRoll makes a node, adds it, and returns the (parent) note to be expa...
I already know C++ console programming. So shall i learn Qt for c++ or c# first?? I eventually plan to learn both anyways. Also, how long will each one take. The only programming language i know is c++.
...
In this insightful article, one of the Qt programmers tries to explain the different kinds of smart pointers Qt implements. In the beginning, he makes a distinction between sharing data and sharing the pointers themselves:
First, let’s get one thing straight:
there’s a difference between sharing
pointers and sharing data. When yo...
EDIT2: model.hasChildren(parentIndex) returns True, but model.rowCount(parentIndex) returns 0. Is QFileSystemModel just fubar in PyQt?
EDIT: With a bit of adaptation this all works exactly as it should if I use QDirModel. This is deprecated, but maybe QFileSystemModel hasn't been fully implemented in PyQt?
I'm learning the Qt Model/V...
I need to run slot only on doubleClick with left button mouse, instead of both.
connect(this -> myComponent, SIGNAL (doubleClicked (const QModelIndex & )), this,
SLOT (performSomeAction(const QModelIndex & )));
With this event, double click works in both cases, but needed only with left button click.
How I can do it?
this -> myComp...