当前位置: 首页> 教育> 培训 > 云南信息发布平台_东莞百姓网交友_seo教程下载_郑州网站建设公司排行榜

云南信息发布平台_东莞百姓网交友_seo教程下载_郑州网站建设公司排行榜

时间:2025/7/10 9:03:23来源:https://blog.csdn.net/qq_64881918/article/details/145966176 浏览次数:1次
云南信息发布平台_东莞百姓网交友_seo教程下载_郑州网站建设公司排行榜

#include <QApplication>
#include <QDebug>
#include <QWidget>
#include <QTextEdit>
#include <QLineEdit>
#include <QPushButton>
#include <QBoxLayout>
#include <QLabel>class Widget:public QWidget{QPushButton* but;Widget* other;
public:Widget();void setother(Widget& w);void buttext(const char* text);void click();
};Widget::Widget() : other(NULL)
{but = new QPushButton(this);QVBoxLayout lay;lay.addWidget(this);QObject::connect(but, &QPushButton::clicked, this, &Widget::click);}void Widget::setother(Widget& w)
{other=&w;
}void Widget::buttext(const char* text)
{but->setText(text);
}void Widget::click()
{this->hide();if (other) {other->show();}
}int main(int argc,char** argv)
{QApplication app(argc,argv);Widget w1,w2;w1.buttext("w1.but");w2.buttext("w2.but");w1.setother(w2);w2.setother(w1);w1.show();return app.exec();
}

 

关键字:云南信息发布平台_东莞百姓网交友_seo教程下载_郑州网站建设公司排行榜

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: