qt4.8

Difference in relative file path: debug mode and release mode of Qt Creator

让人想犯罪 __ 提交于 2019-12-05 23:25:17
QFile file("test.txt"); if (file.open(QIODevice::ReadOnly)) { qDebug()<<"You got me."; } I am using: Qt 4.8.6 with MSVC 2010 Qt Creator 3.1.1 Windows 7 (32 bit) From the above code, if .pro file has not been changed , the corresponding build directory for the debug mode : D:\...\build-Main-MSVC2010-Debug and the .exe of the debug mode will be located in D:\...\build-Main-MSVC2010-Debug\debug for the release mode : D:\...\build-Main-MSVC2010-Release and the .exe of the release mode will be located in D:\...\build-Main-MSVC2010-Release\release [Question] If I want the release program to read the

QListWidgetItem with Radio Button

半世苍凉 提交于 2019-12-05 19:15:47
I'm working on my first QT application and I have a problem with QListWidgetItems . I will be having different kind of list. for checkboxed list using: listElement[i]->setFlags(Qt::ItemIsEnabled); listElement[i]->setCheckState(Qt::Unchecked); works exactly as wanted. But now I want a Radio Button list. so my question is in two parts can use the same logic that I used for checkBox to create Radio Buttons? I have used: listElement[i]->setFlags(Qt::ItemIsEnabled); QRadioButton *radio1 = new QRadioButton(0); dlList->setItemWidget(listElement[i],radio1); this will display Items in the list with a

QApplication segmentation fault

蓝咒 提交于 2019-12-05 16:55:39
I get a crash when try to create a QApplication object. This is my code: #include <QLabel> #include <QApplication> int main(int argc, char* argv[]) { QApplication app(argc, argv); return app.exec(); } I am using Qt version 4.8.4 and the MinGW compiler. My application crashes when running QCoreApplicationPrivate::processCommandLineArguments method. Can anybody tell how to solve this problem? Apparently, this error is caused by binary incompatibility of Qt binaries and your compiler. From here : There are binary installers targetting MinGW for both Qt 4 and Qt 5. The Qt 4 ones are built with

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

送分小仙女□ 提交于 2019-12-05 16:30:24
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, Bundling data files with PyInstaller (--onefile) I have rtfm and most of it goes above my head unfortunately.

Stacking QPushButtons on the other side of a QMenuBar

▼魔方 西西 提交于 2019-12-05 10:24:18
I want to stack some QPushButton objects on the other side of my QMenuBar . This is how my window looks now: And this is how I want it to look like (I've photoshopped the image): I know that in the motif widget style, the help menu is aligned to the right, but I'm sticking with plastique , so it's not a problem for me. I'm using Qt4.8. Any ideas? QMenuBar has a setCornerWidget function, that sets a widget (that may include a whole layout) as the cornet widget. QMainWindow::setMenuWidget() can be used to set any widget as the main window's menu bar widget. Using an appropriate layout, you can

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

左心房为你撑大大i 提交于 2019-12-04 17:04:53
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 At-last i found 2 ways of doing it. By setting the property of QComboBox Using the QSignalMapper First Method QComboBox* mCombo = new QCombobox(); mComboBox->setProperty("row",(int) i); // i represents the row number in qtablewidget In handler function where

QHttpMultiPart: post files to PHP script

我的梦境 提交于 2019-12-03 08:30:40
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.toLatin1()); QHttpPart previewFilePart; previewFilePart.setHeader(QNetworkRequest::ContentTypeHeader,

Qt 3D-array with Qt-Objekts like QVector

你。 提交于 2019-12-02 03:20:57
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]; } } for (int j = 0; j <= 256/scalefaktor ; j++) { for (int m = 0; m <= 256/scalefaktor ; m++) {

pyqt qt4 QTableView how to disable sorting for certain columns?

本小妞迷上赌 提交于 2019-12-01 19:19:04
So I have a QTableView and I only want to let column sorting on column 1 but not column2. Naturally I tried to installEventFilter on QHeaderView or QTableView , but MouseButtonPress event is not being passed unless you installEventFilter on QApplication Now if when eventFilter is called, the target object is always the top level widget although event.pos() is actually relative to the header or tablecell depending on where you click. So we cannot use QHeaderView.rect().contains(event.pos()) to find out if the user clicks on the header because you get false positive when you click on the top

pyqt qt4 QTableView how to disable sorting for certain columns?

南笙酒味 提交于 2019-12-01 17:30:56
问题 So I have a QTableView and I only want to let column sorting on column 1 but not column2. Naturally I tried to installEventFilter on QHeaderView or QTableView , but MouseButtonPress event is not being passed unless you installEventFilter on QApplication Now if when eventFilter is called, the target object is always the top level widget although event.pos() is actually relative to the header or tablecell depending on where you click. So we cannot use QHeaderView.rect().contains(event.pos()) to