
Qt
juliosun
这个作者很懒,什么都没留下…
展开
-
Qt 数据类型转换
各种数据类型的相互转换char * 与 const char *的转换char *ch1="hello11";const char *ch2="hello22";ch2 = ch1;//不报错,但有警告ch1 = (char *)ch2;char 转换为 QString其实方法有很多中,我用的是:char a='b';QString str;str=QS转载 2012-08-29 15:24:41 · 902 阅读 · 0 评论 -
QFont
Style hints are used by the font matching algorithm to find an appropriate default family if a selected font family is not available.ConstantValueDescriptionQFont::AnyStyle转载 2012-09-24 19:19:48 · 1792 阅读 · 0 评论 -
Qt widget background
You code for the palette is fine. So try to use QWidget::autoFillBackground.Qt Code:Switch view#include int main(int argc, char* argv[]){ QApplication app(argc, argv); QWidget w;转载 2012-09-24 15:42:33 · 755 阅读 · 0 评论 -
Install QVTK widget as a plugin
The QVTK Widget is one of the main 'bridges' from Qt to VTK (Titan). It's a widget that shows a OpenGL representation of some kind and it allows a titan data structure (vtkTree, vtkGraph) to be displa转载 2012-12-04 17:15:23 · 1372 阅读 · 0 评论 -
Qt Creator Default Keyboard Shortcuts
General Keyboard ShortcutsActionKeyboard shortcutOpen file or projectCtrl+ONew file or projectCtrl+NOpen in external editorAlt+V, Alt+ICutCtrl+X转载 2013-01-04 13:59:45 · 947 阅读 · 0 评论 -
html character entities
HTML Useful Character EntitiesNote: Entity names are case sensitive!ResultDescriptionEntity NameEntity Number non-breaking space less转载 2012-09-24 20:14:07 · 610 阅读 · 0 评论 -
用Cmake编译调用Qxt,Qwt和Qserialport
最近用Cmake编译VTK-Qt 的程序, 需要调用Qwt. 以前在Qt creator里用.pro文件配置很方便. 现在要用Cmake吧header和 libraries 链接到程序.需要注意的是如果要使用Qdesigner设计界面的话, 要保证所有的相关libraries都要编译为Release. 如果自己写codes就没有这个限制, 只要debug保持一致或者 release保持一致.原创 2013-05-09 16:31:30 · 1637 阅读 · 0 评论 -
QvtkWidget 和 vtkImageViewer2 改变default mouse interactorStyle
重载的vtkInteractorStyleTrackballCamera 也可以是子类 vtkInteractorImage. 同时要注意qvtk 与vtkImageViewer的 RenderWindow与Interactor的共享, 多以qvtk为准. SetInteractor 一定要在 SetRenderWindow之前, 以避免error出现. "viewer.h"// Over原创 2013-05-23 17:56:21 · 4088 阅读 · 0 评论 -
QList 中的 append 和 push_back
void QList::pop_back ()This function is provided for STL compatibility. It is equivalent to removeLast(). The list must not be empty. If the list can be empty, call isEmpty() before calling this原创 2013-05-14 16:23:28 · 16128 阅读 · 2 评论 -
QSqlDatabase 用法
Qt中的QSqlDatabase类表示一个数据库的连接。 数据库连接的创建通过静态方法addDatabase来实现,在创建时可以给数据库连接指定一个名称(ConnectionName),如果不指定名称也可以,会创建一个默认连接。如:[cpp] view plaincopyQSqlDatabase a = QSqlDatabase转载 2013-06-12 21:01:13 · 3061 阅读 · 0 评论 -
QSql 基本用法
一、QtSql模块Qt为数据库访问提供的QtSql模块实现了数据库和Qt应用程序的无缝集成,同时为开发人员提供了一套与平台无关和具体所用数据库均无关的调用接口。这使得开发人员只需掌握基本的SQL语句,就能进行简单的数据库应用程序开发。如下表所示,QtSql模块由3部分组成。层次描述驱动层驱动层实现了特定数据库与SQL接口的底层桥接。S转载 2013-06-12 14:16:19 · 5986 阅读 · 0 评论 -
QTableView 和 predefined Models
Predefined ModelsThe typical way to use model/view is to wrap specific data to make it usable with view classes. Qt, however, also provides predefined models for common underlying data structures.转载 2013-06-12 16:45:45 · 897 阅读 · 0 评论 -
Qt color define
Predefined ColorsThere are 20 predefined QColors described by the Qt::GlobalColor enum, including black, white, primary and secondary colors, darker versions of these colors and three shades of gr转载 2012-09-24 15:55:11 · 1672 阅读 · 0 评论 -
Qt compile output 中文乱码
两个解决方法:1.在系统环境变量里添加一个变量LANG=en2.或者不用中文, 直接删除%MinGW%\share\locale\zh_CN\LC_MESSAGES原创 2012-10-14 17:36:54 · 741 阅读 · 0 评论 -
Qt的系统变量
安装QtSDK后, 设置系统变量,假设要用Mingw编译.在Path里加两个路径C:\QtSDK\mingw\bin;C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin保证不要有QtCreator的bin.加两个variables, QTDIR=C:\QtSDK\Desktop\Qt\4.8.1\mingw;原创 2012-09-21 16:06:03 · 725 阅读 · 0 评论 -
Qt tostdString
Qt 输出文件时string要转到std型,#include #include #include void io::write_to_file(QString str){ ofstream my_file; my_file.open("test.txt"); my_file str.toStdString(); my_fil原创 2012-08-29 20:14:55 · 3874 阅读 · 0 评论 -
Qt set current window
QWidget::activateWindow?From help file, this function is going toSets the top-level widget containing this widget to be the active window. An active window is a visible top-level window that转载 2012-08-30 22:26:03 · 707 阅读 · 0 评论 -
Qt global variable
1. use extern// globalvar.h #ifndef MYGLOBALS#define MYGLOBALS extern int variable1;extern int variable2; #endif ... /原创 2012-08-31 14:11:17 · 980 阅读 · 0 评论 -
Qt 返回系统时间
uint QDateTime::toTime_t () constReturns the datetime as the number of seconds that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (Qt::UTC).On systems that do not suppo转载 2012-08-30 16:39:05 · 1813 阅读 · 0 评论 -
Qt two ways write Debug() into file
Here we can handle we can print different kind of message in file. For example QtDebugMsg, QtWarningMsg etc. We can constantly open a file and print to it and close it. Or we can open it in constructo转载 2012-09-01 17:53:42 · 609 阅读 · 0 评论 -
Qt signals and slots in different classes
Remember that connections are not between classes, but between instances. If you emit a signal and expect connected slots to be called, it must be emitted on an instance on which the connection was转载 2012-09-02 15:42:51 · 672 阅读 · 0 评论 -
Qt How to use connect between incompatible signal and slot
In this I want to call a function, that function will receive a point . But this function should be invoked by a timer's timedout signal. Can anybody say how to achieve this. Below is the required/err转载 2012-09-02 15:36:46 · 484 阅读 · 0 评论 -
Qwt 自定义坐标轴tick
Interval and all tick positions of a scale are stored in a QwtScaleDiv object. You can manually create a QwtScaleDiv and assign it to a plot axis (QwtPlot::setAxisScaleDiv()) , or you can use a Qw原创 2012-09-03 20:44:19 · 7723 阅读 · 3 评论 -
Qt fixed decimal
suppose a real x = 123.4567890123456'f' is for ordinary floaf format, default precision is 3, eg: 123.456'e' if for exponent float format, default precision is 6, eg: 1.234568e02 'g' is for mo转载 2012-08-28 16:27:19 · 1480 阅读 · 0 评论 -
Qt4 设置位置 setGeometry
// set position myDialog->setGeometry(...);// and show my dialogmyDialog->show();You can't use setGeometry() when using layouts -- it'll simply not work. If you want to manipulate sizes of la转载 2012-08-28 15:05:19 · 4018 阅读 · 0 评论 -
QT: Fast way to measure time?
How about QTime? Depending on your platform it should have 1 millisecond accuracy. Code would look something like this:QTime myTimer;myTimer.start();// do something..int nMilliseconds = myTimer转载 2012-08-28 16:26:23 · 495 阅读 · 0 评论 -
Why model/view is preferred to widget?
QListView, QTableView and QTreeView all use a model abstraction, which is a merged list, table and tree. This makes it possible to use several different types of view classes from the same model.转载 2013-06-12 16:49:45 · 963 阅读 · 0 评论