Qt Programing With C++ (2nd) 之 find dialog

#ifndef FINDDIALOG_H
#define FINDDIALOG_H

#include <QDialog>

class QCheckBox;
class QLabel;
class QLineEdit;
class QPushButton;

class FindDialog : public QDialog
{
    Q_OBJECT

public:
    FindDialog(QWidget *parent = 0); 

signals:
    void findNext(const QString &str, Qt::CaseSensitivity cs);
    void findPrevious(const QString &str, Qt::CaseSensitivity cs);

private slots:
    void findClicked();
    void enableFindButton(const QString &text);

private:
    QLabel *label;
    QLineEdit *lineEdit;
    QCheckBox *caseCheckBox;
    QCheckBox *backwardCheckBox;
    QPushButton *findButton;
    QPushButton *closeButton;
};

#endif


QDialog类继承于QWidget,是所有dialog类的基类。

QDialog适合用来执行短小的任务以及与用户之间的交互,分为模态和模态两种类型,对于模态又分为application modal & window modal, 前者是阻塞所有非己窗口的事件直到自己被关闭,后者则只阻塞和自己相关的窗口的事件。

如果想以Application Modal的方式创建dialog,则调用exec()。更为灵活的是使用setWindowModality(),然后调用show()来确定以哪种模态形式(上面提到的两种)。

QDialogButtonBox可以方便的创建各种标准类型的按钮Layout。可以把很多按钮组合在一个QDialogButtonBox中,当某个按钮被按下,该类就会自动发出信号


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Hands-On High Performance Programming with Qt 5: Build cross-platform applications using concurrency, parallel programming, and memory management Author: Marek Krajewski Pub Date: 2019 ISBN: 978-1789531244 Pages: 384 Language: English Format: EPUB Size: 17 Mb Build efficient and fast Qt applications, target performance problems, and discover solutions to refine your code Achieving efficient code through performance tuning is one of the key challenges faced by many programmers. This book looks at Qt programming from a performance perspective. You’ll explore the performance problems encountered when using the Qt framework and means and ways to resolve them and optimize performance. The book highlights performance improvements and new features released in Qt 5.9, Qt 5.11, and 5.12 (LTE). You’ll master general computer performance best practices and tools, which can help you identify the reasons behind low performance, and the most common performance pitfalls experienced when using the Qt framework. In the following chapters, you’ll explore multithreading and asynchronous programming with C++ and Qt and learn the importance and efficient use of data structures. You’ll also get the opportunity to work through techniques such as memory management and design guidelines, which are essential to improve application performance. Comprehensive sections that cover all these concepts will prepare you for gaining hands-on experience of some of Qt’s most exciting application fields – the mobile and embedded development domains. By the end of this book, you’ll be ready to build Qt applications that are more efficient, concurrent, and performance-oriented in nature What you will learn Understand classic performance best practices Get to grips with modern hardware architecture and its performance impact Implement tools and procedures used in performance optimization Grasp Qt-specific work techniques for graphical user interface (GUI) and platform programming Make Transmission Control Protocol (TCP) and Hypertext Transfer Protocol (HTTP) performant and use the relevant Qt classes Discover the improvements Qt 5.9 (and the upcoming versions) holds in store Explore Qt’s graphic engine architecture, strengths, and weaknesses
Create visually appealing and feature-rich applications by using Qt 5 and the C++ language Qt 5, the latest version of Qt, enables you to develop applications with complex user interfaces for multiple targets. It provides you with faster and smarter ways to create modern UIs and applications for multiple platforms. This book will teach you to design and build graphical user interfaces that are functional, appealing, and user-friendly. In the initial part of the book, you will learn what Qt 5 is and what you can do with it. You will explore the Qt Designer, discover the different types of widgets generally used in Qt 5, and then connect your application to the database to perform dynamic operations. Next, you will be introduced to Qt 5 chart which allows you to easily render different types of graphs and charts and incorporate List View Widgets in your application. You will also work with various Qt modules, like QtLocation, QtWebEngine, and the networking module through the course of the book. Finally, we will focus on cross-platform development with QT 5 that enables you to code once and run it everywhere, including mobile platforms. By the end of this book, you will have successfully learned about high-end GUI applications and will be capable of building many more powerful, cross-platform applications. What You Will Learn Implement tools provided by Qt 5 to design a beautiful GUI Understand different types of graphs and charts supported by Qt 5 Create a web browser using the Qt 5 WebEngine module and web view widget Connect to the MySQL database and display data obtained from it onto the Qt 5 GUI Incorporate the Qt 5 multimedia and networking module in your application Develop Google Map-like applications using Qt 5’s location module Discover cross-platform development by exporting the Qt 5 application to different platforms Uncover the secrets behind debugging Qt 5 and C++ applications

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值