1
голосов
1ответов
326 просмотров

PyQt: Displaying QTextEdits over the window

I want to display some QTextEdits over my main window at arbitrary locations. Below is my first attempt. It doesn't quite work. If I create the text edits before I show the window, the text edits appear, but if I create them after I have shown the window they don't appear. What's up with that...

4
голосов
2ответов
1931 просмотров

How to automate Qt moc?

I have to run the following commands from Qt command prompt: qmake -project then make and this gives me the debug folder with the Moc file. This is strangely the only way my PC will generate the moc_.cpp file. So how can I automate the task of these commands so I don't have to use these commands...

1
голосов
2ответов
6656 просмотров

moc in QT wont compile my c++ header file. says its too different

ok wtf this is what moc tells me when i try to moc one of my header files. im doing this through Qt 4.5.3 command prompt and it says this: C:\Documents and Settings\The Fuzz\Desktop\GUI2>moc App_interface.h /**************************************************************************** ** Met...

-1
голосов
2ответов
784 просмотров

QThread issues. Crash after 2058 runs

Following thread code runs 2058 times, after that it crashes. Can somebody help me figure out why? The idea of the program is create some class in main thread, pass it to worker thread, thread fills needed data and pass data back to main thread. This example crashes after 2058 runs, however it sh...

1
голосов
3ответов
637 просмотров

implement thread for consuming operations in Qt

I have never worked with QThread in Qt, or with threads in general, so the topic is more then new to me. Still I have to use QThread's in order to avoid the blocking of my main application due to some heavy computations. So I want to put my heavy computations in a thread and if they take too muc...

0
голосов
1ответов
586 просмотров

Qt: Writing plugins for other applications

I am writing a plugin for another application. I want to support the plugin on multiple platforms, so I am strongly considering using Qt. The plugin needs to be able to show some basic GUI. The plugin interface does not in any way handle GUI - it is just a simple DLL/shared library specified wit...

0
голосов
1ответов
503 просмотров

Deleting QWinWidget

I am using mfc to Qt migration and I am showing Qt dialogs in my Mfc app. Is it Ok to deleteLater QWinWidget in its winEvent handler? The thing is that I want all of my open Qt dialogs in My Mfc application to be automatically deleted when the main mfc window is closed. Since WM_DESTROY will be ...

52
голосов
18ответов
82591 просмотров

Undefined reference to vtable. Trying to compile a Qt project

I'm using Code::Blocks 8.02 and the mingw 5.1.6 compiler. I'm getting this error when I compile my Qt project: C:\Documents and Settings\The Fuzz\Desktop\GUI\App_interface.cpp|33|undefined reference to `vtable for AddressBook' File AddressBook.h: #ifndef ADDRESSBOOK_H #define ADDRESS...

1
голосов
2ответов
331 просмотров

Compile a quick project in Qt?

I want to compile this application in a command prompt (Windows): include "QtGui/QApplication" include "QtGui/QMainWindow" class Form1 : public QMainWindow { Q_OBJECT public: Form1(QWidget *parent = 0, Qt::WFlags flags = 0); ~Form1(); }; Form1::Form1(QWidget *parent, Qt::WF...

48
голосов
3ответов
30243 просмотров

How to set application's taskbar icon in Windows 7

How do I set an application's taskbar icon in PyQt4? I have tried setWindowIcon, and it successfully sets the icon in the top-left of the main window, but it does not affect the icon shown in the Windows 7 taskbar -- the taskbar icon remains the default Python pyw icon. Here is my code: from Py...

6
голосов
3ответов
10353 просмотров

Qt: QImage always saves transparent color as black

How do I save a file with transparency to a JPEG file without Qt making the transparent color black? I know JPEG doesn't support alpha, and the black is probably just a default "0" value for alpha, but black is a horrible default color. It seems like this should be a simple operation, but all of...

3
голосов
2ответов
336 просмотров

Stop QNetworkRequest buffering entire request

How can I stop QNetworkRequest from buffering the entire contents of a QIODevice during a put/post to an HTTPS connection? It works fine when posting to HTTP but HTTPS causes the entire file to be read into memory before the post starts.

1
голосов
2ответов
5868 просмотров

QTcpSocket in QThread

I have simple server connection thread. When you call function receiveString, it fails. However when you execute same code in run(), it succeeds. What is needed for function receiveString to work? I've tried both bool TestServerThread::receiveString(QTcpSocket& sock, QString& str) bool ...

0
голосов
3ответов
1325 просмотров

Exception Handling in Qt Script with C++?

I have the following action which is executed when a certain button is pressed in a Qt application: #include <shape.h> void computeOperations() { polynomial_t p1("x^2-x*y+1"),p2("x^2+2*y-1"); BoundingBox bx(-4.01, 4.01,-6.01,6.01,-6.01,6.01); Topology3d g(bx); AlgebraicCur...

0
голосов
1ответов
327 просмотров

time table / datebook as in Sunbird for Qt?

I would like to implement a calendar in my Qt-based program as it is already implement in Mozilla Sunbird (different colors and categories are important). Is there any "simple" possibility to realize that or do I have to create it all by myself, beginning at zero? Is there a good tutorial to cre...

23
голосов
8ответов
30337 просмотров

Logging facilities and Qt

What logging facilities do you use whit Qt ? Do you choose qDebug(), qWarning(), qCritical(), qFatal() methods, or maybe something like Log4cpp (Log4cplus etc.), or maybe some custom-maked code ?

4
голосов
3ответов
5013 просмотров

How to control the position of QDialog?

Is there any easy way to open the Qt dialogs in the same position as they were the last time the application was open ? i.e. preserve position of dialogs between application sessions ? By easy way I mean not to have manually write the window position in file, and then read :)

34
голосов
2ответов
21732 просмотров

How do I use qmake to build multiple binaries in a single project?

I'm writing a small qt app suite that consists of a set of small programs that work on the same set of files. They are organized like this: / app1/ main.cpp app2/ main.cpp app3/ main.cpp common/ project.h project.cpp somemore.h somemore.cpp appsuite.pro ...

3
голосов
3ответов
1955 просмотров

QGraphicsView with automatic items placing

I would like to write an asset browser using QGraphicsView. It's a little different from examples using QGraphicsView and QGraphicsItems, because I want only one scrollbar and I want items to move automatically, when the viewport size changes. For example, when viewport width is large enough to d...

9
голосов
5ответов
2606 просмотров

C++ static global non-POD: theory and practice

I was reading the Qt coding conventions docs and came upon the following paragraph: Anything that has a constructor or needs to run code to be initialized cannot be used as global object in library code, since it is undefined when that constructor/code will be run (on first usage, on library ...

7
голосов
5ответов
3145 просмотров

Qt linguist & google translate

I'm looking for a way to cheat and create some very rough translations of my Qt application using Qt linguist and an already-existing translation service such as google translate. There's a public API for google translate, so I'm hoping someone has already tried this, but I can't seem to find it...

4
голосов
4ответов
1117 просмотров

Retrieve revision number in VS with qmake

My current workflow: hg update (or whatever one uses to check out a revision) MyProject.pro → qmake → MyProject.vcproj Open Visual Studio, edit files Build project During the build step, how can I update my config.h header file with information from version control system (e.g. hg id)? MyPr...

4
голосов
2ответов
4005 просмотров

How to use std::string in a QLineEdit?

I have the following problem. I am trying to integrate a large code written by me with a Qt interface. Some of my functions return std::string. I did not succeed in making QLineEdit::setText accept them (other functions returning char do not give me problems). What should I do? Thanks! Giuseppe

15
голосов
1ответов
18770 просмотров

Proper way to check QObject derived class type in Qt

Lets say I have a two classes: class A : public QObject {}; class B : public QObject {}; then I go QObject *a = new A(); QObject *b = new B(); now, how do I make sure that "a" is an instance of class A, and "b" is an instance of class B? currently I do something like this: if (a->inhe...

3
голосов
1ответов
628 просмотров

C framework like Qt?

is there a full-featured framework for C that is similar to Qt?

0
голосов
1ответов
5554 просмотров

Create database in QT

Newbie having trouble creating a database here. Following code compiles ok, but no database is created and I can't find any sqlite file. #include "makeDB.h" #include <iostream> #include <QString> #include <QtSql> void makeDB(QString dbName) { QSqlDatabase db = QSqlDatabase:...

2
голосов
2ответов
6643 просмотров

Qt: kill current process?

Is there a way in Qt to terminate a'la TerminateProcess the current process? QProcess::kill() seem to be only applicable to other, external processes.

1
голосов
2ответов
5824 просмотров

How to change a QPushButton icon when it has focus?

I'm using a QPushButton in an S60 Qt app. I want the button icon to change when it has focus. I've tried this... navButton->setStyleSheet("background-image: url(c:/Data/navArrowsNotSelected.png);"); setStyleSheet("DoubleViewWidget QPushButton:focus {background-image: url(c:/Data/navArrowsSe...

4
голосов
2ответов
10770 просмотров

QT MySql connectivity using Windows XP, Qt Creator 4.5.2(windows 32 bit)

Platform: Windows XP Qt Creator IDE 4.5.2 MySQL is setup here as well. I want to establish database connection with Qt and MySQL. The following line QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); generates error like below: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: av...

5
голосов
1ответов
1369 просмотров

Autocompletion with qcompleter for fragments in the middle of a word

Is there an example available of a QCompleter subclass that will provide autocompletions for fragments that appear in the middle of words? eg: Suppose you have the wordlist { "apple", "pear", "banana" }. When the user types 'p', the suggested autocompletions should be "apple" and "pear", but ...