QTfrontend/pages.h
changeset 1148 e44de3416af4
parent 1129 b74ffca22762
child 1149 c2d3b4f71836
--- a/QTfrontend/pages.h	Mon Aug 04 17:47:11 2008 +0000
+++ b/QTfrontend/pages.h	Mon Aug 04 19:04:46 2008 +0000
@@ -59,18 +59,34 @@
   }
   virtual ~AbstractPage() {};
 
-  QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx) {
+  QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx, const QSize sz=QSize(0, 0)) {
     QPushButton* butt = new QPushButton(this);
-    butt->setFont(*font14);
-    butt->setText(btname);
+    if (sz==QSize(0, 0)) {
+      butt->setFont(*font14);
+      butt->setText(btname);
+    } else {
+      const QIcon& lp=QIcon(btname);
+      butt->setIcon(lp);
+      butt->setFixedSize(sz+QSize(2, 2));
+      butt->setIconSize(sz);
+      butt->setFlat(true);
+    }
     grid->addWidget(butt, wy, wx);
     return butt;
   };
 
-  QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx, int rowSpan, int columnSpan) {
+  QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx, int rowSpan, int columnSpan, const QSize sz=QSize(0, 0)) {
     QPushButton* butt = new QPushButton(this);
-    butt->setFont(*font14);
-    butt->setText(btname);
+    if (sz==QSize(0, 0)) {
+      butt->setFont(*font14);
+      butt->setText(btname);
+    } else {
+      const QIcon& lp=QIcon(btname);
+      butt->setIcon(lp);
+      butt->setFixedSize(sz+QSize(2, 2));
+      butt->setIconSize(sz);
+      butt->setFlat(true);
+    }
     grid->addWidget(butt, wy, wx, rowSpan, columnSpan);
     return butt;
   };