Hi, please note that I'm a complete beginner to Qt development.
I have a QWebView with a QObject added to the JavaScript window object.
How do I fire a JS event on that object?
view->page()->mainFrame()->addToJavaScriptWindowObject(objName,obj);
I want to be able to listen to events using addEventListener.
window.objName.addEventLis...
Hi, I'm developing an image viewer, based on a QScrollArea and a QLabel that contains the image to show.
Now, I need to show text over the label, like the current mouse (x,y) position, image size, etc., in a specific point, but it can't be affected by the scrolling.
How can I do this?
...
I am learning PyQt from this site. The tutorial is building a widget that colours a square.
In this, they are using CSS to colour the square, rather than give it some sort of concrete property of colour. Why is this? Is there another way to do this without CSS or is this the preferred method? It seems awfully strange..
...
I'm trying to make an UI that contains a list of such items:
User can change the count of the items, so the UI is dynamic.
What are the best components to get user input, like in the picture? Is it multiple QLabels and QLineEdits?
What is the best way to manage them?
...
Hi,
I have a QGraphicsView with a QGraphicsScene. That QGraphicsScene contains a QPixmap. It is possible to drag the scene. On top of that scene I have a HUD with QLabels, QPushButtons and other stuff. When I drag the scene around, the HUD elements never change their position. So far it works all perfect. But now I need to add a new el...
Does Qt have a built-in way to inflate or grow a rectangle? Like .NET's Rectangle.Inflate or Java's Rectangle.grow... or do I have to implement my own? I've looked through the docs and couldn't find one but maybe I'm missing something.
...
Hi,
How to install the Qjson in mac?
Thanks in advance.
...
main:
#include "QtGui/QApplication"
#include "spc_login.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
SPC_LOGIN w;
//#if defined(Q_WS_S60)
// w.showFullScreen();
//#else
// w.show();
//#endif
w.showMaximized();
return a.exec();
}
..other code:
protected:
void changeEv...
Following code is in my c++ class
static const QString ALARM_ERROR_IMAGE ;
i want to initilize
ALARM_ERROR_IMAGE = "error.png";
Is it possible to initilize error.png to static const QString ALARM_ERROR_IMAGE
Want to keep it inside class
...
Hi,
I want to keep a static const variable as a member of class.
Is it possible to keep and how can i initilize that variable.
Some body helped by saying this
QString <ClassName>::ALARM_ERROR_IMAGE = "error.png";
http://stackoverflow.com/questions/3698446/initilizing-value-for-a-const-data
I tried like this
in CPP class i write...
Hello,
I am trying to connect to a local MySQL server, but cannot find out how to select if QSqlDatabase should connect through a socket or port. Qt is version 4.6.3. My simple test code is as follows:
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setPort(3306);
db.setDatabaseName("rem");
db.set...
Hi,
how is it possible to add an QPainter arc to the QGraphicsView foreground.
I found QGraphicsView.drawForeground (self, QPainter, QRectF), but I don't understand how to use it. I am new to qt. I also know that it is possible to add an art to the QGraphicsScene, but I need the scene for something else. Or is there an easier way to a...
QUrl url("bword://blood transfusion");
QString res = url.toString();
Why I got the string "bword:" instead of "bword://blood transfusion"?
How can I get the string "bword://blood transfusion" form the QUrl?
...
How do I convert my font on a QGraphicsObject from point size to pixel size? I need to do this so the fonts will look right when I print my QGraphicsScene using QGraphicsScene::render().
...
I wish QDateTime overrode the - operator and returned a QTimeSpan representing the difference between two QDateTimes (just like .NET's TimeSpan). Since this doesn't exist in Qt, I decided to implement it.
Unfortunately, QDateTime has no msecsTo-like function. What is the cleanest way to get the difference between two QDateTimes accurate...
Hi.,
i am trying to create layout like this (Please see the Picture)
http://i225.photobucket.com/albums/dd200/saravanan_comp2001/layout.jpg
In the QT i created widgets and put in the main widget, the problem is not visible. none of the widget's are not shown. please help me to fix this issue
Complete Source Code
sandbox.ifuturemec.c...
Hi,
My json output look like [{"id":2,"name":"AAA"},{"id":1,"name":"BBB"}]. I want to parse this using Qjson in mac. I am trying to parsing but I could not get any outputs . please help me.
Thanks in advance.
...
Hey everyone,
I want to be able to save an image as text in a xml file and I can't manage to find a efficient way to do it !
So far I tried :
QByteArray ImageAsByteArray;
QBuffer ImageBuffer(&ImageAsByteArray);
ImageBuffer.open(QIODevice::WriteOnly);
rImage.save(&ImageBuffer, "PNG");
return QString(ImageAsByteArray.toBase64());
D...
Hello,
I'm trying to visualise a tree in Qt.
So far, all my nodes consist of simple circles and based on QGraphicsItem class. But I need to display some text over every node, how can I "attach" a QLabel to my nodes?
Thanks in advance.
...
Hi all,
I've recently been looking at Qt, and yes I should have started a long time ago... But the issue has come up that the prebuilt or self compiled .dlls, QtCore4.dll, QtGui4.dll, etc., are quite large.
Since I must stay within the LGPL, is there a correct way to only link in what I need into the QtCore4.dll and QtGui4.dll files so...