qt4

Qt setPermissions not setting permisions

走远了吗. 提交于 2020-01-11 10:13:12
问题 I'm not sure why but my code bellow does not set permissions for a file. Not sure what could be wrong with the code. SYSTEM: Windows XP Pro SP2. Running in Admin account as admin. Newest Qt framework and files. //Get file permissions of ref file. QFile::Permissions qpPerm1; qpPerm1 = QFile::permissions("E:/dir1/dir2/File1.txt"); //Set file permissions of a file. bool isOK=0; isOK = QFile::setPermissions("E:/dir4/dir5/file2.txt",qpPerm1); qout << "Perms set? " << isOK << endl; Return value is

QTreeWidget expand animation on double click

╄→гoц情女王★ 提交于 2020-01-11 09:18:25
问题 I have created a QTreeWidget and set animation to true ( setAnimated(true) ). When I'm clicking on a mark (triangle) at the left of item it expands smoothly, but when I'm double clicking on the item it expands too fast (almost like there is no "animated" flag set). I want smooth animation on double click too. How can I solve this problem? QTreeView calls QTreeViewPrivate::expandOrCollapseItemAtPos on mark click and QTreeViewPrivate::expand on double click, so I have no access to these methods

How to get a Makefile from qmake

穿精又带淫゛_ 提交于 2020-01-11 04:38:05
问题 Given an x.pro file, how can I produce a makefile? Running qmake x.pro produces an x.pbproj directory without a Makefile. Thanks Edit: Adding info. about the pro file and platform. I am running this on Mac OS X (10.6). The same pro file used to produce a Makefile under OpenSUSE. Here is a snippet of the pro file: TEMPLATE = lib TARGET = x DEPENDPATH += INCLUDEPATH += CONFIG += qt debug QT = core network # Input LIBS += -lcryptopp HEADERS += x.hpp ..... # rest of the header files 回答1: I gues

Bloated EXE sizes, and unwanted dependencies with Qt/MingW

安稳与你 提交于 2020-01-11 03:11:38
问题 I'm trying to figure out how to shrink the sizes of EXE files compiled under the newest QT SDK (4.8.2) (mingw/g++ based). I was working on a vanilla c++ console app that has a simple loop and only #includes iostream, when I noticed that the exe's it generated are about 465kb; way bigger than they should be! Commenting out all the stream stuff brings it down to the expected 5kb range (although the remaining code would be mostly dead). This doesn't seem right at all, especially since another,

QComboBox AbstractItemView::item

喜你入骨 提交于 2020-01-11 01:36:12
问题 Is there a way I could increase the height of the items, which are listed in a QComboBox control ? I tried following as suggested here in QTDevNet forums but with no luck QComboBox QAbstractItemView::item {margin-top: 3px;} I also tried this, still with no result. QComboBox QAbstractItemView::item {min-height: 20px;} Is it possible to achieve this at style-sheet level at all ? 回答1: Your style sheet seemed correct, so I tried it. It seems the problem is similar to this one on Qt centre:

How to word wrap a QTreeWidgetItem

无人久伴 提交于 2020-01-11 00:45:28
问题 I have to populate a QTreeWidget with items (or children of items) that may happen to be too long to fit in a single line, so I'm looking for a way to word wrap them. I thought myQTreeWidget.setWordWrap(True) (done via QtDesigner4) would have done the job, but that doesn't seem to be the case. I don't know if it is relevant, but the tree is enveloped in a splitter frame, so the wrapping should be somehow dynamic to allow resizing of the splitter. Any ideas? I use PyQt4, but hints in any

Maintaining relative child position after applying QGraphicsItem::ItemIgnoresTransformations

て烟熏妆下的殇ゞ 提交于 2020-01-10 19:26:34
问题 I have a QGraphicsTextItem parented to a QGraphicsItem. I want the QGraphicsTextItem to always reside directly above the QGraphicsItem, but I also want the text to remain the same size when the scale factor goes below 1, i.e. the text remains the size it is at a scale factor of 1 even when the parent graphics item is scaled smaller. I have found that setting the QGraphicsItem::ItemIgnoresTransformations flag to true when the scale factor is below 1 does the trick for retaining the size. But I

Q_OBJECT linker error!

被刻印的时光 ゝ 提交于 2020-01-10 18:20:21
问题 I am receiving the following linker error when I build my application. HIMyClass.obj:: error: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CHIMyClass::metaObject(void)const " (?metaObject@CHIMyClass@@UBEPBUQMetaObject@@XZ) File not found : HIMyClass.obj HIMyClass.obj:: error: unresolved external symbol "public: virtual void * __thiscall CHIMyClass::qt_metacast(char const *)" (?qt_metacast@CHIMyClass@@UAEPAXPBD@Z) File not found : HIMyClass.obj HIMyClass

Difference in opengl speed between Qt 4/5 and Opengl API

帅比萌擦擦* 提交于 2020-01-10 07:27:06
问题 I have read all the questions on SO that i could find about qt 4 and 5 opengl. This one came the closest OpenGL vs QOpenGL/QtOpenGL in Qt 5: differences and limitations? , I have no idea why it was closed because its a great question. The only aspect I see it missing is the speed difference. I have also read this https://qt-project.org/forums/viewthread/22921 which had a similar question, but as the back and forth about 4 vs 5, mostly discussing new features. My question is, is using the

How do I compile a PyQt script (.py) to a single standalone executable file for windows (.exe) and/or linux?

江枫思渺然 提交于 2020-01-09 12:21:05
问题 I started to fiddle with PyQt, and made a "beautiful" script from the pyqt whitepaper example app (pastebin) It works perfectly in Windows and Linux (with qt environment already installed on both). Now my question is: Since I am trying to use Qt because it is compiled (at least pure old C++ based Qt), how can I compile some .exe file to run it on Windows, or a standalone executable for Linux. The point is that I want the program to be compiled, because of speed and portability, instead of