qt4

How to disable adding 'd' suffix to debug library name in qmake on windows?

让人想犯罪 __ 提交于 2019-12-13 15:25:35
问题 I created project for QML C++ plugin in QtCreator and debug version have 'd' suffix appended to the name, for example plugind.dll instead of plugin.dll . How can configure project not to add this suffix? Qt version 4.8.1, windows 7. 回答1: You can write this line into the .pro file: TARGET = YourProgramName 来源: https://stackoverflow.com/questions/12295514/how-to-disable-adding-d-suffix-to-debug-library-name-in-qmake-on-windows

Why library name gets an additional 0 in its name?

流过昼夜 提交于 2019-12-13 15:17:53
问题 I have this tiny Qt project with a project file like this: TEMPLATE = lib TARGET = record32 VERSION = 0.0.1 DEPENDPATH += . INCLUDEPATH += . CONFIG += shared SOURCES += recorder.cpp HEADERS += recorder.h When I compile a library from it by qmake && nmake , it results into files record32.obj record320.lib record320.dll ... Why is that additional 0 added to the lib and dll names? The generated makefiles seem not be appending it but rather just assume it, in Makefile.Release it just says: ######

how to print a QGraphicsScene that has text and graphics

拥有回忆 提交于 2019-12-13 15:13:16
问题 I have a QGraphicsScene that has graphics as well as text drawn on it. When I try to print, the graphics are fine, but the text is using a font size defined in points, so scene->render() when I pass it a QPainter initialized with a QPrinter , has VERY large text. How am I supposed to print a QGraphicsScene that has text on it? edit: Here is my current printing code, where scene_ is my custom subclass of QGraphicsScene : QPrinter printer(QPrinter::HighResolution); QPrintDialog dialog(&printer,

Qt-fy existing enum to use with Qt metadata

送分小仙女□ 提交于 2019-12-13 14:41:09
问题 Let's assume I have an existing enum X { A, B } and want to use it with Qt metadata such as QMetaObject / QMetaEnum . QMetaObject meta = FsxSimConnectQtfier::staticMetaObject; for (int i=0; i < meta.enumeratorCount(); ++i) { QMetaEnum m = meta.enumerator(i); } If I define my enum within a Q_OBJECT class, all is fine, i.e. I can retrieve MyEnum by the metadata system. But how can I make X available for the metadata system? class FsxSimConnectQtfier : public QObject { Q_OBJECT Q_ENUMS(MyEnum) Q

Reading the same file with several different streams in Qt

為{幸葍}努か 提交于 2019-12-13 14:19:52
问题 Is it possible to read a file using multiple streams to access different portions of data in it at the same time, using Qt? 回答1: Note that a stream (QTextStream / QDataStream) in Qt doesn't handle the position in the underlying device. A stream class is only a wrapper for easier parsing of the binary data within the device (QFile instance). So two streams for the same device (QFile) will not work. You can, however, have multiple devices (QFile) for the same underlying file, and each of them

qt networkManager get

◇◆丶佛笑我妖孽 提交于 2019-12-13 12:46:00
问题 I want to download the url entered in the line edit widget. I am not able to get it working , can some one please give me a short code snippet which can put the values of the file to a QString ? void imdb::on_imdbGetButton_clicked() { Qstring link1 = ui->lineEdit2->text(); // QString link1 is the url to be downloaded. } I have added , the required header files.. Thanks.. 回答1: I guess you're trying to download a file via http . Here's what you could do: In you *.pro file add QT += network

2D matrix of QStrings [closed]

跟風遠走 提交于 2019-12-13 09:36:56
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I want to make an application with which you can reserve ticket for your travel. In fact, I'm designing the system for an airline. When I want to create a database (a 2D matrix that saves the number of seats in

Receiving data with spaces, thru sockets

ぐ巨炮叔叔 提交于 2019-12-13 09:11:48
问题 I'm using C++ with QT4 for this. And when I try to send large html files(in this case, 8kb), the process of sending and receiving work well. But the file received come with spaces between each character of the html file. Here an example, the file is sent like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style="

Setting QScriptValue-local values prior to evaluating

泄露秘密 提交于 2019-12-13 07:31:15
问题 Is it possible, in Qt 4.8, from the C++ side, to set QScriptValue -local values in a QScriptEngine ? For example, let's say I have: QScriptEngine engine; engine.globalObject().setProperty("glob", 1000); // ???: Set loc to, say, 42. QScriptValue expr1 = engine.evaluate("glob + loc"); qDebug() << expr1.toNumber(); // ???: Set loc to, say, 99. QScriptValue expr2 = engine.evaluate("glob + loc"); qDebug() << expr2.toNumber(); And I'd like the output of that to be: 1042 1099 The obvious solution to

Disabling a QCheckbox in a tricky way

别等时光非礼了梦想. 提交于 2019-12-13 07:17:13
问题 I want to make a QCheckBox named "Show Captions" disable another QCheckBox named "Show captions if no title" when the first is checked, but my problem is that how I can make it disabled immediately when the user checks the first checkbox. SetupSlideShow::SetupSlideShow(QWidget* parent) : QScrollArea(parent), d(new SetupSlideShowPriv) { QWidget* panel = new QWidget(viewport()); setWidget(panel); setWidgetResizable(true); QVBoxLayout* layout = new QVBoxLayout(panel); d->showComment = new