qt4

Trouble using Qt with Visual Studio

梦想与她 提交于 2019-12-22 13:31:04
问题 I am looking to do Qt development with Visual Studio 2005. I have built the Qt libraries for Visual C++ and have downloaded the Qt plug-in using the steps outlined here. I've set the QTDIR environment variable to point to the newly built Qt environment ( C:\Qt\vc ). However, when I start Visual Studio, I get the following message: These Qt versions are inaccessible: vc in c:\Qt\vc. Make sure that you have read access to all files in your Qt directories. (And I definitely have read access) How

[Qt]How to support :pressed state of style sheet for custom widget?

爱⌒轻易说出口 提交于 2019-12-22 12:37:43
问题 What i have :- I have a custom widget which extends QFrame (instead of QWidget as QFrame already has a working paintEvent implementation). I have overridden the mousePressed() and mouseReleased() to emit the pressed() released() and clicked() Signals. Everything upto this point is woring fine as expected. What i need :- This custom widget is having basic style sheet support and it supports the :hover state just fine. But the :pressed state is not working. I have already figured out that this

How to display PDF with python-poppler-qt4?

孤者浪人 提交于 2019-12-22 12:17:09
问题 I have downloaded and installed python-poppler-qt4 and I am now trying out a simple Qt application to display a PDF page. I've followed what I've been able to get from the web, i.e. convert the PDF to a QImage, then to a QPixMap, but it doesn't work (all I get is a small window with no visible content). I may have failed at some point ( QImage.width() returns the width I have input, QPixMap.width() returns 0). Here is the code: #!/usr/bin/env python import sys from PyQt4 import QtGui, QtCore

100% CPU usage when overriding QGraphicsLineItem::paint()

主宰稳场 提交于 2019-12-22 11:26:15
问题 I have a class inheriting from QGraphicsLineItem and as soon as I override the paint method, it looks like Qt starts painting it at every "main loop", instead of drawing according to some events (like moving the item, etc). Does anyone know more about the good practices when inheriting from a QGraphicsItem ? I look at other projets' code and it looks like it does not come from my paint method. I was thinking that maybe I'm doing something wrong in the paint method that changes the items

QFileDialog: is it possible to filter only executables (under Linux)?

痴心易碎 提交于 2019-12-22 10:43:24
问题 I want to use QFileDialog to have the user select an executable. The dialog should show only actual executables, aside from directories. My Windows version works just fine, simply checking if the extension is exe. However, in Linux, I don't manage to do it as I want. In C++, my attempt looked like this: QString target_dir = ... QFileDialog file_dialog; file_dialog.setFilter(QDir::Executable | QDir::Files); QString file = file_dialog.getOpenFileName(this, tr("Open Exectuable"), target_dir);

In Qt, how do you properly implement delegates?

故事扮演 提交于 2019-12-22 10:11:28
问题 I followed the model/view/controller paradigm. I am pretty sure that the model and view are right, but I think I'm doing some things wrong in my delegate. Everything "works", except the first click to a control just "lights up the control" and the second one interacts with it. Is this how delegates are usually implemented? My implementation requires a lot of construction and destruction (hidden by scoped_ptr) so any tips on that are also helpful. QWidget *ParmDelegate::createWidget(const

Simple way to embed a QDialog into a QWidget

﹥>﹥吖頭↗ 提交于 2019-12-22 09:34:40
问题 I have been searching for a simple way to embed QDialog instances in a QWidget , but all I found used OpenGL or some rather complex stuff to achieve that. Actually, all the examples I found tried to achieve many more things than simply embed the QDialog . So, I am wondering: is there a simple and clean way to embed a QDialog in a QWidget ? P.S.: I tagged pyqt since it's what I'm using, but I will of course accept c++ answers :) Here is a screen capture of the piece of software I have to port

Qt->QGraphicsView->QGraphicsItem resizing

泪湿孤枕 提交于 2019-12-22 08:53:53
问题 I'm pretty new to QGraphicsView in Qt. As far as I can tell there is no built in way to resize a QGraphicsItem in a scene with a mouse. What I'm looking for is to be able to resize a QGraphicsRectItem by either dragging out the corners or the edges on screen. Is there a simple way to do that? Is there a library or a piece of code somewhere online that implements this functionality? I'm currently using Qt 4.5.1. 回答1: I guess this thread has a similar question. You will have to manually resize

QtableWidget: How to find value in specific column

旧街凉风 提交于 2019-12-22 08:43:06
问题 I need to check wether a specific value is in a specific column using qtablewidget. In my case I need to check the first column wether an ID is allready existing, if yes I need the number of the containing row to update this row otherwise I like to add the row. Is there any solution provided by QT to check the column or shou 回答1: I assume that you are looking for your value in first column (that why second argument in item(int,int) is 0) and table name is myQTableWidget int rows =

QAction: No such file or directory

怎甘沉沦 提交于 2019-12-22 06:58:34
问题 I'm getting the error QAction: No such file or directory when I try to compile a project for plugin (C++ Library template). Weird, because I have a project for my app which also includes this header and there is no error. What might cause this? 回答1: Make sure that you have the right include paths set up. If you use QMake the *.pro should contain these settings if you want to include files from QtGui . They should be set by default but some templates may not set them. CONFIG += qt QT += gui If