qt4

How to set Application Icon in QT on Symbian?

有些话、适合烂在心里 提交于 2019-12-10 21:37:02
问题 How can I set an app icon in QT on Symbian? I read here http://doc.qt.nokia.com/4.6/appicon.html about hot to set it but it doesn't work for me. I created SVG-Tiny icon(file) and wrote ICON = Resource/ico.svg in the pro file. What is wrong? Thanks in advance 回答1: That should do it. Works for me. Things to check: Have you run qmake and rebuilt the project after editing the .pro file? In emulator environment, have you restarted the emulator? Check that your PKG file has rules to install both

How to disable selection highlighting in a QTableWidget

懵懂的女人 提交于 2019-12-10 21:13:20
问题 I have a QTableWidget with a disabled setSelectionMode (QTableWidget::NoSelection) and the QTableWidgetItems I fill in don't have the Qt::ItemIsEditable flag. Nevertheless, a cell that has been clicked gets some kind of cursor (the black line at the bottom in my case): How can I disable this "cursor"? 回答1: Does this help? QPalette palette = tableWidget->palette(); palette.setBrush(QPalette::Highlight,QBrush(Qt::white)); palette.setBrush(QPalette::HighlightedText,QBrush(Qt::black));

PyQt: translate module strings at runtime

社会主义新天地 提交于 2019-12-10 20:44:01
问题 Strings in QObject s are translated at runtime. If the translator is changed, all those strings are refreshed. However, strings declared at module level or even static class attributes, are translated at import time. I can see 3 ways of allowing module strings to be translated, none of which seems totally satisfying to me : Import the module after the translator is installed (see here (paragraph Install translator early )). This may not be handy but is feasible, as long as one doesn't need to

How to use libavcodec in Qt4?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 20:20:54
问题 How do I use libavcodec in Qt4 to access individual video frames? After verifying that the video stream can be decoded by libavcodec by compiling this example, I moved the source code to my C++ program. Now av_open_input_file() is suddenly unable to open my video file (returning an errorcode: -2). The call looks like this right now: ... // Register all formats and codecs avcodec_register_all(); // Open video file QString videoFileName("/absolute/path/to/video.avi"); // from somewhere else in

Can I un-check a group of RadioBottoms inside a group box?

别说谁变了你拦得住时间么 提交于 2019-12-10 20:19:03
问题 radio bottoms inside a group Box will be treated as a group of bottoms. They are mutual exclusive. How can I clean up their check states?? I have several radio bottoms, one of them are checked. How can I "clean" (uncheck) all radio bottoms?? "setChecked" doesn't work within a group, I tried to do following things but failed. My code is as following, radioButtom is inside a groupBox, and I want to unchecked it. The first setChecked does works, but the second one doesn't, the radioBottom doesn

QNetworkAccessManager and HTTP persistent connection

假装没事ソ 提交于 2019-12-10 20:14:45
问题 HTTP 1.1 supports persistent connection by default, so I want to send my a second http request using the same connection that was setup when the first HTTP request was made. how can this be achieved through Qt? If I simply make the second request after the first one finished like the following manager->get(QNetworkRequest(QUrl("http://qt-project.org"))); it seems a new TCP connection to the server will be initiated (I have checked with a network sniffer) The experiment also says: If the reply

How do I enable HiDPI (Retina) support in a Qt4 OpenGL application?

亡梦爱人 提交于 2019-12-10 19:29:10
问题 I am using a QGraphicsScene with a QGraphicsView, as described in this document; I intend to eventually overlay Qt widgets on top of my OpenGL rendered scene. When I launch a dummy application modeled after the tutorial above, the rendered view is heavily pixelated-- HiDPI isn't working at all. Per this document, I've manually added: <key>NSHighResolutionCapable</key> <string>True</string> to the application's Info.plist file, still with no effect. (It seems this is supposed to default to

Which model to subclass / view to use for a list of custom objects

孤人 提交于 2019-12-10 18:47:11
问题 I don't have enough experience with Qt yet to make a good design choice. Any help by experienced Qt programmers would be very appreciated. I'm trying to find out which model to subclass, which view to use, what delegate subclassing / extending I should do... My problem is similar to: I have these zones I would like to display, 1 per row: class Zone{ //inputs string country; //edited with a QComboBox string city; //edited with a QComboBox int ageMin; //stored result int

Icons disappear on an other computer

試著忘記壹切 提交于 2019-12-10 18:31:59
问题 I've created a program with Qt Creator and compiled it with the release mode. I've added all the necessary DLLs and everything runs fine on my computer. The problem is that when I start the program from an other computer all the icons that I've included are not displayed, whereas everything looks fine on my computer. Where can this come from? Edit: The icons are loaded in a qrc file... 回答1: Most of Qt's support for file formats relies on plugins. To ensure that your application works as

Getting runtime architecture information in Qt

好久不见. 提交于 2019-12-10 18:25:42
问题 How might I discover, at runtime, using Qt, if a user's system is Win 7-32 or Win7-64? 回答1: There is no way of doing it exclusively using Qt, AFAIK. Below is how you can do it. #include <windows.h> #include <tchar.h> #include <QtCore/QSysInfo> typedef enum { Win_64, Win_32, Error, Other } OsType; typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); OsType checkOS() { #ifndef Q_OS_WIN32 return Other; #else // An application compiled for 64 bits can only run on a 64 bit os, // so no need