QAxWidget : js怎么向qtqt父窗口传值给子窗口

QAxWidget Class
class is a
that wraps an ActiveX control.
Header: #include &QAxWidget&
Public Functions
(QWidget * parent = 0, Qt::WindowFlags f = 0)
(const QString & c, QWidget * parent = 0, Qt::WindowFlags f = 0)
(IUnknown * iface, QWidget * parent = 0, Qt::WindowFlags f = 0)
virtual QAxAggregated * ()
bool (const QString & verb)
Reimplemented Public Functions
virtual void ()
virtual QSize () const
virtual QSize () const
220 public functions inherited from
19 public functions inherited from
29 public functions inherited from
12 public functions inherited from
Protected Functions
virtual bool (bool initialized)
bool (bool initialized, const QByteArray & data)
virtual bool (int message, int keycode) const
Reimplemented Protected Functions
virtual void (QEvent * e)
virtual void (const char * signal)
virtual bool (IUnknown ** ptr)
virtual void (QResizeEvent *)
37 protected functions inherited from
5 protected functions inherited from
8 protected functions inherited from
1 protected function inherited from
Additional Inherited Members
58 properties inherited from
1 property inherited from
1 property inherited from
19 public slots inherited from
1 public slot inherited from
1 signal inherited from
3 signals inherited from
1 signal inherited from
4 static public members inherited from
7 static public members inherited from
1 protected slot inherited from
Detailed Description
class is a
that wraps an ActiveX control.
can be instantiated as an empty object, with the name of the ActiveX control it should wrap, or with an existing interface pointer to the ActiveX control. The ActiveX control's properties, methods and events which only use
supported data types, become available as Qt properties, slots and signals. The base class
provides an API to access the ActiveX directly through the IUnknown pointer.
and can mostly be used as such, e.g. it can be organized in a widget hierarchy and layouts or act as an event filter. Standard widget properties, e.g.
are supported, but it depends on the ActiveX control to implement support for ambient properties like e.g. palette or font.
tries to provide the necessary hints.
However, you cannot reimplement Qt-specific event handlers like
and expect them to be called reliably. The embedded control covers the
completely, and usually handles the user interface itself. Use control-specific APIs (i.e. listen to the signals of the control), or use standard COM techniques like window procedure subclassing.
also inherits most of its ActiveX-related functionality from , notably () and ().
Warning: You can subclass , but you cannot use the Q_OBJECT macro in the subclass (the generated moc-file will not compile), so you cannot add further signals, slots or properties. This limitation is due to the metaobject information generated in runtime. To work around this problem, aggregate the
as a member of the
See also , , , and .
Member Function Documentation
QAxWidget::QAxWidget( * parent = 0, Qt::WindowFlags f = 0)
Creates an empty
widget and propagates parent and f to the
constructor. To initialize a control, call ().
QAxWidget::QAxWidget(const
* parent = 0, Qt::WindowFlags f = 0)
Creates an
widget and initializes the ActiveX control c. parent and f are propagated to the
contructor.
See also ().
QAxWidget::QAxWidget(IUnknown * iface,
* parent = 0, Qt::WindowFlags f = 0)
that wraps the COM object referenced by iface. parent and f are propagated to the
contructor.
QAxWidget::~QAxWidget()
Shuts down the ActiveX control and destroys the
widget, cleaning up all allocated resources.
See also ().
[virtual protected] void QAxWidget::changeEvent( * e)
Reimplemented from ().
[virtual] void QAxWidget::clear()
Reimplemented from ().
Shuts down the ActiveX control.
[virtual protected] void QAxWidget::connectNotify(const char * signal)
Reimplemented from ().
* QAxWidget::createAggregate()
Reimplement this function when you want to implement additional COM interfaces for the client site of the ActiveX control, or when you want to provide alternative implementations of COM interfaces. Return a new object of a
The default implementation returns the null pointer.
[virtual protected] bool QAxWidget::createHostWindow(bool initialized)
Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false. If initialized is true the control has already been initialized.
This function is called by (). If you reimplement initialize to customize the actual control instantiation, call this function in your reimplementation to have the control embedded by the default client side. Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false.
[protected] bool QAxWidget::createHostWindow(bool initialized, const
Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false. If initialized is false the control will be initialized using the data. The control will be initialized through either IPersistStreamInit or IPersistStorage interface.
If the control needs to be initialized using custom data, call this function in your reimplementation of (). This function is not called by the default implementation of ().
This function was introduced in
bool QAxWidget::doVerb(const
Requests the ActiveX control to perform the action verb. The possible verbs are returned by ().
The function returns true if the object could perform the action, otherwise returns false.
This function was introduced in
[virtual protected] bool QAxWidget::initialize(IUnknown ** ptr)
Reimplemented from ().
Calls (ptr), and embeds the control in this widget by calling (false) if successful.
To initialize the control before it is activated, reimplement this function and add your initialization code before you call (true).
This function was introduced in
QAxWidget::minimumSizeHint() const
Reimplemented from ().
[virtual protected] void QAxWidget::resizeEvent( *)
Reimplemented from ().
QAxWidget::sizeHint() const
Reimplemented from ().
[virtual protected] bool QAxWidget::translateKeyEvent(int message, int keycode) const
Reimplement this function to pass certain key events to the ActiveX control. message is the Window message identifier specifying the message type (ie. WM_KEYDOWN), and keycode is the virtual keycode (ie. VK_TAB).
If the function returns true the key event is passed on to the ActiveX control, which then either processes the event or passes the event on to Qt.
If the function returns false the processing of the key event is ignored by , ie. the ActiveX control might handle it or not.
The default implementation returns true for the following cases:
WM_SYSKEYDOWNWM_SYSKEYUPWM_KEYDOWN
All keycodesVK_MENUVK_TAB, VK_DELETE and all non-arrow-keys in combination with VK_SHIFT, VK_CONTROL or VK_MENU
This table is the result of experimenting with popular ActiveX controls, ie. Internet Explorer and Microsoft Office applications, but for some controls it might require modification.
(C) 2016 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.
The documentation provided herein is licensed under the terms of the
as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd.
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners.要求:用qt版开发一个桌面程序,该程序有一个界面,用来显示一个采用silverlight开发的web页面。
分析:在qt中实现web显示,根据qt的版本和对应编译器的版本,有如下选择:
(1)5.6以下的版本,基于QtWebkit
(2)5.6以上的MSVC版本,移除了QtWebkit 模块,可采用基于 Chromium 的浏览器引擎 Qt WebEngine
(3)5.6以上的mingw 版本,没有Qt WebEngine ,只能采用QAxWidget 控件
问题:用QtWebkit或Qt WebEngine,都不支持silverlight ,而QAxWidget 可以。
所以,不得不采用QAxWidget控件实现。
下面就使用QAxWidget来开发一个简单的web browser。该程序只有一个对话框,上面是一个地址框,下面是QAxWidget控件,在地址框中输入地址,单击Enter键,就显示该网址的内容。
1 在qtcreator中新建一个基于Dialog的程序:WebBrowser。
2 在.pro文件中加入axcontainer
axcontainer
3 dialog.h
#ifndef DIALOG_H
#define DIALOG_H
#include &QDialog&
#include &QLineEdit&
#include &ActiveQt/QAxWidget&
namespace Ui {
class Dialog : public QDialog
explicit Dialog(QWidget *parent = 0);
~Dialog();
private slots:
void loadNavigate();
Ui::Dialog *
QLineEdit *lineU
QAxWidget* webW
#endif // DIALOG_H
4 dialog.cpp
#include "dialog.h"
#include "ui_dialog.h"
#include &QVBoxLayout&
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
ui-&setupUi(this);
lineUrl = new QLineE
lineUrl-&setText("");
connect(lineUrl,SIGNAL(returnPressed()),this,SLOT(loadNavigate()));
webWidget = new QAxW
//设置ActiveX控件为IEMicrosoft Web Browser
//设置ActiveX控件的id,最有效的方式就是使用UUID
//此处的{A-11D0-A96B-00C04FD705A2}就是Microsoft Web Browser控件的UUID
webWidget-&setControl(QString::fromUtf8("{A-11D0-A96B-00C04FD705A2}"));
webWidget-&setObjectName(QString::fromUtf8("webWidget"));//设置控件的名称
webWidget-&setFocusPolicy(Qt::StrongFocus);//设置控件接收键盘焦点的方式:鼠标单击、Tab键
webWidget-&setProperty("DisplayAlerts",false); //不显示任何警告信息。
webWidget-&setProperty("DisplayScrollBars",true); // 显示滚动条
QVBoxLayout *mainLayout = new QVBoxL
mainLayout-&addWidget(lineUrl);
mainLayout-&addWidget(webWidget);
setLayout(mainLayout);
setWindowState(Qt::WindowMaximized);//最大化
Dialog::~Dialog()
void Dialog::loadNavigate()
QString sUrl = lineUrl-&text().trimmed();
webWidget-&dynamicCall("Navigate(const QString&)",sUrl);
5 运行结果
阅读(...) 评论()QAxWidget Class | Active Qt 5.9
QAxWidget Class
class is a
that wraps an ActiveX control.
Header: #include &QAxWidget&
qmake: QT += axcontainer Inherits:
Public Functions
(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags())
(const QString &c, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags())
(IUnknown *iface, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags())
virtual QAxAggregated *()
bool (const QString &verb)
Reimplemented Public Functions
virtual void ()
virtual QSize () const
virtual QSize () const
214 public functions inherited from
19 public functions inherited from
32 public functions inherited from
14 public functions inherited from
Protected Functions
virtual bool (bool initialized)
bool (bool initialized, const QByteArray &data)
virtual bool (int message, int keycode) const
Reimplemented Protected Functions
virtual void (QEvent *e)
virtual void (const QMetaMethod &signal)
virtual bool (IUnknown **ptr)
virtual void (QResizeEvent *)
35 protected functions inherited from
5 protected functions inherited from
9 protected functions inherited from
1 protected function inherited from
Additional Inherited Members
59 properties inherited from
1 property inherited from
1 property inherited from
19 public slots inherited from
1 public slot inherited from
3 signals inherited from
3 signals inherited from
2 signals inherited from
5 static public members inherited from
11 static public members inherited from
1 protected slot inherited from
Detailed Description
class is a
that wraps an ActiveX control.
can be instantiated as an empty object, with the name of the ActiveX control it should wrap, or with an existing interface pointer to the ActiveX control. The ActiveX control's properties, methods and events which only use
supported data types, become available as Qt properties, slots and signals. The base class
provides an API to access the ActiveX directly through the IUnknown pointer.
and can mostly be used as such, e.g. it can be organized in a widget hierarchy and layouts or act as an event filter. Standard widget properties, e.g.
are supported, but it depends on the ActiveX control to implement support for ambient properties like e.g. palette or font.
tries to provide the necessary hints.
However, you cannot reimplement Qt-specific event handlers like
and expect them to be called reliably. The embedded control covers the
completely, and usually handles the user interface itself. Use control-specific APIs (i.e. listen to the signals of the control), or use standard COM techniques like window procedure subclassing.
also inherits most of its ActiveX-related functionality from , notably () and ().
Warning: You can subclass , but you cannot use the Q_OBJECT macro in the subclass (the generated moc-file will not compile), so you cannot add further signals, slots or properties. This limitation is due to the metaobject information generated in runtime. To work around this problem, aggregate the
as a member of the
See also , , , and .
Member Function Documentation
QAxWidget::QAxWidget( *parent = Q_NULLPTR,
f = Qt::WindowFlags())
Creates an empty
widget and propagates parent and f to the
constructor. To initialize a control, call ().
QAxWidget::QAxWidget(const
*parent = Q_NULLPTR,
f = Qt::WindowFlags())
Creates an
widget and initializes the ActiveX control c. parent and f are propagated to the
contructor.
See also ().
QAxWidget::QAxWidget(IUnknown *iface,
*parent = Q_NULLPTR,
f = Qt::WindowFlags())
that wraps the COM object referenced by iface. parent and f are propagated to the
contructor.
QAxWidget::~QAxWidget()
Shuts down the ActiveX control and destroys the
widget, cleaning up all allocated resources.
See also ().
[virtual protected] void QAxWidget::changeEvent( *e)
Reimplemented from ().
[virtual] void QAxWidget::clear()
Reimplemented from ().
Shuts down the ActiveX control.
[virtual protected] void QAxWidget::connectNotify(const
Reimplemented from ().
*QAxWidget::createAggregate()
Reimplement this function when you want to implement additional COM interfaces for the client site of the ActiveX control, or when you want to provide alternative implementations of COM interfaces. Return a new object of a
The default implementation returns the null pointer.
[virtual protected] bool QAxWidget::createHostWindow(bool initialized)
Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false. If initialized is true the control has already been initialized.
This function is called by (). If you reimplement initialize to customize the actual control instantiation, call this function in your reimplementation to have the control embedded by the default client side. Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false.
[protected] bool QAxWidget::createHostWindow(bool initialized, const
Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false. If initialized is false the control will be initialized using the data. The control will be initialized through either IPersistStreamInit or IPersistStorage interface.
If the control needs to be initialized using custom data, call this function in your reimplementation of (). This function is not called by the default implementation of ().
This function was introduced in
bool QAxWidget::doVerb(const
Requests the ActiveX control to perform the action verb. The possible verbs are returned by ().
The function returns true if the object could perform the action, otherwise returns false.
This function was introduced in
[virtual protected] bool QAxWidget::initialize(IUnknown **ptr)
Reimplemented from ().
Calls (ptr), and embeds the control in this widget by calling (false) if successful.
To initialize the control before it is activated, reimplement this function and add your initialization code before you call (true).
This function was introduced in
QAxWidget::minimumSizeHint() const
Reimplemented from ().
[virtual protected] void QAxWidget::resizeEvent(QResizeEvent *)
Reimplemented from ().
QAxWidget::sizeHint() const
Reimplemented from ().
[virtual protected] bool QAxWidget::translateKeyEvent(int message, int keycode) const
Reimplement this function to pass certain key events to the ActiveX control. message is the Window message identifier specifying the message type (ie. WM_KEYDOWN), and keycode is the virtual keycode (ie. VK_TAB).
If the function returns true the key event is passed on to the ActiveX control, which then either processes the event or passes the event on to Qt.
If the function returns false the processing of the key event is ignored by , ie. the ActiveX control might handle it or not.
The default implementation returns true for the following cases:
WM_SYSKEYDOWNWM_SYSKEYUPWM_KEYDOWN
All keycodesVK_MENUVK_TAB, VK_DELETE and all non-arrow-keys in combination with VK_SHIFT, VK_CONTROL or VK_MENU
This table is the result of experimenting with popular ActiveX controls, ie. Internet Explorer and Microsoft Office applications, but for some controls it might require modification.
& 2017 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.
The documentation provided herein is licensed under the terms of the
as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd.
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners.编写HelloWorld.cpp文件 #include &QApplication& #include &QLabel& int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel label(&Hello, world&); label.show(); return app.exec(); } 程序写好后,执行 qmake -project , 生成一个与平台无关的HelloW
专业的网页设计是既复杂又耗时的.它需要HTML和CSS框架的完美结合.这些框架不仅可以为设计方案增加特定的功能,还可以大大地节省时间和精力. 高效的框架不仅是网站设计的基础,它提供的各种丰富多彩的功能,还提高整体的功能和性能.一个网站的外观和设计完全可以通过一些完美和可靠的工具而彻底改头换面.现在,越来越多的网页设计师和编辑人员选择使用CSS框架来创建网站. 所以,如果你正在寻找一些高效的HTML和CSS框架,那么不妨继续看下去--众里寻他千百度,蓦然回首,那人却在灯火阑珊处. 1)CSS框架-
对于普通用户,各种各样有趣的App是一种重要的商品,所以我们经常会到App Store里下载或者购买各种App.对于开发者而言,&算法&其实也是这样一种商品.Algorithmia是一个非常有趣的平台,它用App Store的模式为&算法&量身打造了一个类似的应用商店,让开发者可以到这个商店里发布自己的算法,或者寻找并购买自己需要实现的算法. 算法对开发有多重要应该不用多说吧.实际上,算法代表了一个人对解决某类问题的思想成果.这种学术性的知识每天都在产生,但算法的&
最近在学习Qt使用QSS样式美化窗口部件的内容.发现在对QWidget应用background-image改变窗口背景图片时,QWidget的窗口背景并未生效.工程建立如下: 1.新建 Qt Application 工程 2.窗口选择从 QWidget 继承 3.最后生成的工程目录 4.工程源文件如下 main.cpp #include &qwdg_backimage.h& #include &QtGui/QApplication& int main(int argc, c
因为提供的程序数据库对于非程序员来说是隐藏的,所以需要生成一个报表信息给其他人分析使用. .mode csv .head on select ... ; 将查询的数据导出到文件,然后将后缀改为csv就行了,比较方便实用. 程序里为了图少些代码,所以将这些东西写到脚本里 如tmep.sql,然后调用sqlite3 database.db &temp.sql &file.csv 解决用户数据导出问题.
需要使用sqlite里的password对某个字段进行加密,由于使用的sqlite是由QT封装好的QSqlDatabase,没有发现加载扩展函数的方法,所以自己实现了一个. 在网上也没找到相应的参考,就自己查官方文档解决了.本篇文章主要是sqlite如何加载外部的函数,并没有password函数的实现,我将写好的函数生成了一个动态库,由程序动态加载. #include &iostream& #include &QString& #include &QtSql/QSqlQuer
卡在:编译 qtbase/src/gui/image/qpnghandler.cpp时报错: .obj/qpnghandler.o: In function `QPngHandlerPrivate::readPngHeader()': qpnghandler.cpp:(.text+0xbe2): undefined reference to `png_set_longjmp_fn' .obj/qpnghandler.o: In function `QPNGImageWriter::writeIm
在项目使用中我们常常需要一个自动增长的主键,比如加上AUTOINCREMENT约束使一个主键在每次插入数据时增长.由于一般而言你建立一个表会默认有一个成为ROWID的字段(除非声明为 without rowid),所以你添加的integer primary key其实就是rowid的别名而已,但是如果你加了autoincrement的约束以后,数据库引擎生成rowid的算法会发生相应的改变. 他们的生成算法如下 integer primary key: 获取当前column最大的值,如果没有达到
下面想象一个这样的场景,你的数据库有一个表中储存有用户信息,姑且称为user表. .schema user CREATE TABLE user(id integer,name text,telphone text,unique(id)); 表user中储存有 id: 相当于用户的实际ID,唯一 name: 用户的用户名,供显示或者登录的时候使用 telphone:一个附加信息,电话号码 一般我们程序中还会有一个储存用户数据的表,这里引用为data表,里面储存的是一些用户数据,完全可以自定义.在多
声明:不知为何,从EverNote复制过来的文章在开源中国的博客编辑器无法显示图片,完整版已转到ChinaUnix,请原谅.地址:http://blog.chinaunix.net/uid--id-4555470.html 简介: Qt SQL 是 Qt 的重要模块之一,为了方便,Qt 对 SQL 进行了一系列的封装,并将 SQL API 分为如下三层: (1)驱动层 (2)SQL API 层 (3)用户接口层 目录: 一.使用前提 二.数据库类 三.连接到数据库 · SQL 数
项目做到一定阶段,经常需要在原来的工程上调用外部程序.Qt为此提供了QProcess类,QProcess可用于完成启动外部程序,并与之交互通信. 一.启动外部程序的两种方式: (1)一体式:void QProcess::start(const QString & program, const QStringList & arguments, OpenMode mode = ReadWrite) 外部程序启动后,将随主程序的退出而退出. (2)分离式:void QProcess::start
用此段代码查出问题所在 QPluginL loader.setFileName(&/Users/danny/Qt5.3.2/5.3/clang_64/plugins/sqldrivers/libqsqlmysql.dylib&); //loader.setFileName(&/Users/danny/Qt5.3.2/5.3/Src/qtbase/plugins/sqldrivers/libqsqlmysql.dylib&); if(load
signal/slot在底层会使用三种方式传递消息.参见QObject::connect()方法: bool QObject::connect ( const QObject * sender, const char * signal, const QObject * receiver, const char * method, Qt::ConnectionType type = Qt::AutoCompatConnection ) 最后一个参数是就是传递消息的方式了,有四个取值: Qt::Di
下面转一个相关说明吧 实例代码1: class MThread :public QThread { public: MThread(); ~MThread(); virtual void run(); void foo(); ... }; POINT 1:QThread类的实例与普通类的实例没什么不同,只是运行着的run()函数会不同 实例代码2: class MDialog :public QDialog { ... MThread * }; MDialog::MDialog
新的线程run里面一定要有exec的调用,否则无法接受消息的. class myQThr : public QThread { Q_OBJECT public: myQThr(QObject *in = NULL) :QThread(in) { WrTimer = new QTimer(this); connect(WrTimer, SIGNAL(timeout()), this, SLOT(TimerOutWr1()), Qt::DirectConnection); WrTimer-&star
重写父类的按键事件 // 让backspace拥有esc键的功能 void messageBox::keyPressEvent(QKeyEvent *event) { switch(event-&key()) { case Qt::Key_Backspace: { QKeyEvent key(QEvent::KeyPress, Qt::Key_Escape, Qt::NoModifier); QMessageBox::keyPressEvent(&key); } default
一.综述 Qt企业版(Qt Enterprise)主要包括: 更完整的Qt库 Qt Creator Enterprise IDE 商业授权 Digia公司的技术支持 Qt云服务 二.企业版的功能特性 参看官方文档. 2.1 Charts Charts是QT提供的图表模块.他提供了非常简便的APIs来绘制令人惊叹的Line, Spline,Area,Scatter,Pie,Donut,Bar,Polar和Box-and-Whiskers表. 支持Qt5/Qt4.8/Qt4.7. C++和Qt Qu
MultiPointTouchArea MultiPointTouchArea为qml中的多点触摸提供了最基本.最重要的支持,它与TouchPoint及相关域结合,可以说是qml中多点触摸的基石. MultiPointTouchArea是不可见元素.它用来跟踪多点触摸.从Item继承过来的enabled用来标识触点操作是否有效.MultiPointTouchArea有两种使用方式: setting touchPoints to provide touch point objects with p
1.QtQuick 1 vs QtQuick2 二者还是有很大区别的,无论从模块重组还是从底层实现,均需注意.下面是两个官方文档给出的差别说明及列表: 差别说明 差别列表 2.Qt.labs.gestures 虽然没有正式的Release模块(Types in the Qt.labs module are not guaranteed to remain compatible in future versions.),但在qt4.8中,提供了一个gesture特性的试验模块. 此外,还有一个开发
PinchArea 可以参看PinchArea文档.下面是SDK自带的demo.通过此demo可以了解PinchArea的使用. PinchArea实现了&挤压&操作. 要点:在PinchArea中可以使用一个内置的pinch参数.这个参数是一个PinchEvent实例(instance). 而pinch内置参数中,有一个target属性用来标识被控对象的. 使用 pinch.target 这种方式,你什么都不用关心,甚至不需要弄明白 pinch 属性到底是什么含义,就可以得到一个不错
多点触摸编程模型 目前主流支持多点触摸的操作系统所采用的多点触摸编程模型基本一致.模型将一个或多个和屏幕接触的手指识别为多点触摸序列的一部分.序列从第一个手指接触屏幕开始,以最后一个手指离开屏幕为结束. 模型通过多点触摸序列跟踪与屏幕接触的手指,记录手指在屏幕上的位置和接触时间.模型会发送两种类型的事件供应用程序调用. 一种是直接将手指的触摸信息包括位置.时间戳.关联视图等作为事件提供给应用程序,应用程序自己提供处理逻辑对触摸信息进行处理: 一种是模型将特定组合的触摸识别为手势提供给应用程序,应
问题1:Qt 5.2 使用原来的QT4.8.4项目时QWebView .QWebFrame等类无法编译通过. 出现原因:QWebView .QWebFrame.QWebPage.QWebInspector等这些类被单独移到了QtWebKitWidgets模块,不再在QtWebKit模块当中:而QWebHistory等类仍然保留在QtWebkit模块中. 解决方法:使用到QWebPage等webkit相关可视部件的,Qt5.2单独放到了QtWebKitWidgets模块中,所以在使用了QWebPa
第一个例子是使用c++编写的一个Find对话框.通过这一 过程,就可以让对话框拥有自己的信号和槽. 第一步是对窗口的草图和布局进行设计 第二步是定义和实现相应的窗口类 #ifndef FINDDIALOG_H #define FINDDIALOG_H #include &QDialog& class QCheckB class QL class QLineE class QPushB class FindDialog : public QDialog { Q
Welcome to Qt 5 =============== Qt is a cross-platform application and user interface framework. It consists of a number of software libraries and development tools. Qt is developed as an open source project. It is available under both open source an
新建hello目录,新建hello.cpp文件 Hello.cpp #include&QApplication& //包含类QApplication的定义 #include&QLabel& //包含类QLabel的定义 int main(int argc, char *argv[]) { //创建一个QApplication对象,用来管理整个应用程序所用到的资源 QApplication app(argc, argv); //创建一个显示&Hello Qt&的Q
使用方法是本文要讲述的内容,前面介绍了一篇常用的类,而这篇介绍的是主要类.也是我们经常用到的! QApplication 应用程序类 管理图形用户界面应用程序的控制流和主要设置 QLabel 标签类 提供文本或者图像的显示 QPushButton 按钮类 提供了命令按钮 按钮的一种 QButtonGroup 按钮组合类 按钮组,提供了相关按钮的组合 QGroupBox 群组类 一个有标题的组合框 QDateTimeEdit 日期时间编辑框类 QLineEdit 行编辑框类 单行文本编辑器 QTe
QML是一种描诉性的脚本语言,文件格式以.qml结尾.语法格式非常像CSS,但又支持javacript形式的编程控制. 我个人认为它结合了QtDesigner UI和QtScript的有点. QtDesigner可以设计出.ui界面文件,但是不支持和Qt原生C++代码的交互.QtScript可以和Qt原生代码进行交互,但是有一个缺点,如果要在脚本中创建一个继承于QObject的图形对象非常不方便,只能在Qt代码中创建图形对象,然后从QtScript中进行访问. 而QML可以在脚本里创建图形对象,
程序共包含以下有一个文件: //: main.cpp #include &process.h& #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QTextCodec::setCodecForTr(QTextCodec::codecForLocale()); QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale(
//修改doc QString filepath=&e:\\aa.doc&; QAxWidget *word = new QAxWidget(&Word.Application&); QAxObject *document =word-&querySubObject(&Documents&); document-&dynamicCall(&Open(const QString&)&,QString(file
PyQt4教程: /books/PyQt4_Tutorial/index.html
this-&setWindowFlags(Qt::FramelessWindowHint);//去掉标题栏
发布方式 Qt发布的时候,通常使用两种方式: (1)静态编译 (2)动态编译 静态编译:把相关联的库一并引入可执行程序,虽然发布简单,但可执行程序较大... 动态编译:相关联的库,以dll的形式引用,不被包含进可执行程序,发布不方便,但可执行程序较小... 静态发布虽然不需要较多的dll,发布简单.方便,但是往往会牵扯到授权问题(详情请查看Qt LGPL授权),动态发布则可以避免...如果附带了Qt的dll,就相当于发布了Qt的dll,而这些库是属于Qt的,这足以保证使用者知道程序使用了LGPL
1.undefined reference to `_imp___ZN12QSqlDatabase11addDatabaseERK7QStringS2_' 解决:.pro中增加一行 QT +=sql
Qt for windows7-64bit 在电脑上安装mingw(搜索mingw for windows),将C:\MinGW\bin添加进环境变量,打开命令行输入gcc --version和g++ --version和mingw32-make --version验证安装成功 解压qt-everywhere-opensource-src-4.8.1.tar.gz并进入目录 configure -debug-and-release -opensource -platform win32-g++
QSqlQuery::value: not positioned on a valid record 原因: 在执行修改QTableView中数据后的提交,加入事务处理的时候遇到这个错误的时候 当时一直以为是以为QSqlQuery 跟 QSqlTableModel 中间数据插入或者删除出现了问题 猛然回首 发现在TableView中执行了removeRow某一行 修改成hide后就消失了错误 总结: 对于QSqlQuery 以及 QSqlTableView 理解不够深入 QSqlQuery类提供
写了这么多的博客,关于网络的还不算多,经常有人询问一些关于网络传输.制作在线试听及下载音乐.构造及解析数据等的一些问题,今天就在这里一并讲解. 网络操作: 主要涉及:QNetworkAccessManager.QNetworkRequest.QNetworkReply这三个类. 参考: Qt实现网络数据传输. 数据操作: 主要涉及:Json.XML(因为数据传输都是有固定格式的,大多数使用Json).操作Json使用QJsonDocument.QJsonObject.QJsonArray.操作X
QT总的来说是一个易学易用的库, 但是QT的多线程使用确实容易犯错,尤其是结合上异步的网络访问,谁用谁知道.我觉得核心是一句话,QThread要当作线程控制块用,不要以为派生一个QThread的子类,里面的东西都跑在新的线程里了,只有run()里的是这样. 下面这篇文章我觉得讲的很好,深入解析QT的线程用法,文章有点长,但是值得一读. 原文在 http://qt-project.org/wiki/ThreadsEventsQObjects 译文在 /b
QtSerialPort 简介 QtSerialPort模块是Qt5库的附加部分,为硬件和虚拟的串口提供了统一的接口.注意:该模块也增加了对Qt4的支持. 串口由于其简单和可靠,目前在像嵌入式系统,机器人等工业中依旧用得很多.使用QtSerialPort模块,开发者可以大大缩短开发串口相关的应用程序的周期.使用QtSerialPort模块最初是来源于第三方库QSerialDevice(2.0分支),现在QtSerialPort已经移到了https://codereview.qt-project.
我们已经在Ubuntu上安装了PC版的QT,安装命令如下 sudo apt-get install qt4-* 现在我们需要安装qt在arm上运行的交叉编译环境. 1.从qt官方网站下载QT源码, 我们需要下载的是qt-embedded-linux-opensource-src-4.5.3.tar.gz 2.解压并改名 1 2 3 tar zxvf qt-embedded-linux-opensource-src-4.5.3.tar.gz mv qt-embedded-linux-opensou
1. 搜索:在终端查找Qt4的开发工具,输入下面的命令: $ apt-cache search qt4-dev-tools 然后结果可能如下: pyqt4-dev-tools - Development tools for PyQt4 qmf-doc - Qt Messaging Framework (QMF) - QCH documentation qt4-dev-tools - Qt 4 development tools qt4-doc - Qt 4 API documentation 2
The first warning/Error I see is- QtGui/QApplication: No such file or directory Which I solved by changing the include to #include &QGuiApplication&
其实东西真的很简单...只是当时还年轻. 代码已经分享了: /code/snippet_45 对于网络这块,其实还是蛮好玩的~
在工程目录中 执行qmake -project生成.pro文件 执行qmake指令 报错:undefined reference to `__imp__ZN12QApplicationC1ERiPPci' 修改.pro文件 旧: TEMPLATE = app TARGET = sdl INCLUDEPATH += . # Input SOURCES += 123.cpp 新的: TEMPLATE = app TARGET = sdl INCLUDEPATH += . # Input SOURCE
win上傻瓜化安装Qt开发环境 古老的MSYS搭建的开发环境不仅存在一些兼容性问题,而且还很繁琐,幸好mingw-build项目的开发者又做了更进一步的改进,他们开发了MSYS2项目.这个项目不仅兼容性更好,而且引入了包管理机制,可以直接从网上下载相关的软件,并解决相关的依赖性问题.这个项目的主页在 http://sourceforge.net/projects/msys2/ 进入项目主页后,根据你的系统选择32位或者64位,现在大家使用的系统应该都是64位的了.下载好base包,然后解压缩到什
<.cn 国内飞机航班时刻表 WEB 服务提供:通过出发城市和到达城市查询飞机航班.出发和到达时间.飞行周期.航空公司.机型等信息.国内飞机航班时刻表 WEB 服务提供的飞机航班时刻表数据仅供参考,如有异议请以当地飞机场提供的讯息为准. 此国内飞机航班时刻表Web Services请不要用于任何商业目的,若有需要请联系我们,欢迎技术交流. QQ:8409035 使用本站 WEB 服务请注明或链接本站:.cn/ 感谢大家的支持! 我们的目
分析21个 Qt 隐藏功能和技巧是本文将要介绍的内容,一一详细的罗列出来,以方便大家阅读方便. Q_GADGET:不需要从QObject继承就可以使用Qt的Meta Object功能 Q_ENUMS:对枚举对象进行反射(reflection) Q_SIGNAL:不需要signals关键字就可以将一个函数指定为singal函数 Q_SLOT:不需要slots关键字就可以将一个函数指定为slot函数 Q_FOREACH:Qt提供的关键字foreach在配置文件里面定义了no_keywords的时候就
Qt5相对于Qt4 增加对事件accept()和ignore()函数. Qt 中有很多种事件:鼠标事件.键盘事件.大小改变的事件.位置移动的事件等等.对于事件的处理,我们Qt 中使用相对应的机制. event()函数 1. event()函数是一个 protected 的函数,这意味着我们要想重写event(),必须继承一个已有的类. 2. 各个组件对事件处理是并发修改,还是挨个修改呢? bool Test::event(QEvent *e) { if (e-&type() == QEvent:
Qt 引入对象树的概念,在一定程度上解决了内存问题. 当一个QObject对象在堆上创建的时候,Qt 会同时为其创建一个对象树.不过,对象树中对象的顺序是没有定义的.这意味着,销毁这些对象的顺序也是未定义的.Qt 保证的是,任何对象树中的 QObject对象 delete 的时候,如果这个对象有 parent,则自动将其从 parent 的children()列表中删除:如果有孩子,则自动 delete 每一个孩子.Qt 保证没有QObject会被 delete 两次,这是由析构顺序决定的. 如
Qt 5 与 Qt 4 最大的一个区别之一是底层架构有了修改.Qt 5 引入了模块化的概念,将众多功能细分到几个模块之中.Qt 4 也有模块的概念,但是是一种很粗的划分,而 Qt 5 则更加细化.本节主要对 Qt 5 的模块进行一个简单的介绍,以便以后大家需要哪些功能的时候知道到哪个模块去寻找. Qt 5 模块分为 Essentials Modules 和 Add-on Modules 两部分.前者是基础模块,在所有平台上都可用:后者是扩展模块,建立在基础模块的基础之上,在能够运行 Qt 的平台
在 Qt 5 中,QObject::connect()有五个重载: QMetaObject::Connection connect(const QObject *, const char *, const QObject *, const char *, Qt::ConnectionType); QMetaObject::Connection connect(const QObject *, const QMetaMethod &, const QObject *, const QMetaMet
Copyright (C) , All Rights Reserved.
版权所有 闽ICP备号
processed in 0.971 (s). 9 q(s)

我要回帖

更多关于 js向html传值 的文章

 

随机推荐