qt4

RubyQT QGraphicsview scale images to fit window

I'm trying to make an image scale inside of a QGraphicsView and having zero success. I did find this C++ question with what seemed to be the same problem:http://stackoverflow.com/questions/2489754/qgraphicsview-scrolling-and-image-scaling-cropping I borrowed the approach of overriding the drawback/foreground. However when I run the scr...

Creating Custom QT Library

I created a static Qt library by using VS2005. It created an extra file "test_global.h" besides expected ones(test.h and test.cpp). test_global.h #ifndef TEST_GLOBAL_H #define TEST_GLOBAL_H #include <Qt/qglobal.h> #ifdef TEST_LIB # define TEST_EXPORT Q_DECL_EXPORT #else # define TEST_EXPORT Q_DECL_IMPORT #endif #endif // TEST_GLOBA...

Best protocol for client/server communication, from PHP/Perl to C++/Qt4

I'm the author of an Open Source kiosk management system, Libki. The current version, though functional, was very much a learning experience for me. I'm working on a complete rewrite and am having a hard time deciding what protocol to use. The server will be written in PHP or Perl. Most likely PHP because I need to support some uncommon...

How to insert QPushButton into TableView?

I am implementing QAbstractTableModel and I would like to insert QPushButton in the last column of each row. When users clicks on this button, a new window is shown with more information about this row. Do you have any idea how to insert the button? I know about delegating system but all examples are only about "how to edit color with ...

Embedding QT application in Eclipse/RCP framework

Hi, I'm trying to embed my working QT application in Eclipse RCP framework(might not sound wise but i need to do this). I'm using QT 4.5 (not yet explored what QTJambi is all about and has to offer) I convert my existing application as a dll and load it through eclipse application. Things dont work as they should as the QTApplication lo...

QT qmake lowercases my custom widget names

I'm using QT 4.6 on Linux and Windows, and on Linux, it insists on including my QScrollPane by qscrollpane.h App.pro: HEADERS += widgets/QScrollPane.h The section from mainform.ui <widget class="QScrollPane" name="ListView"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>500</width> <height>490</height>...

How about using SVG(Scalable Vector Graphics) on desktop applications?

I am working in Train Traffic Controller software project. My responsibility in this project is to develop the visual railroad GUI. By now I am using some svg graphics in that GUI. I prefer them because of their scalability talents. Is it good or bad idea to use svg in a desktop application? Any suggestions? ...

Qt QNetworkAccessManager does not emit signals

The function CheckSite() is called with an url like http://site.com, it initializes a QNetworkAccessManager object and connect() slots and signals. The manger->get() call seems work (it generates http traffic) but does not call the slot replyFinished() at the request end. What's wrong with this code? #include <QtCore> #include <QtNe...

QGLWidget + QGraphicsScene + QGraphicsView problem

Hi! I would like to create a simple thumbnail viewer using QGLWidget, QGraphicsScene and QGraphicsView. And I have a problem with placing QGLWidget on QGraphicsScene. The code is similar to this: QGraphicsScene *testScene = new QGraphicsScene (0, 0, 400, 400, 0); QGLWidget *testWidget1 = new QGLWidget(); testWidget1->renderText("Test ...

How to Track Emitted Signals in QT?

Is there any way to observe all signals which are emitted? PS. Of course we can write slots for all signals, but that is not I want. Thanks. ...

how to add menu dynamically in Qt

Hi, I want to add, submenu to a menu item dynamically. How can I achive this? I tried like this, I have created an Action and submenu. Then I have added the submenu to action. But, I have connected the “triggered” signal of action. its getting crash if I click on the action.. I have also handled the “aboutToShow” signal of menu, sam...

Periodically updating data in a matplotlib figure embedded in a QWidget

I have a thread that updates some data periodically. I want do visualize the data with matplotlib. When the thread updates the data, the plot should be updated as well. I tried embedding a matplotlib.FigureCanvas(see following snippet) in a QWidget... class MplSubPlotCanvas(FigureCanvas): def __init__(self, parent=None): se...

Setting application info in Qt

Anyone have an tips on setting the application info (ie. right click on .exe->properties) from Qt? I can add arbitrary version strings to Qt resource file (qrc) and display them. But most Windows installers check the version number and I can't find a Qt way of setting these fields other than manually maintaining a separate .RC file So...

How to interact with checkbox actions ? (QTableView with QStandardItemModel)

I'm using QTableView and QStandardItemModel to show some data. For each row, there is a column which has a check Box, this check box is inserted by setItem, the code is as follows: int rowNum; QStandardItemModel *tableModel; QStandardItem* __tmpItem = new QStandardItem(); __tmpItem->setCheckable(true); __tmpItem->setCheckState(Qt::U...

Basic compile issue with QT4

I've been trying to get a dead simple listing from a university textbook to compile with the newest QT SDK for Windows I downloaded last night. After struggling through the regular nonsense (no make.bat, need to manually add environment variables and so on) I am finally at the point where I can build. But only one of the two libraries se...

IPC: Communication between Qt4 and MONO processes (on linux)

I have to connect a Qt4 application to a mono Application. The current proof of concept uses network sockets (which is nice, I can debug using nc on the command line). But I am open to new suggestions. What are my alternatives? Edit: The original application stack is split into two parts: server + client. The client is supposed to sho...

Data loss when converting from QString to QByteArray

I'm using QPlainTextEdit as an HTML editor, saving the data through an HTTP post with QNetworkAccessManager. I experience data loss when using HTML special characters such as & (ampersand) I'm building a POST request with a QByteArray (as mentioned in the docs). QByteArray postData; QMapIterator<QString, QString> i(params); while(i.has...

STL operator= behavior change with Visual Studio 2010?

Hi, I am attempting to compile QtScriptGenerator (gitorious) with Visual Studio 2010 (C++) and have run into a compile error. In searching for a solution, I have seen occasional references to compile breakages introduced since VS2008 due to changes in VS2010's implementation of STL and/or c++0x conformance changes. Any ideas what is h...

c++ Design pattern for CoW, inherited classes, and variable shared data?

I've designed a copy-on-write base class. The class holds the default set of data needed by all children in a shared data model/CoW model. The derived classes also have data that only pertains to them, but should be CoW between other instances of that derived class. I'm looking for a clean way to implement this. If I had a base class F...

QApplication In Non-Main Thread

I need to exec() a QApplication in a thread that is not main (my GUIs must be plugins that can be dynamically loaded and unloaded at runtime, so I have no access to the main thread). Does anyone know of a (relatively) painless way to hack around Qt's restriction against starting QApplication outside of main? I'm developing in Linux wit...