Source Code (Use browser search to find items of interest.)
Class Index
kdelibs'QPopupFrame (./kdelibs/kdeui/kdatetbl.h:102)
class QPopupFrame : public QFrame
{
Q_OBJECT
protected:
/** The result. It is returned from exec() when the popup window closes. */
int result;
/** Catch key press events. */
void keyPressEvent(QKeyEvent* e);
/** The only subwidget that uses the whole dialog window. */
QWidget *main;
public slots:
/** Close the popup window. This is called from the main widget, usually.
r is the result returned from exec(). */
void close(int r);
public:
/** The contructor. Creates a dialog without buttons. */
QPopupFrame(QWidget* parent=0, const char* name=0);
/** Set the main widget. You cannot set the main widget from the constructor,
since it must be a child of the frame itselfes.
Be careful: the size is set to the main widgets size. It is up to you to
set the main widgets correct size before setting it as the main
widget. */
void setMainWidget(QWidget* m);
/** The resize event. Simply resizes the main widget to the whole
widgets client size. */
void resizeEvent(QResizeEvent*);
/** Execute the popup window. */
int exec(QPoint p);
/** Dito. */
int exec(int x, int y);
private:
class KPopupFramePrivate;
KPopupFramePrivate *d;
};
/**
* Validates user-entered dates.
*/
kdelibs'QPopupFrame::QPopupFrame() (./kdelibs/kdeui/kdatetbl.cpp:513)
QPopupFrame::QPopupFrame(QWidget* parent, const char* name)
: QFrame(parent, name, WType_Popup),
result(0), // rejected
main(0)
{
setFrameStyle(QFrame::Box|QFrame::Raised);
setMidLineWidth(2);
}
void
kdelibs'QPopupFrame::keyPressEvent() (./kdelibs/kdeui/kdatetbl.cpp:523)
QPopupFrame::keyPressEvent(QKeyEvent* e)
{
if(e->key()==Key_Escape)
{
result=0; // rejected
kapp->exit_loop();
}
}
void
kdelibs'QPopupFrame::close() (./kdelibs/kdeui/kdatetbl.cpp:533)
QPopupFrame::close(int r)
{
result=r;
kapp->exit_loop();
}
void
kdelibs'QPopupFrame::setMainWidget() (./kdelibs/kdeui/kdatetbl.cpp:540)
QPopupFrame::setMainWidget(QWidget* m)
{
main=m;
if(main!=0)
{
resize(main->width()+2*frameWidth(), main->height()+2*frameWidth());
}
}
void
kdelibs'QPopupFrame::resizeEvent() (./kdelibs/kdeui/kdatetbl.cpp:550)
QPopupFrame::resizeEvent(QResizeEvent*)
{
if(main!=0)
{
main->setGeometry
(frameWidth(), frameWidth(),
width()-2*frameWidth(), height()-2*frameWidth());
}
}
int
kdelibs'QPopupFrame::exec() (./kdelibs/kdeui/kdatetbl.cpp:561)
QPopupFrame::exec(QPoint p)
{
return exec(p.x(), p.y());
}
int
kdelibs'QPopupFrame::exec() (./kdelibs/kdeui/kdatetbl.cpp:567)
QPopupFrame::exec(int x, int y)
{
move(x, y);
show();
repaint();
qApp->enter_loop();
hide();
return result;
}