随笔分类 - Qt
摘要:m_scrollBar=ui->textEdit->horizontalScrollBar(); timer=new QTimer(this); timer->start(1000); connect(timer,SIGNAL(timeout()),this,SLOT(slotUpdateTime()));定时器:实现滚动效果 void Lable::slotUpdateTime() { m_scrollBar->setMinimum( 0 ); m_scrollBar->setMaximum( ui->textEdit->height() ); ..
阅读全文
摘要:1、设置窗体的背景色在构造函数里添加代码,需要添加头文件qpalette或qgui QPalette pal = palette(); pal.setColor(QPalette::Background, QColor(0x00,0xff,0x00,0x00)); setPalette(pal);通过设置窗体的背景色来实现,将背景色设置为全透。效果:窗口整体透明,但窗口控件不透明,QLabel控件只是字显示,控件背景色透明;窗体客户区完全透明。2、在MainWindow窗口的构造函数中使用如下代码 this->setAttribute(Qt::WA_TranslucentBackgr..
阅读全文

浙公网安备 33010602011771号