+ extend QSint API, fix problems with Qt macro
This commit is contained in:
parent
83bef31698
commit
61db2cb15e
|
@ -167,7 +167,7 @@ void ActionGroup::processShow()
|
|||
myGroup->show();
|
||||
setFixedHeight(m_fullHeight+myHeader->height());
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
setMaximumHeight(9999);
|
||||
setMaximumHeight(QWIDGETSIZE_MAX);
|
||||
setMinimumHeight(0);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace QSint
|
|||
|
||||
|
||||
ActionPanel::ActionPanel(QWidget *parent) :
|
||||
BaseClass(parent)
|
||||
BaseClass(parent), mySpacer(0)
|
||||
{
|
||||
setProperty("class", "panel");
|
||||
|
||||
|
@ -64,9 +64,28 @@ void ActionPanel::addWidget(QWidget *w)
|
|||
layout()->addWidget(w);
|
||||
}
|
||||
|
||||
void ActionPanel::removeWidget(QWidget *w)
|
||||
{
|
||||
if (w)
|
||||
layout()->removeWidget(w);
|
||||
}
|
||||
|
||||
void ActionPanel::addStretch(int s)
|
||||
{
|
||||
((QVBoxLayout*)layout())->addStretch(s);
|
||||
//((QVBoxLayout*)layout())->addStretch(s);
|
||||
if (!mySpacer) {
|
||||
mySpacer = new QSpacerItem(0,0,QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
layout()->addItem(mySpacer);
|
||||
}
|
||||
}
|
||||
|
||||
void ActionPanel::removeStretch()
|
||||
{
|
||||
if (mySpacer) {
|
||||
layout()->removeItem(mySpacer);
|
||||
delete mySpacer;
|
||||
mySpacer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ActionGroup * ActionPanel::createGroup()
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#define ACTIONPANEL_H
|
||||
|
||||
#include <QFrame>
|
||||
#include <QSpacerItem>
|
||||
#include "qsint_global.h"
|
||||
|
||||
|
||||
|
@ -50,12 +51,20 @@ public:
|
|||
*/
|
||||
void addWidget(QWidget *w);
|
||||
|
||||
/** Removes the widget \a w from the ActionPanel's vertical layout.
|
||||
*/
|
||||
void removeWidget(QWidget *w);
|
||||
|
||||
/** Adds a spacer with width \a s to the ActionPanel's vertical layout.
|
||||
Normally you should do this after all the ActionGroups were added, in order to
|
||||
maintain some space below.
|
||||
*/
|
||||
void addStretch(int s = 0);
|
||||
|
||||
/** Removes the spacer -- if added -- from the ActionPanel's vertical layout.
|
||||
*/
|
||||
void removeStretch();
|
||||
|
||||
/** Creates and adds to the ActionPanel's vertical layout an empty ActionGroup without header.
|
||||
*/
|
||||
ActionGroup* createGroup();
|
||||
|
@ -86,6 +95,7 @@ protected:
|
|||
//virtual void paintEvent ( QPaintEvent * event );
|
||||
|
||||
ActionPanelScheme *myScheme;
|
||||
QSpacerItem *mySpacer;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
Q_SIGNALS:
|
||||
void activated();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void fold();
|
||||
|
||||
protected Q_SLOTS:
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "actionpanelscheme.h"
|
||||
|
||||
|
||||
namespace QSint
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user