24 #include <qapplication.h>
36 setToggleButton(
true);
37 setAutoDefault(
false);
38 setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
39 connect(
this,SIGNAL(
toggled(
bool )),SLOT(slotToggled(
bool)));
52 if(m_position != p_pos)
63 QString _text = text();
66 QFontMetrics fm = this->fontMetrics();
67 int w = fm.height()+5;
68 int h = 24+fm.width(_text);
69 return style().sizeFromContents(QStyle::CT_ToolButton,
this,
70 QSize(w, h)).expandedTo(QApplication::globalStrut());
73 void VTab::drawButton(QPainter *p)
76 QStyle::SFlags st = QStyle::Style_Default | QStyle::Style_Enabled;
78 st |= QStyle::Style_On;
79 st |= QStyle::Style_Down;
82 QRect r(0, 0, height(), width());
85 p->translate(0, height());
89 p->translate(width(), 0);
93 style().drawControl(QStyle::CE_PushButton, p,
this, r, colorGroup(), st);
94 style().drawControl(QStyle::CE_PushButtonLabel, p,
this, r, colorGroup(), st);
101 QPushButton::setText(s);
103 setFixedHeight(sz.height());
104 setFixedWidth(sz.width());
108 void VTab::slotToggled(
bool b)