{
setGeometry(200,200,500,300);
QPopupMenu *popup = new QPopupMenu(this);
SLOT(wyjscie()),toolbar);
popup->insertItem("&ttt",this,SLOT(info()));
menu->insertItem("&popup",popup);
addToolBar(toolbar);
QListBox *lista = new QListBox(this);
for(int i=1;i<=10;++i)
lista->insertItem(string); }
poziomy->addStretch();
poziomy->addWidget(button);
poziomy->addWidget(button2);
pionowy->addWidget(lista);
pionowy->addLayout(poziomy);
//resize(200,150);
}
dialog::dialog(QWidget *parent, const char *name) : QMainWindow(parent, name)
{
setGeometry(200,200,500,300);
QMenuBar *menu = new QMenuBar(this);
QPopupMenu *popup = new QPopupMenu(this);
QToolBar *toolbar = new QToolBar();
QToolButton *toolbutton = new QToolButton(QPixmap("fileopen"), "test","lszk",this,
SLOT(wyjscie()),toolbar);
popup->insertItem("&ttt",this,SLOT(info()));
menu->insertItem("&popup",popup);
addToolBar(toolbar);
QListBox *lista = new QListBox(this);
QPushButton *button = new QPushButton("ok",this);
QPushButton *button2 = new QPushButton("anuluj",this);
QVBoxLayout *pionowy = new QVBoxLayout(this);
QHBoxLayout *poziomy = new QHBoxLayout(this);
for(int i=1;i<=10;++i)
{ QString string = QString("Element numer %1").arg(i);
lista->insertItem(string); }
poziomy->addStretch();
poziomy->addWidget(button);
poziomy->addWidget(button2);
pionowy->addWidget(lista);
pionowy->addLayout(poziomy);
//resize(200,150);
}
To copy to clipboard, switch view to plain text mode
Bookmarks