qt4

Qt piping data between plugins

前提是你 提交于 2019-12-12 03:25:22
问题 I'm developing an app based on plugins, following the Echo Plugin Example. So far so good. Now I'm at a point where I would like to pipe data between plugins. I have one plugin which establishes a network connection using QTcpSocket and I have another plugin in which I would like to display the data in a QTextEdit . How do I pipe the data between plugins? If both where simple objects I will do simple signal slot connection, but since the interface of plugins doesn't derive from QObject it's

Excel with Qt: find number last filled row

我只是一个虾纸丫 提交于 2019-12-12 03:16:28
问题 I have opened excel sheet in Qt and trying to get number of rows and columns filled (if all filled continuous) with this code : QString file = QFileDialog::getOpenFileName(this,"Open file"); QAxWidget excel("Excel.Application"); excel.setProperty("Visible", true); QAxObject * workbooks = excel.querySubObject("WorkBooks"); QAxObject* workbook = workbooks->querySubObject( "Open(const QString&)", file ); sheets = workbook->querySubObject( "Worksheets" ); QAxObject* sheet = sheets->querySubObject

Python - PyQt4 (Webkit) How to set value of input(type=“file” multiple=“”)?

早过忘川 提交于 2019-12-12 02:44:41
问题 I'm trying to upload a file using QWebPage module of (WebKIt) like this. <form action="#"> Select a file: <input type="file" id="photos_upload_input" multiplie=""> <input type="submit"> </form> I try it: class WebPage(QWebPage): def __init__(self, parent = None): QWebPage.__init__(self) self.overrideUpload = None def extension(self, extension, option, output): ''' The behavior of this function is determined by extension . The option and output values are typically casted to the corresponding

Printing complex widgets in Qt

那年仲夏 提交于 2019-12-12 02:23:36
问题 I have a complex widget with tons of different subwidgets, e.g. subclasses of QLabel. I want to print this widget, but obviously I do not want to print the background, I want to print with differing text colors or have the style of frames slightly modified. As I do not really want to iterate through all subwidgets with a special "print" function, which I would need to attach to all widgets (how to add "print" to a QLabel?), I would like to use paintEvent. If I have a hierarchy MyWidget ->

Qt, QPlainTextEdit and non-printable characters

[亡魂溺海] 提交于 2019-12-12 02:19:06
问题 I wonder if there is any possibility to render special characters (0-31 ASCII, for example) my own way in Qt/QPlainTextEdit? I want to render them as small rectangles as seen in this screenshot: ...or as Notepad++ is doing it. My goal is to be able see all characters. So if a character fails to render with current font (there is no such char for example), a small square should be rendered instead. 回答1: Qt does have ways to represent non-characters in QTextDocument which is used in QTextEdit

QGLWidget updateGL() doesn't update with QTimer?

痞子三分冷 提交于 2019-12-12 01:35:26
问题 I have a 'QTimer' object and want to update 'QGLWidget' repeatedly in a given time interval. My problem is that ,content doesn't get updated ,when I call updateGL() method of 'QGLWidget'. Here's how I init the QTimer, rotationTimer=new QTimer(); rotationTimer->setInterval(500); QObject::connect(rotationTimer, SIGNAL(timeout()), this, SLOT(slotAutoRotate()),Qt::QueuedConnection); in the slotAutoRotate(), void RzState3DCurveSelect::slotAutoRotate() { RzStateMachine3DCurves *sm3d =

Help Integration in Qt/C++ Application

为君一笑 提交于 2019-12-12 01:32:47
问题 I am using Qt 4.6 so do C++. I have a User Manual ( .chm ) for my application which has the help required for the users to run the application. Now I want this help to be integrated into my application , so that when the user selects for help from the application, the user manual will be opened with the corresponding help page displayed . In this way I can make use of the already available manual and users will find easy to probe through the document. ( since it is familiar ) The user manual

How to style PushButton's image size on hover/pressed in Qt4 using CSS

拥有回忆 提交于 2019-12-12 00:44:46
问题 I want to have a QPushButton where the image resizes on hovering with the mouse. The following works for QToolButton: QToolButton { border: 0px; } QToolButton:hover { padding: 2px; } QToolButton:pressed { padding: 4px; } ... the image gets resized (because padding changed). But when applying this to a QPushButton, it fails (image does not resize). I did it the same way: QPushButton { border: 0px; } QPushButton:hover { padding: 2px; } QPushButton:pressed { padding: 4px; } When the border is

FLTK applications in Cygwin: GUI doesn't show?

半城伤御伤魂 提交于 2019-12-12 00:42:40
问题 #include <FL/Fl.H> #include <FL/Fl_Window.H> int main() { Fl_Window win(400, 400); win.show(); return Fl::run(); } I'm compiling with "fltk-config --compile main.cpp". The code compiles without incident, but when the application is run I only get a console window and no GUI. I've also tried using fluid from terminal (via "fluid main.cpp"); I'm not even sure I'm using this correctly since, as I understand, fluid is a graphical editor. In any case, the result is "Can't open display: ". I found

Qt 4.7 + VTK 5.6.1 on Mac OS X 10.6: errors linking projects

拟墨画扇 提交于 2019-12-11 23:48:48
问题 I'm UNSUCCESSFULLY trying to build the Qt + VTK examples included in VTK's 5.6.1 distribution (.../VTK/Examples/GUI/Qt/). Here's what I'm using: - VTK distribution: 5.6.1 - Qt IDE: Qt creator 2.7.1 (based on Qt 4.7.0) - Mac OS X version: 10.6.6 Also in the .pro project file on Qt I've included my vtk headers and lib directories: INCLUDEPATH += /Users/catamigue/Documents/Migue/Developer/bin/vtk561/include/vtk-5.6 LIBS += -L/Users/catamigue/Documents/Migue/Developer/bin/vtk561Dyn/lib/vtk-5.6