摘要: void BottomToolWidget::openLink(){ QString link = "http://www.baidu.com";//在.h中添加slot声明,在此更改链接网址#ifdef Q_OS_WIN wchar_t *cmd = L"open"; wchar... 阅读全文
posted @ 2015-01-07 14:39 田陌允 阅读(161) 评论(0) 推荐(0)
摘要: 用于设置取消时,询问是否保存修改的DLGvoid SetWindow::cancelButton(){ if( m_IsChange) { QMessageBox msgBox; msgBox.setText(tr("The crap has been cha... 阅读全文
posted @ 2014-12-26 10:53 田陌允 阅读(331) 评论(0) 推荐(0)
摘要: QDesktopWidget *pDesk = QApplication::desktop(); login->move((pDesk->width() - login->width()) / 2, (pDesk->height() - login->height()) / 2); ... 阅读全文
posted @ 2014-12-24 14:17 田陌允 阅读(140) 评论(0) 推荐(0)
摘要: QMetaObject::invokeMethod(m_mainToolBarItem, "change2DesktopMode", Q_ARG(QVariant, m_curMode));QT事件调用,原型:bool QMetaObject::invokeMethod(QObject *obj, ... 阅读全文
posted @ 2014-12-16 18:12 田陌允 阅读(484) 评论(0) 推荐(0)
摘要: QPainter painter1(this);//新建类 painter1.setRenderHint(QPainter::Antialiasing,true);//设置反锯齿 painter1.setBrush(QBrush(/*Qt::green,*/ QPixmap(":/qm... 阅读全文
posted @ 2014-12-09 20:08 田陌允 阅读(404) 评论(0) 推荐(0)
摘要: 事件过滤器针对一类或者多种不同类型的对象,定义了重写操作。简单的说:1、先对UI对象注册Event Filter例如: ui->drawBtn->installEventFilter(this);2、定义过滤器操作事件bool BaseWidget::eventFilter(QObject *ob... 阅读全文
posted @ 2014-12-03 17:19 田陌允 阅读(618) 评论(0) 推荐(0)
摘要: 1、 .h文件中添加private: QPoint dragPosition; 2、 在cpp文件中重写鼠标点击和拖拽函数void ShapeWidget::mousePressEvent(QMouseEvent * event){ if (event->button() == Qt::LeftBu... 阅读全文
posted @ 2014-12-01 18:20 田陌允 阅读(6864) 评论(0) 推荐(0)