qt4.8

QPushButton is not changing the background-color proper

╄→尐↘猪︶ㄣ 提交于 2019-12-24 01:19:02
问题 I have a problem with a QPushButton. I use QT 4.8 and the Designer. I configured the button to be "flat" and "checkable". The button should be red if not checked and green if checked. To style the button I use a stylesheet. QPushButton:default{ background-color: red; color: red; } QPushButton:checked{ background-color: green; color: black; } Now the problem. If the button is unchecked it is gray. When I press the button he turns green like it should. I tried different other pseudo-states,

use QThread exclusively for an object

只谈情不闲聊 提交于 2019-12-23 02:39:31
问题 EDIT2 Here is the solution that works for the following problem of giving a QThread exclusively to the object. I've changed the approach for the problem. I don't want to close QThread in MyClass anymore, cause the following solution seems easier and not too bad looking. My solution is modification of the solution given here: http://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/ The problem with that solution was that QObject worker wasn't really

How to include icons in application when using Pyinstaller 2.0 ,PySide 1.1.2 Bindings and Qt 4.8

我是研究僧i 提交于 2019-12-22 08:40:01
问题 what script looks like what working app should look like Before posting I have looked at the following question and tried to use it as a guide to make my script work properly but it was of marginal use PyInstaller won't load the PyQt's images to the GUI the best it did was include my icons in the resulting directory as follows (icons included image here) and the following one I have no idea what it is even saying but I feel it can solve my problem if I knew what it was actually doing,

Qt and Google Earth API

隐身守侯 提交于 2019-12-22 03:16:31
问题 Is it possible to develop an application in Qt, using Google Earth? For example, I want to show the earth (as in google earth) as a sphere via QtGL in my application. 回答1: It is obvious that you can use google earth api with Qt. And I want to share a secret(!!!). Google earth is developed with Qt. :D Here you can find some people discussing about google earth and Qt. Here is some anothe example. 回答2: You could start by looking at the GE Api here. There is a discussion on embedding Google

How to get the row number of widget placed in a cell of Qtablewidget when it get clicked?

南楼画角 提交于 2019-12-21 21:34:58
问题 What i'm trying is to get the row number of QcomboBox when user selects items. Although its easy to to get the cell column and row using cellClicked(int,int) signal, but it only works when there is no widget on the cell. so how to get the row number in case if there is a widget placed in a cell. Note: All the combobox are added dynamically 回答1: At-last i found 2 ways of doing it. By setting the property of QComboBox Using the QSignalMapper First Method QComboBox* mCombo = new QCombobox();

QHttpMultiPart: post files to PHP script

风流意气都作罢 提交于 2019-12-21 02:41:42
问题 I am working in Qt 5 and struggling with a multipart upload. My script is as close to the docs as possible: QUrl testUrl("http://localhost/upload/test.php"); QNetworkRequest request(testUrl); QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType); QString preview_path = "C:/preview.jpg"; QHttpPart previewPathPart; previewPathPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"preview_path\"")); previewPathPart.setBody(preview_path

Qt 3D-array with Qt-Objekts like QVector

て烟熏妆下的殇ゞ 提交于 2019-12-20 04:12:47
问题 How can I create a 3D-array only with Qt-Objects? The array should be a 3D-integer-array. I have tried to create a standard 3D-array on the heap. To allocate the memory on the heap works fine. I got an error if i want to deallocate the memory. const int scalefaktor = 16; int*** anzPixel3d = new int**[256/scalefaktor]; for (int i = 0; i <= 256/scalefaktor ; i++) { anzPixel3d[i] = new int*[256/scalefaktor]; for (int k = 0; k <= 256/scalefaktor ; k++) { anzPixel3d[i][k] = new int[256/scalefaktor

How to Drag and Drop Custom Widgets?

China☆狼群 提交于 2019-12-12 15:44:40
问题 I have created my own custom widget and I want to support internal drag and drop for the widgets. I have added 4 of my custom widgets in a vertical box layout. Now i want to drag and drop the custom widgets internally. To be more clear, If i drag the last widget and drop it in the first position, then the first widget has to move to the second positon and the last widget (which is dragged) has to move to first position. (same like drag and drop of the items in the List view). Can anyone

QGraphicsBlurEffect on parent widget only

一笑奈何 提交于 2019-12-11 23:22:57
问题 I'm trying to show a widget on top of another and apply the QGraphicsBlurEffect only on the parent like this MyWidget::MyWidget(QWidget* parent) : QWidget(parent), { QGraphicsBlurEffect* effect = new QGraphicsBlurEffect(this); parent->setGraphicsEffect(effect); } But the result is both widget are blur. It seams like the effect is propagated to the childrens. How can I apply the blur effect on the parent only? 回答1: Your best option would be to break the parent-child relationship. There's no

How to data-bind a label text to an underlying object's property?

江枫思渺然 提交于 2019-12-11 13:55:21
问题 We're building a Qt4.8/C++ application (no QML) that will run on an embedded ARM device. This device constantly receives values of a lot of datapoints that need to be held in an object. Now I want to bind UI elements to specific properties of this model object in order to automatically always show the current and up-to-date values in the UI. Is there a mechanism in Qt that I can use? Or do I have to keep track of any changes and manually update the UI? It would be great if someone could give