qt4

Qmake Command to copy directory and files

我的未来我决定 提交于 2019-12-13 03:09:10
问题 I want to copy the contents in directory "temp" to "dd" BINARY_DESTINATION_PATH = $$PWD$$SEPARATOR/dd/ RESOURCE_SOURCE_PATH = $$PWD$$SEPARATOR/temp EXPORTED_DESTINATION_PATH = $${BINARY_DESTINATION_PATH} EXPORTED_DESTINATION_PATH ~= s,/,\\,g EXPORTED_SOURCE_PATH = $${RESOURCE_SOURCE_PATH} EXPORTED_SOURCE_PATH ~= s,/,\\,g QT += core QT -= gui CONFIG += c++11 TARGET = sample CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp win32 { QMAKE_POST_LINK += $$quote(cmd /c xcopy

Visual Studio 2008 debugger wrong instruction executed position (Qt4, XML)

橙三吉。 提交于 2019-12-13 02:57:05
问题 I have some part of code with which the debugger , when entering , starts stopping in lines with { braces.. suddenly jumps back to a blank line, and apparently is doing something (variables change), but the positions are different (there is some kind of weird offset back, skipping blank lines) and obviously i cannot see the contents of any variable. Some facts: I'm compiling on DEBUG The code that fails falls inside more code which executes perfectly before. The code does not work properly ,

resizeable rubberband with QT

老子叫甜甜 提交于 2019-12-13 02:22:07
问题 I want to create a resizeable selection tool to select a part of an image with the mouse. I want to accomplish this with QT, i have a working QRubberBand to create a basic selection. Next step is to make that selection resizeable with the mouse. So if you click&drag a corner the size changes accordingly and if you click&drag inside the selection it should move the selection. now my idea is subclassing QRubberBand and overriding the paintEvent method to paint a big dot on every corner and

Dedenting function in QPlainTextEdit causes segfault if last line is involved

a 夏天 提交于 2019-12-13 02:08:11
问题 I'm working on a source code editor that should have smart indent/dedent behaviour. However, my dedenting method seems to be causing a segmentation fault. I'd be very pleased if someone could work out why. Here's a minimal example: #!/usr/bin/env python import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) from PyQt4 import QtGui from PyQt4.QtCore import Qt class Editor(QtGui.QPlainTextEdit): def keyPressEvent(self, event): key = event.key() if key == Qt.Key_Backtab: cursor = self

How do I pass an OpenGL context from Qt4?

家住魔仙堡 提交于 2019-12-13 00:34:41
问题 I'm currently developing a game in the LeadWerks 2 engine and I've decided to use Qt4 as the GUI and window manager. What I want to do is create a Qt QGLWidget window and have the LeadWerks engine run inside of that. There is some information of building a basic QGLWidget application here. I'm really struggling to understand how to do this exactly. I can create a custom GL buffer within the LeadWerks engine and I believe what I need to do is give that buffer the GL context Qt created. As for

QString to XML in QT

▼魔方 西西 提交于 2019-12-13 00:23:23
问题 I need to create XML file in QT, but i dont use QT XML classes to create the XML data, but i create strings manually (which contains XML) and write it into the file, the reason for not using QT XML classes is, i need to preserve the order of attribute but if i use QT XMl classes it writes attribute in random order. Everything was fine up to now, until i get the html text to be written as tag value in XML. i need to write HTML data as the QT XMl classes writes for e.g "This is <Test data>"

PyQt4: Non-ASCII character detected in trUtf8 string

ぃ、小莉子 提交于 2019-12-13 00:14:10
问题 I'm trying to figure out how to feed the PyQt tr() or trUtf8() functions UTF-8 text. Here are examples strings: self.tr('λληνικά') self.tr(u'εληνικά') self.tr('ελνικά'.encode('utf-8')) self.tr(u'ελληικά'.encode('utf-8')) self.trUtf8('λληνικ') self.trUtf8(u'εληνιά') self.trUtf8('ελνι'.encode('utf-8')) self.trUtf8(u'ελλκά'.encode('utf-8')) The ones with self.tr display as gibberish in Qt Linguist. The ones with self.trUtf8 display fine, but they trigger a warning when applying pylupdate4 : Non

Getting OpenGL context newer than 2.1 with Qt 4 and Mavericks

≯℡__Kan透↙ 提交于 2019-12-13 00:10:59
问题 I'm having difficulty creating an OpenGL context newer than 2.1 (Mac OS 10.9.1, Qt 4.8.5, PySide 1.2.1). Minimal example code is given below; it produces a 2.1 context rather than 3.2 or higher. The code is based on this tutorial; the tutorial's sample C++ code also fails when run on my machine. This issue might be related to this bug: QGLFormat.openGLVersionFlags() returns 0x7f (indicating compatability up to OpenGL 2.1 but no later). Is there something that I'm missing, or is it hopeless

Where's the balance between thread amount and thread block times?

醉酒当歌 提交于 2019-12-12 23:57:00
问题 Elongated question: When having more blocking threads then CPU cores, where's the balance between thread amount and thread block times to maximize CPU efficiency by reducing context switch overhead? I have a wide variety of IO devices that I need to control on Windows 7, with a x64 multi-core processor: PCI devices, network devices, stuff being saved to hard drives, big chunks of data being copied,... The most common policy is: "Put a thread on it!". Several dozen threads later, this is

one type of file format in QTreeView

本秂侑毒 提交于 2019-12-12 21:28:52
问题 Is it possible to set only one file format visible to the user? I'm searching it in documentation, but I can't find it... If not, which other widget you are suggesting to use? 回答1: I assume you're using a QTreeView with a QFileSystemModel. If not, I'd suggest doing so. QTreeWidget is not as flexible. QFileSystemModel has a method called setNameFilters that should do what you want. To use it, do something like this: QStringList filters; filters.append("*.cc"); // whatever filters you want