test.cpp

Go to the documentation of this file.
00001 #include "test.h"
00002 
00003 #include <iisTaskPanel>
00004 
00005 test::test(QWidget *parent, Qt::WFlags flags)
00006         : QMainWindow(parent, flags)
00007 {
00008         ui.setupUi(this);
00009 
00010         iisTaskBox *tb1 = new iisTaskBox(QPixmap(":/images/win/filenew.png"), "Group of Tasks", true, this);
00011         ui.panel->addWidget(tb1);
00012 
00013         iisIconLabel *i1 = new iisIconLabel(QPixmap(":/images/win/zoomin.png"), "Do Task 1", tb1);
00014         tb1->addIconLabel(i1);
00015         connect(i1, SIGNAL(activated()), this, SLOT(task1()));
00016         //tb1->groupLayout()->addWidget(i1);
00017         iisIconLabel *i2 = new iisIconLabel(QPixmap(":/images/win/zoomout.png"), "Do Task 2", tb1);
00018         tb1->addIconLabel(i2);
00019         //tb1->groupLayout()->addWidget(i2);
00020 
00021         QHBoxLayout *hbl = new QHBoxLayout();
00022         tb1->groupLayout()->addLayout(hbl);
00023 
00024         iisIconLabel *i3 = new iisIconLabel(QPixmap(":/images/win/editcopy.png"), "Do Task 3", tb1);
00025         tb1->addIconLabel(i3, false);
00026         hbl->addWidget(i3);
00027         //tb1->groupLayout()->addWidget(i3);
00028         iisIconLabel *i4 = new iisIconLabel(QPixmap(":/images/win/editcut.png"), "Do Task 4", tb1);
00029         tb1->addIconLabel(i4, false);
00030         hbl->addWidget(i4);
00031         i4->setColors(Qt::red, Qt::green, Qt::gray);
00032         i4->setFocusPen(QPen());
00033         //tb1->groupLayout()->addWidget(i4);
00034         iisIconLabel *i5 = new iisIconLabel(QPixmap(":/images/win/editpaste.png"), "Do Task 5", tb1);
00035         tb1->addIconLabel(i5);
00036         //tb1->groupLayout()->addWidget(i5);
00037 
00038         iisTaskBox *tb2 = new iisTaskBox(QPixmap(":/images/win/fileprint.png"), "Another Group of Tasks", true, this);
00039         ui.panel->addWidget(tb2);
00040 
00041         iisIconLabel *i21 = new iisIconLabel(QPixmap(":/images/win/filenew.png"), "Do Task 2.1", tb2);
00042         tb2->addIconLabel(i21);
00043         //tb2->groupLayout()->addWidget(i21);
00044         iisIconLabel *i22 = new iisIconLabel(QPixmap(":/images/win/fileopen.png"), "Do Task 2.2", tb2);
00045         tb2->addIconLabel(i22);
00046         i22->setEnabled(false);
00047         //tb2->groupLayout()->addWidget(i22);
00048         iisIconLabel *i23 = new iisIconLabel(QPixmap(":/images/win/filesave.png"), "Do Task 2.3", tb2);
00049         tb2->addIconLabel(i23);
00050         //tb2->groupLayout()->addWidget(i23);
00051 
00052         iisTaskBox *tb3 = new iisTaskBox(QPixmap(), "Group without Icons", true, this);
00053         ui.panel->addWidget(tb3);
00054 
00055         iisIconLabel *i31 = new iisIconLabel(QPixmap(), "Do Task 3.1", tb3);
00056         tb3->addIconLabel(i31);
00057 
00058         iisIconLabel *i32 = new iisIconLabel(QPixmap(), "Do Task 3.2", tb3);
00059         tb3->addIconLabel(i32);
00060 
00061         tb3->groupLayout()->addWidget(new QLabel("Widgets also allowed:", this));
00062         tb3->groupLayout()->addWidget(new QPushButton("A Button", this));
00063 
00064 
00065         // Other widgets can be also added to the panel
00066         QLabel *l1 = new QLabel("A group without header", this);
00067         ui.panel->addWidget(l1);
00068 
00069 
00070         iisTaskGroup *tb4 = new iisTaskGroup(this);
00071         ui.panel->addWidget(tb4);
00072 
00073         iisIconLabel *i41 = new iisIconLabel(QPixmap(":/images/win/textbold.png"), "Do Task 4.1", tb4);
00074         tb4->addIconLabel(i41);
00075 
00076         iisIconLabel *i42 = new iisIconLabel(QPixmap(), "Do Task 4.2", tb4);
00077         tb4->addIconLabel(i42);
00078 
00079         ui.panel->addStretch();
00080 }
00081 
00082 test::~test()
00083 {
00084 
00085 }
00086 
00087 void test::task1()
00088 {
00089          QMessageBox::aboutQt(0);
00090 }
00091 

Generated on Wed Nov 23 19:00:45 2011 for FreeCAD by  doxygen 1.6.1