• 大小: 6.79MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-24
  • 语言: 其他
  • 标签: SSD4  Exercise  Quiz  

资源简介

里面有SSD4所需要的全部答案,包括所有的Exercise和所有的Quiz。

资源截图

代码片段和文件信息

#include 

 #include “analogclock.h“

 AnalogClock::AnalogClock(QWidget *parent)
     : QWidget(parent)
 {
     QTimer *timer = new QTimer(this);
     connect(timer SIGNAL(timeout()) this SLOT(update()));
     timer->start(1000);
       setWindowtitle(tr(“Analog Clock“));
     resize(200 200);
 }

 void AnalogClock::paintEvent(QPaintEvent *)
 {
     static const QPoint hourHand[3] = {
         QPoint(7 8)
         QPoint(-7 8)
         QPoint(0 -40)
     };
     static const QPoint minuteHand[3] = {
         QPoint(7 8)
         QPoint(-7 8)
         QPoint(0 -70)
     };
     static const QPoint secondHand[3] = {
         QPoint(7 8)
         QPoint(-7 8)
         QPoint(0 -90)
     };

     QColor hourColor(127 0 127);
     QColor minuteColor(0 127 127 191);
     QColor secondColor(0 127 12 191);

     int side = qMin(width() height());
     QTime time = QTime::currentTime();

     QPainter painter(this);
     painter.setRenderHint(QPainter::Antialiasing);
     painter.translate(width() / 2 height() / 2);
     painter.scale(side / 200.0 side / 200.0);

     painter.setPen(Qt::NoPen);
     painter.setBrush(hourColor);

     painter.save();
     painter.rotate(30.0 * ((time.hour() + time.minute() / 60.0)));
     painter.drawConvexPolygon(hourHand 3);
     painter.restore();

     painter.setPen(hourColor);

     for (int i = 0; i < 12; ++i) {
         painter.drawLine(88 0 96 0);
         painter.rotate(30.0);
     }

     painter.setPen(Qt::NoPen);
     painter.setBrush(minuteColor);

     painter.save();
     painter.rotate(6.0 * (time.minute() + time.second() / 60.0));
     painter.drawConvexPolygon(minuteHand 3);
     painter.restore();

     painter.setPen(minuteColor);

     for (int j = 0; j < 60; ++j) {
         if ((j % 5) != 0)
             painter.drawLine(92 0 96 0);
         painter.rotate(6.0);
     }
     painter.setPen(Qt::NoPen);
     painter.setBrush(secondColor);

     painter.save();
     painter.rotate(6.0*time.second());
     painter.drawConvexPolygon(secondHand 3);
     painter.restore();

     painter.setPen(secondColor);

     for (int j = 0; j < 60; ++j) {
         if ((j % 5) != 0)
             painter.drawLine(92 0 96 0);
         painter.rotate(6.0);
     }
 }

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      30720  2009-05-18 23:42  Exam1\bin\Debug\Exam1.exe

     文件      42496  2009-05-18 23:42  Exam1\bin\Debug\Exam1.pdb

     文件      14328  2009-05-18 23:46  Exam1\bin\Debug\Exam1.vshost.exe

     文件        490  2007-07-21 02:33  Exam1\bin\Debug\Exam1.vshost.exe.manifest

     文件        652  2009-05-18 23:42  Exam1\bin\Debug\Exam1.xml

     文件      13668  2009-05-18 23:42  Exam1\Exam1.Designer.vb

     文件       5814  2009-05-18 23:42  Exam1\Exam1.resx

     文件        905  2008-10-21 22:59  Exam1\Exam1.sln

    ..A..H.     27136  2009-05-18 23:46  Exam1\Exam1.suo

     文件       6726  2009-05-18 23:42  Exam1\Exam1.vb

     文件      13792  2008-10-22 11:24  Exam1\Exam1byLiliang.Designer.vb

     文件       5814  2008-10-22 11:24  Exam1\Exam1byLiliang.resx

     文件       6471  2008-10-22 11:24  Exam1\Exam1byLiliang.vb

     文件       4561  2008-10-22 11:26  Exam1\Exam1_SL.vbproj

     文件       1508  2008-10-22 11:26  Exam1\My Project\Application.Designer.vb

     文件        469  2008-10-22 11:26  Exam1\My Project\Application.myapp

     文件       1099  2008-04-03 10:02  Exam1\My Project\AssemblyInfo.vb

     文件       2773  2008-10-21 22:17  Exam1\My Project\Resources.Designer.vb

     文件       5612  2005-09-23 03:27  Exam1\My Project\Resources.resx

     文件       2969  2008-10-21 22:17  Exam1\My Project\Settings.Designer.vb

     文件        279  2005-09-23 03:27  Exam1\My Project\Settings.settings

     文件        180  2009-05-18 23:42  Exam1\obj\Debug\Exam1.Exam1.resources

     文件        180  2008-10-22 11:24  Exam1\obj\Debug\Exam1.Exam1byLiliang.resources

     文件      30720  2009-05-18 23:42  Exam1\obj\Debug\Exam1.exe

     文件        180  2008-10-21 22:53  Exam1\obj\Debug\Exam1.Exercise2.resources

     文件      42496  2009-05-18 23:42  Exam1\obj\Debug\Exam1.pdb

     文件        180  2008-10-22 11:26  Exam1\obj\Debug\Exam1.Resources.resources

     文件        652  2009-05-18 23:42  Exam1\obj\Debug\Exam1.xml

     文件       1376  2009-05-18 23:46  Exam1\obj\Debug\Exam1_SL.vbproj.FileListAbsolute.txt

     文件        847  2009-05-18 23:42  Exam1\obj\Debug\Exam1_SL.vbproj.GenerateResource.Cache

............此处省略14个文件信息

评论

共有 条评论