QDateTime 设置时间
ui->dateEdit1->setDateTime(QDateTime::currentDateTime()); 设置当前时间 ui->dateEdit2->setDateTime(QDateTime::currentDateTime().addDays(1)); //设置当前时间的第二天
tabwidget 修改页的名称CurrentTabText
textEdit 作为打印输出 textEdit->append();
Qssh ssh获取远程主机内容 m->shell.data("ls \n") 出现带颜色的字符
ls
[0m[01;34mDesktop[0m [01;34mDownloads[0m [01;34mMusic[0m [01;34mPublic[0m [01;34mTemplates[0m
[01;34mDocuments[0m examples.desktop [01;34mPictures[0m [01;34mshare[0m [01;34mVideos[0m
如何解决? 加 “\\”
m->shell.data("\\ls \n")
QT radioButton单选框 是否选中的判断:
if(ui->radioButton_6->isChecked()){
}
获取tabwidget 的某一页:
ui->tabWidget->currentIndex()
判断 单个checkbox是否被选中
if(ui->checkbox->isChecked()==true)
8. 打开日历选择日期
在界面上 拖一个dateEdit
ui->dateEdit1->setCalendarPopup(true);
参考https://blog.csdn.net/Zhu_Zhu_Wonder/article/details/49721717
控件的布局:
在窗体中布局:有点,同时选择多个控件,点击窗体中布局后,控件会自动对齐。相比每一行控件做水平布局,再做垂直布局,速度大大提高。 点击窗体中布局按钮后,再设置左边距,右边距上边距、下边距,根据实际经验,边距设置为20比较好。
效果图如下:
控件布局的边框问题:
不用每个设置单个布局的时候去设置两边的间距。可以在整体布局完后,再去设置两边的边距,如上图。设置如下
QT 标准控件组的使用 QDialogBox