qt4

How to set QT paths in Eclipse without using the “Qt project”?

感情迁移 提交于 2020-01-04 06:58:08
问题 I have a mixed C++/Qt/Python project managed in Eclipse, and I would like to set the Qt paths without setting my project as a "Qt Project". Using CDT and setting it as general "Makefile project from existing code", I cannot find any option in the project properties, where I can set the Qt paths. The menu "QT" seems to disappear from the project Properties if the project is set as other than "Qt Project". I set the Qt include path (e.g. /include/QtGui/) in the "C++ General --> Paths & Symbols"

qt Qmake generating pkgconfig for a project

纵饮孤独 提交于 2020-01-04 03:17:40
问题 I have been told that it is possible to generate a pkg-config file through qmake, but I have no idea how to do it. I have been looking online for a while, and it seems as though it is something you just have to know how to do. Can someone give me an example, or point me to some sort of guide/tutorial? 回答1: Is this what you are looking for? To generate pkg-config using qmake you have to add to (modify) your project file (*.pro file): unix { CONFIG += link_pkgconfig PKGCONFIG += <pc_file

qt Qmake generating pkgconfig for a project

☆樱花仙子☆ 提交于 2020-01-04 03:17:09
问题 I have been told that it is possible to generate a pkg-config file through qmake, but I have no idea how to do it. I have been looking online for a while, and it seems as though it is something you just have to know how to do. Can someone give me an example, or point me to some sort of guide/tutorial? 回答1: Is this what you are looking for? To generate pkg-config using qmake you have to add to (modify) your project file (*.pro file): unix { CONFIG += link_pkgconfig PKGCONFIG += <pc_file

QT Layouts, how to make widgets in horizontal layout move down a row instead of overflowing the window

為{幸葍}努か 提交于 2020-01-04 01:09:10
问题 Right now I have a QHBoxLayout : | W W W W W W | I resize smaller I get: | W W W W | <------------> I want (underlines are black space): | W W W W | | W W _ _ _ | I am not sure which layout would do this. Anyone have any ideas? The KDE Settings application does what I am looking for. I downloaded the code and have started searching but haven't found what I want yet. 回答1: See Flow Layout Example and this question. 来源: https://stackoverflow.com/questions/14619047/qt-layouts-how-to-make-widgets

How to set the PlaceHolderText for QTextEdit

假装没事ソ 提交于 2020-01-03 17:43:30
问题 I just want to set a PlaceHolderText for a QTextEdit . I know how to set it for a QLineEdit . There is a Property, setPlaceHolderText for QLineEdit. But this Property is not available for QTextEdit. Please give your valuable suggestions to solve this. 回答1: Use setTextCursor(QTextCursor&) function of QTextEdit. Use the following logic. QTextCursor textCursor; textCursor.setPosistion(0, QTextCursor::MoveAnchor); textedit->setTextCursor( textCursor ); 回答2: I was able to do this by subclassing

How to set the PlaceHolderText for QTextEdit

谁说我不能喝 提交于 2020-01-03 17:43:07
问题 I just want to set a PlaceHolderText for a QTextEdit . I know how to set it for a QLineEdit . There is a Property, setPlaceHolderText for QLineEdit. But this Property is not available for QTextEdit. Please give your valuable suggestions to solve this. 回答1: Use setTextCursor(QTextCursor&) function of QTextEdit. Use the following logic. QTextCursor textCursor; textCursor.setPosistion(0, QTextCursor::MoveAnchor); textedit->setTextCursor( textCursor ); 回答2: I was able to do this by subclassing

Widgets must be created in the GUI thread Error !. How to correct the code?

a 夏天 提交于 2020-01-03 04:59:26
问题 I have some experience with C++ but I'm a Qt beginner just for a few days. Look at my simple application code below, that is "main.cpp" which is only code file in the project. The problem is that when I try to run the application it returns me error that widgets must be created in the GUI thread. How to go around this ?. Is it possible to write this application that it works as I want without additional thread ?. If Yes then How ?. Please help. I can't get it working by myself. #include

Can linux signal my Qt program when a particular USB device is connected?

房东的猫 提交于 2020-01-03 00:54:13
问题 I want linux to inform my Qt program by a signal when a particular USB device is connected. Storage devices like flash disk or hard drive. How can I do this? What are your suggestions? UPDATE: I have found that QtDbus can provide the functionality that I need but I have not figure out how exactly. Is there anyone can give information about getting USB device notification with QtDbus? I have been reading this tutorial: http://dbus.freedesktop.org/doc/dbus-tutorial.html This tutorial says: D

Qt4 DNS Proxy QUdpSocket

扶醉桌前 提交于 2020-01-02 15:02:35
问题 I'm essentially trying to make a DNS proxy application using Qt4. If I set my DNS nameserver to 'localhost' then I want to forward all DNS requests to the server specified in the remoteSocket object. Everything seems to be working fine except sending the data from the remoteSocket object back to the localSocket object which is requesting the DNS lookup. When writing to localSocket, is there anything specific I need to know about that? The problem seems to be in readResponse(). #include "dns.h

Qt Application: Simulating modal behaviour (enable/disable user input)

北战南征 提交于 2020-01-02 14:36:38
问题 I am currently working on an application that launches separate processes which display additional dialogs. The feature I am trying to implement is simulating modal behavior of these dialogs. More specifically, I need the application to stop processing all input, both mouse and keyboard, when the dialog is launched, and resume when it's closed. It is not so important for the dialog to remain on top of the application, although if you can suggest how to do that without resorting to Always-On