当前位置:网站首页>QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements

QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements

2022-07-08 00:20:00 Miaowei

Qt List of articles

Preface

Add Icon on toolbar
 Insert picture description here

One 、 Implementation steps

1. Add resources
 Insert picture description here

 Insert picture description here

2. Defining variables
 Insert picture description here

3. Add Icon

		trajectories_action_ = new QAction("trajectories");
		trajectories_action_->setIcon(QIcon(":images/Add.ico"));
		trajectories_action_->setCheckable(true);

		tools_bar_->addAction(trajectories_action_);

4. Establish signal slot
 Insert picture description here

  1. Add time response slot function
  2.  Insert picture description here
void FastViewWidgetLayout::onTrajection()
{
    
	qDebug() << " Event response function ";
}

原网站

版权声明
本文为[Miaowei]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/189/202207072220135487.html