⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cardtable.cpp

📁 压缩包里有教材<<C++模式设计-基于QT4开源跨平台开发框架>>所有源码
💻 CPP
字号:
#include "cardtable.h"#include <QVBoxLayout>#include <QHBoxLayout>#include <QLabel>#include <QPushButton>//start// Given a pixmap, return a label with that pixmap on it.static QLabel* label(QPixmap pm) {    QLabel* retval = new QLabel();    retval->setPixmap(pm);    return retval;}CardTable::CardTable() {    // create 2 rows of cards:    QHBoxLayout *row = new QHBoxLayout();    row->addWidget(label(m_pixmaps.get("ah")));      row->addWidget(label(m_pixmaps.get("qd")));    row->addWidget(label(m_pixmaps.get("ks")));    row->addWidget(label(m_pixmaps.get("8c")));        QVBoxLayout* rows = new QVBoxLayout();    rows->addLayout(row);        row = new QHBoxLayout();    row->addWidget(label(m_pixmaps.get("qs")));    row->addWidget(label(m_pixmaps.get("js")));    row->addWidget(label(m_pixmaps.get("td")));    rows->addLayout(row);    // create a column of buttons:    QVBoxLayout *buttons = new QVBoxLayout();    buttons->addWidget(new QPushButton("Deal"));    buttons->addWidget(new QPushButton("Shuffle"));    // Bring them together:    QHBoxLayout* cols = new QHBoxLayout();    setLayout(cols);           /* The "root layout" for this widget */    cols->addLayout(rows);     /* Add both card rows as a column */    cols->addLayout(buttons);  /* Add column of buttons as another column */}//end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -