文章分类 -  QT

Using QT under linux.
摘要:1: PTrace:ptrace operation not permitted And the solution is just either do this (as root): $ echo 0 > /proc/sys/kernel/yama/ptrace_scope …or make it permanent by setting ptrace_scope to 0 in /etc/sysctl.d/10-ptrace.conf 阅读全文
posted @ 2011-11-01 14:40 lcryby 阅读(212) 评论(0) 推荐(0)
摘要:在LINUX下进行网络编程,我们可以使用LINUX提供的统一的套接字接口。但是这种方法牵涉到太多的结构体,比如IP地址,端口转换等,不熟练的人往往容易犯这样那样的错误。QT中提供的SOCKET完全使用了类的封装机制,使用户不需要接触底层的各种结构体操作。而且它采用QT本身的signal-slot机制,使编写的程序更容易理解。 QT中共提供四个与套按字相关的类,分别是: QServerSocket:TCP-based server QSocket: Buffered TCP connection QSocketDevice: Platform-independent low-level ... 阅读全文
posted @ 2011-10-27 10:55 lcryby 阅读(610) 评论(0) 推荐(0)
摘要:After create the menu, maybe we want to make it minimize to the tray.So Here is the code.1: XXXX.h private slots: void iconActivated(QSystemTrayIcon::ActivationReason reason); private: QSystemTrayIcon *trayIcon; void createActions(); void createTrayIcon();2: XXXX.cpp XXXX() { ui->s... 阅读全文
posted @ 2011-10-19 15:56 lcryby 阅读(234) 评论(0) 推荐(0)
摘要:1: Label: mulitiline -----> "cyy/nlrb" add /n to the QString2: CheckBox: checked ----> ui->is_patternFilter->setChecked(false);3: Combox initialize add QStringList to the combox QStringList list = QStringList()<< "1"<< "2"<< "3"&l 阅读全文
posted @ 2011-10-19 15:47 lcryby 阅读(88) 评论(0) 推荐(0)
摘要:1: New Project --> Qt Widget Project --> Qt Gui Application2: next --> next3: Class Information --> Base Class(Select QMainWindow)4: XX.ui --> Type Here --> Input menu name --> enter(name changed)5: In the Action Editor --> double click -->Set the action name6: Right the a 阅读全文
posted @ 2011-10-18 13:18 lcryby 阅读(170) 评论(0) 推荐(0)
摘要:After write a small test project, the project can run successfully, but breakpoint does not take effect.So set to Debug mode: Add this to XXX.pro CONFIG+=debugSo set to Release mode: Add this to XXX.pro CONFIG+=releaseAfter change the mode, must clean the project and rebuild again, the new mode ... 阅读全文
posted @ 2011-10-17 16:35 lcryby 阅读(186) 评论(0) 推荐(0)
摘要:1: background: Qt是一个跨平台的C++图形用户界面应用程序框架。它提供给应用程序开发者建立艺术级的图形用户界面所需的所用功能。 Qt也是流行的Linux桌面环境KDE 的基础,KDE是所有主要的Linux发行版的一个标准组件。 Qt支持下述平台: MS/Windows - 95、98、NT 4.0、ME、2000、XP 和 Vista Unix/X11 - Linux、Sun Solaris、HP-UX、Compaq Tru64 UNIX、IBM AIX、SGI IRIX和其它很多X11平台 Qt Creator包含了一套用于创建和测试基于Qt应用程序的高... 阅读全文
posted @ 2011-10-13 11:59 lcryby 阅读(242) 评论(0) 推荐(0)
摘要:Today, get a good article about the QT basic knowledge.Qt有两个重要概念:“信号和槽”和“布局”。Qt用“信号和槽”代替windows编程中的callback机制,通过“信号和槽”来完成不同对象之间的通信,以及完成相应用户的操作,可以用于任何QObject的子类中。槽和普通的C++成员函数几乎是一样的:可以是虚函数,可以被重载,可以是共有的,保护的或私有的,并且也可以被其他C++成员函数直接调用,参数也可以是任意类型。不同之处是:槽可以和信号连接在一起,在这种情况下,每当发射这个信号的时候,就会自动调用这个槽。connect()语句如下: 阅读全文
posted @ 2011-10-13 11:46 lcryby 阅读(106) 评论(0) 推荐(1)