摘要:
http://www.zcool.com.cn/tosearch.do?page=4&world=%E6%9A%82%E5%81%9C&cateType=104&subcateType=0&channel=0&other=0&sort=0&uid=0&time=0&limit=10&recommen...
阅读全文
posted @ 2015-02-28 05:37
Grandyang
阅读(2441)
推荐(0)
摘要:
Qt中的QTabWiget 类提供了一个标签控件,但是这个控件默认初始化的颜色是白色,和原窗口的颜色不同,看起来非常的违和,所以我们希望将其的背景颜色设为当前窗口的背景颜色。我们所要做的就是先将应用程序窗口的背景颜色取出来,然后再赋给QTabWiget 类的每个标签,比如说我们有tab1和tab2两
阅读全文
posted @ 2015-02-28 03:10
Grandyang
阅读(1766)
推荐(0)
摘要:
用OpenCV同时显示两个摄像头的内容的代码如下:#include #include #include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]) { CvCapture...
阅读全文
posted @ 2015-02-27 04:48
Grandyang
阅读(3713)
推荐(0)
摘要:
在做项目中,我们经常需要获取系统的当前时间,那么如何获取呢,参见下面的代码:/* asctime example */#include /* printf */#include /* time_t, struct tm, time, localtime, asctime *...
阅读全文
posted @ 2015-02-27 01:55
Grandyang
阅读(20390)
推荐(0)
摘要:
Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example: Input: 3 Output: [ [1,null,3,2],
阅读全文
posted @ 2015-02-26 13:16
Grandyang
阅读(22804)
推荐(3)
摘要:
:-) smile:-] polite smile:-( frown:-[ another frown:-/ or :-\ skepticism, annoyance, or a slight frown:-| indecision, deadpan, or indifference; also o...
阅读全文
posted @ 2015-02-26 06:50
Grandyang
阅读(10842)
推荐(0)
摘要:
Qt中的信号槽系统是不同类中间传递数据的神器,如果连接父子空间之间的信号槽很重要,在父类中实例化子类的时候一定要注意将父类连上,不然信号槽无法使用,比如若子类是个对话框Dialog类,一定不要忘了加thisQtClass *qc = new QtClass(this);qc->exec();然后如果...
阅读全文
posted @ 2015-02-26 05:41
Grandyang
阅读(2593)
推荐(1)
摘要:
Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: Input: 3 Output: 5 Explanation: Given n = 3, the
阅读全文
posted @ 2015-02-25 14:56
Grandyang
阅读(24055)
推荐(4)
摘要:
Qt中的Label标签控件的作用绝不仅仅限于显示静态文本,其实它的功能很强大,由于其有setPixmap()成员函数,故而可以当显示图片窗口使用,而且还可以实时显示摄像头捕获的图片,然后它对鼠标事件的支持却没有QWidget那样强大,很多时候我们想要QLabel捕获鼠标单击或双击的事件,它本身无法实
阅读全文
posted @ 2015-02-25 01:41
Grandyang
阅读(3371)
推荐(0)
摘要:
Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 2: Note: Try to come up as many solutions as you
阅读全文
posted @ 2015-02-24 15:13
Grandyang
阅读(33026)
推荐(2)
摘要:
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac" Output:
阅读全文
posted @ 2015-02-24 14:03
Grandyang
阅读(17823)
推荐(3)
摘要:
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only
阅读全文
posted @ 2015-02-24 02:26
Grandyang
阅读(35048)
推荐(2)
摘要:
Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Input: [1,3,null,null,2
阅读全文
posted @ 2015-02-23 15:13
Grandyang
阅读(22437)
推荐(4)
摘要:
Given a binary tree, return the inorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Recursive so
阅读全文
posted @ 2015-02-22 05:51
Grandyang
阅读(35061)
推荐(8)
摘要:
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and
阅读全文
posted @ 2015-02-21 14:55
Grandyang
阅读(14534)
推荐(0)
摘要:
Ctrl-CCopyCtrl-XCutCtrl-VPasteCtrl-ZUndoCtrl-YRedoCtrl-ASelect AllCtrl-FLaunch Find DialogCtrl-HLaunch Find / Replace DialogCtrl-DDuplicate Current ...
阅读全文
posted @ 2015-02-21 02:42
Grandyang
阅读(758)
推荐(0)
摘要:
在使用Qt和OpenCV编程时,对于它们各自的图像类QImage和IplImage难以避免的需要互相之间的转换,下面我们就来看它们的相互转换。1. QImage 转换为 IplImageIplImage *QImageToIplImage(const QImage * qImage){ int...
阅读全文
posted @ 2015-02-21 01:46
Grandyang
阅读(2079)
推荐(0)
摘要:
Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example,
阅读全文
posted @ 2015-02-20 13:52
Grandyang
阅读(20120)
推荐(2)
摘要:
在Qt中经常需要弹出窗口,QMessageBox可以实现此功能,一共有三种窗口,information, question, 和 warning,critical, about分别对应感叹号,问号和叉号等等,使用方法很简单,一共有三个参数,第一个是父窗口句柄,剩下两个分别为窗口名称和显示内容,显示内...
阅读全文
posted @ 2015-02-20 07:13
Grandyang
阅读(14805)
推荐(0)
摘要:
Qt5从Qt4升级后,很多原来Qt4中定义的函数或者变量由于种种原因在Qt5中被遗弃,所以用Qt5来编译Qt4的一些工程项目时,难以避免的会需要修改一些地方,下面就罗列一些我遇到的一些需要修改的地方:- Qt5中UnicodeUTF8不再是QCoreApplication的一个成员,所以下面的代码需...
阅读全文
posted @ 2015-02-20 05:11
Grandyang
阅读(5712)
推荐(0)
摘要:
Go to Linker -> General -> Additional LIbrary Directories:qtmaind.libQt5Cored.libQt5Guid.libQt5Widgetsd.libQt5Multimediad.libQt5MultimediaWidgetsd.lib
阅读全文
posted @ 2015-02-20 03:16
Grandyang
阅读(282)
推荐(0)
摘要:
Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example,
阅读全文
posted @ 2015-02-19 17:29
Grandyang
阅读(14360)
推荐(0)
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple
阅读全文
posted @ 2015-02-18 14:36
Grandyang
阅读(40881)
推荐(2)
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced bina
阅读全文
posted @ 2015-02-18 07:54
Grandyang
阅读(16840)
推荐(0)
摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d
阅读全文
posted @ 2015-02-17 14:45
Grandyang
阅读(17184)
推荐(0)
摘要:
1. leetcodehttp://leetcode.com/2. careeruphttp://www.careercup.com/http://hawstein.com/posts/ctci-solutions-contents.html3. glassdoorhttp://www.glassd...
阅读全文
posted @ 2015-02-17 03:38
Grandyang
阅读(17993)
推荐(0)
摘要:
Given two strings s and t, return the number of distinct subsequences of s which equals t. The test cases are generated so that the answer fits on a 3
阅读全文
posted @ 2015-02-16 14:50
Grandyang
阅读(15923)
推荐(1)
摘要:
Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: click to show hints. Hints: If you n
阅读全文
posted @ 2015-02-16 11:07
Grandyang
阅读(23126)
推荐(3)
摘要:
3DSlicer, a free open source software for visualization and medical image computingAcetoneISO:镜像文件挂载软件Adobe Photoshop Album, an image organizing appli...
阅读全文
posted @ 2015-02-14 00:42
Grandyang
阅读(8576)
推荐(0)
摘要:
Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there
阅读全文
posted @ 2015-02-13 13:51
Grandyang
阅读(18686)
推荐(1)
摘要:
Qt中的表单控件QListWidget类提供了许多信号函数,可以和用户交互,其中有个currentRowChanged ( int currentRow ) 是检测当前选中行是否发生了改变,如果改变了,该信号函数被触发。void QListWidget::currentRowChanged ( in...
阅读全文
posted @ 2015-02-13 04:57
Grandyang
阅读(4399)
推荐(0)
摘要:
这三个类相互有关联,但是有不尽相同,首先从名字上看,QDir 和 QDirIterator 是针对于文件目录的,也就是文件夹,我们知道,对于一个文件夹,可以包含很多文件,也可以包含其他文件夹,通常是一个树的结构。文件夹里还可以包含符号链接,符号链接是指向其他文件或文件夹的一种链接,和Windows系...
阅读全文
posted @ 2015-02-13 01:56
Grandyang
阅读(4855)
推荐(0)
摘要:
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin
阅读全文
posted @ 2015-02-12 15:07
Grandyang
阅读(17348)
推荐(1)
摘要:
在Qt中添加按钮或表格控件时需要添加其按键响应,一般来说有两种方法,一种是直接实现其响应函数,第二种是自己写一个响应函数,然后用Qt的信号槽将它们连接起来。愚以为第一种方法更为简单一些。声明这些控件:QPushButton *pbutton;QListWidget *lwidget;然后实现它们的响...
阅读全文
posted @ 2015-02-12 02:16
Grandyang
阅读(3992)
推荐(0)
摘要:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo
阅读全文
posted @ 2015-02-11 15:14
Grandyang
阅读(16138)
推荐(1)
摘要:
Qt 支持的图片格式如下:FormatDescriptionQt's supportBMPWindows BitmapRead/writeGIFGraphic Interchange Format (optional)ReadJPGJoint Photographic Experts GroupRe...
阅读全文
posted @ 2015-02-11 05:41
Grandyang
阅读(1552)
推荐(0)
摘要:
初学Qt的人会经常搞不清这三个图像类QGrphicsView, QGraphicsScene 和 QGraphicsItem,它们到底有什么区别呢?QGrphicsView类实际上是为QGraphicsScene类的内容提空了一个控件,它在一个可滑动视图空间内可视化QGraphicsScene的内容...
阅读全文
posted @ 2015-02-11 05:19
Grandyang
阅读(1509)
推荐(0)
摘要:
The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'. For example, "ACGAATTCCG" is a DNA sequence. When study
阅读全文
posted @ 2015-02-10 16:11
Grandyang
阅读(17997)
推荐(1)
摘要:
Qter开源社区http://www.qter.org/[Qt教程], 作者yafeilinux[视频]QT学习之路:从入门到精通 《C++ Qt 编程视频教程》
阅读全文
posted @ 2015-02-10 01:33
Grandyang
阅读(558)
推荐(0)
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple
阅读全文
posted @ 2015-02-09 17:09
Grandyang
阅读(40268)
推荐(1)