本文介绍了在qtcreator中更改lineEdit属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨我是qt的初学者我在qt创建器中创建了一个GUI应用程序,并通过desginer在窗体中添加了按钮和行编辑.我想在单击按钮时更改(宽度和高度)lineEdit的大小
但是当我编写这段代码时:
void MainWindow :: on_pushButton_clicked() { lineEdit-> setGeometry( 0 , 0 , 85 , 30 ); }
它给出了这个错误:
C:\ Users \ REZA \ Documents \ Qt \ game4-build-desktop \ .. \ game4 \ mainwindow.cpp:19:错误:未在此范围内声明"lineEdit"
解决方案
hii am beginner in qt
i created a GUI application in qt creator and added a push button and a line edit into form by desginer. i want the size of (width and height) lineEdit change when i click push button
but when i write this code:
void MainWindow::on_pushButton_clicked() { lineEdit->setGeometry( 0, 0, 85, 30 ); }
it gives thiserror :
C:\Users\REZA\Documents\Qt\game4-build-desktop\..\game4\mainwindow.cpp:19: error: 'lineEdit' was not declared in this scope
解决方案
这篇关于在qtcreator中更改lineEdit属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!