axylp123的个人主页

http://www.qtcn.org/bbs/u/154703  [收藏] [复制]

axylp123

  • 1

    关注

  • 1

    粉丝

  • 16

    访客

  • 等级:新手上路
  • 总积分:15
  • 男,1987-10-10

最后登录:2017-06-01

更多资料

日志

2015-11-27 21:48

//HexSpinBox.cpp
#ifndef HEXSPINBOX_H
#define HEXSPINBOX_H
#include <QSpinBox>
class HexSpinBox : public QSpinBox
{
    Q_OBJECT
public:
    explicit HexSpinBox(QWidget *parent = 0);
protected:
    QValidator::State validate(QString &input, int &pos) const;
    int valueFromText(const QString &text) const;
    QString textFromValue(int val) const;
signals:
public slots:
private:
..

阅读全文»分类:C++GUIQt4|回复:0|浏览:1083
2015-11-27 14:00

#include <QApplication>
#include <QUiLoader>
#include <QFile>
#include <QWidget>
#include <QPushButton>
int main(int argc,char** argv)
{
   QApplication app(argc,argv);
   QUiLoader loader;
   QFile file("Extension.ui");
   file.open(QFile::ReadOnly);
   QWidget* pWidget = loader.load(&file);
   //findChild<>() 模板函数, 通过 类型和objectName() 获取指针  
   QPushButt ..

阅读全文»分类:C++GUIQt4|回复:0|浏览:797
2015-11-27 13:41

//UIStackedDialog.h
#ifndef UISTACKDIALOG_H
#define UISTACKDIALOG_H
#include <QDialog>
#include <QStackedWidget>
#include <QListWidget>
#include <QLabel>
class UIStackedDialog : public QDialog
{
   Q_OBJECT
public:
   explicit UIStackedDialog(QWidget *parent=0,Qt::WindowFlags f=0);
private:
   QLabel         *m_pLabel1;
   QLabel         *m_pLabel2;
 ..

阅读全文»分类:C++GUIQt4|回复:0|浏览:783
2015-11-27 13:14

//UISortDialog.h
#ifndef UISORTDIALOG_H
#define UISORTDIALOG_H
#include <QDialog>
namespace Ui {
    class UISortDialog;
}
class UISortDialog : public QDialog
{
    Q_OBJECT
public:
    explicit UISortDialog(QWidget *parent = 0);
    ~UISortDialog();
    void setColumnRange(QChar first, QChar last);
private:
    Ui::UISortDialog *ui;
};
#endif // UISORTDIALOG_H
//UISortDi ..

阅读全文»分类:C++GUIQt4|回复:0|浏览:727
2015-11-27 09:59

//UIGoToCellDialog.h
#ifndef UIGOTOCELLDIALOG_H
#define UIGOTOCELLDIALOG_H
#include <QDialog>
#include "ui_UIGoToCellDialog.h"
//多继承
class UIGoToCellDialog : public QDialog,
                                               public Ui::UIGoToCellDialog
{ ..

阅读全文»分类:C++GUIQt4|回复:0|浏览:754
2015-11-27 09:54

bool QObject::connect(const QObject   *sender,     //发出信号的对象
                                         const char          *signal,     //信号
         ..

阅读全文»分类:C++GUIQt4|回复:1|浏览:777
2015-11-26 19:00

//UIFindDialog.h
#ifndef UIFINDDIALOG
#define UIFINDDIALOG
#include <QDialog>
//类的前置声明
//对于该类中的所有私有变量来说前置声明是可行的
//前置声明告知编译器类的存在,而不需要提供类的实现细节
//可以加快编译速度
class QLabel;
class QCheckBox;
class QLineEdit;
class QPushButton;
class UIFindDialog : public QDialog
{
    //对于所有定义了信号和槽的类
    //都必须在类定义的开始处声明宏 Q_OBJECT
    Q_OBJECT
public:
    ..

阅读全文»分类:C++GUIQt4|回复:0|浏览:874
2015-11-26 18:33

#include <QApplication>
#include <QHBoxLayout>
#include <QSlider>
#include <QSpinBox>
int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    QWidget *pWindow = new QWidget;
    pWindow->setWindowTitle(QObject::tr("Enter Your Age"));
    
    QSpinBox *pSpinBox = new QSpinBox;
    //设置spinBox控件的取值范围
   ..

阅读全文»分类:C++GUIQt4|回复:0|浏览:615
2015-11-26 18:16

#include <QApplication>
#include <QPushButton>
int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    QPushButton button(QObject::tr("Quit"));
    button.show();
    //信号槽链接,当button对象被点击时发射clicked()信号,
    //app对象接收到信号后,执行槽函数quit()
    QObject::connect(&button, SIGNAL(clicked()),  &app, SLO ..

阅读全文»分类:C++GUIQt4|回复:0|浏览:896
2015-11-26 17:46

//包含头文件
#include <QApplication>
#include <QLabel>
int main(int argc, char** argv)
{
    //创建QApplication对象,用来管理整个应用程序的资源
    QApplication app(argc, argv);
    //创建QLabel对象,本程序中用来现实文本
    QLabel label(QObject::tr("Hello Qt!"));
    //新创建的对象的没有父窗口时是隐藏的
    //需要显示地调用show()用于显示
    ..

阅读全文»分类:C++GUIQt4|回复:2|浏览:466

Powered by phpwind v8.7 Certificate Copyright Time now is:03-29 22:48
©2005-2016 QTCN开发网 版权所有 Gzip disabled