//===========================================================================
//
// Parameters --------------------------------------------------------------
// HWND hwnd : window handle
// ULONG id  : button id
// Return value ------------------------------------------------------------
// VOID
//===========================================================================
static
VOID onCommand(HWND hwnd, ULONG id) {
   switch (id) {
      case BTN_REFRESH:
         enumClasses(hwnd, TRUE);
         break;
      case BTN_EDIT:
         editItem(hwnd);
         break;
      case BTN_ADD:
         addItem(hwnd);
         break;
      case BTN_DEREG:
         deregisterItem(hwnd);
         break;
      case BTN_REMOVE:
         removeItem(hwnd);
         break;
      case BTN_UPDATE:
         updateItem(hwnd);
         break;
      case BTN_CANCEL:
         cancelEditItem(hwnd);
         break;
//      case BTN_HELP:
//         { HOBJECT ho;
//            ho = WinQueryObject("F:\\dev\\PRJ\\WPSClassMgr\\002\\classmgr.htm");
//         WinOpenObject(ho,
//                       OPEN_DEFAULT, TRUE); }
//         break;
   } /* endswitch */
}
Пример #2
0
void TupItemManager::createFolder(const QString &name)
{
    if (name.isNull())
        folderName = tr("New folder %1").arg(foldersTotal);
    else
        folderName = name;

    QTreeWidgetItem *newFolder = new QTreeWidgetItem(this);
    newFolder->setFlags(newFolder->flags() | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
    newFolder->setIcon(0, QIcon(THEME_DIR + "icons/open.png"));
    newFolder->setText(1, folderName);
    newFolder->setText(2, "");

    newFolder->setFlags(newFolder->flags() | Qt::ItemIsEditable);

    foldersTotal++;

    m_currentFolder = newFolder;
    setCurrentItem(m_currentFolder);

    if (name.isNull()) {
        editItem(m_currentFolder, 1);
        emit itemCreated(newFolder);
    } 
}
Пример #3
0
GroupWidget::GroupWidget(QList <Group*> *group, QWidget *parent)
    : QWidget(parent), groupList(group)
{
    QHBoxLayout *h1 = new QHBoxLayout();

    {
        QLabel *l = new QLabel(tr("Group: "));
        addGroupEdit = new QLineEdit(this);
        connect(addGroupEdit, SIGNAL(editingFinished()), SLOT(createGroup()));
        addButton = new QPushButton(tr("Create"), this);
        connect(addGroupEdit, SIGNAL(textChanged(QString)),
                SLOT(changeAddGroup(QString)));
        connect(addButton, SIGNAL(clicked()), SLOT(createGroup()));
        addButton->setEnabled(false);
        h1->addWidget(l);
        h1->addWidget(addGroupEdit);
        h1->addWidget(addButton);
    }
    QHBoxLayout *h2 = new QHBoxLayout();
    {
        h2->setMargin(0);
        upButton = new QPushButton(this);
        upButton->setIcon(QIcon(":images/uparrow.png"));
        downButton = new QPushButton(this);
        downButton->setIcon(QIcon(":images/downarrow.png"));
        h2->addStretch();
        h2->addWidget(upButton);
        h2->addWidget(downButton);
        editButton = new QPushButton(this);
        editButton->setIcon(QIcon(":images/edit.png"));
        h2->addWidget(editButton);
        delButton = new QPushButton(this);
        delButton->setIcon(QIcon(":images/delete.png"));
        h2->addWidget(delButton);
    }
    groupListWidget = new QListWidget(this);
    QVBoxLayout *v = new QVBoxLayout;
    v->setMargin(0);
    v->setSpacing(0);
    v->addLayout(h1);
    v->addWidget(groupListWidget);
    v->addLayout(h2);
    setLayout(v);
    //qDebug() << "BookWidget 3";
    connect(upButton, SIGNAL(clicked()), SLOT(upItem()));
    connect(downButton, SIGNAL(clicked()), SLOT(downItem()));
    connect(editButton, SIGNAL(clicked()), SLOT(editItem()));
    connect(delButton, SIGNAL(clicked()), SLOT(delItem()));
    connect(groupListWidget, SIGNAL(currentRowChanged(int)),
            SLOT(changeRow(int)));
    connect(groupListWidget, SIGNAL(itemChanged(QListWidgetItem*)),
            SLOT(changeName(QListWidgetItem*)));
    connect(groupListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
            SLOT(editItem(QListWidgetItem*)));
    connect(groupListWidget,
            SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem*)),
            SLOT(changeSelect(QListWidgetItem *, QListWidgetItem*)));
    initGroup();
    resetButtons();
}
Пример #4
0
bool IngridientWindow::buttonBoxAcceptedEditMode(void) {
    bool isFood = ui->radioButton_1->isChecked();

    try {
        if ( isFood ) {
            editFood(dynamic_cast<Food*>(editedItem));
        } else {
            editItem(editedItem);
        }
    } catch ( IngridientWindowException e ) {
        QMessageBox msgBox;

        PRINT_ERR("Wrong value provided");

        msgBox.setText("Wrong value provided");
        msgBox.exec();

        return false;
    } catch ( EngineException e ) {
        QMessageBox msgBox;

        PRINT_ERR("Engine calculation error");

        msgBox.setText("Engine calculation error");
        msgBox.exec();

        return false;
    }

    return true;
}
Пример #5
0
void ParameterEdit::edit()
{
    if(_table->currentRow() != -1) 
    {
	editItem(_table->currentRow());
    }
}
Пример #6
0
void TreeListWidget::editDoubleClickedItem(QTreeWidgetItem *item, int col)
{
    if (item && m_isEditable) {
        item->setFlags(item->flags() | Qt::ItemIsEditable);
        editItem(item, col);
    }
}
ListDialog::ListDialog() : QDialog()
{
    ui.setupUi(this);

    connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addItem()));
    connect(ui.editButton, SIGNAL(clicked()), this, SLOT(editItem()));
    connect(ui.deleteButton, SIGNAL(clicked()), this, SLOT(deleteItem()));
}
	void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it)
	{
		if(!it)
		{
			for(int i=0;i<numRows();i++)
			{
				clearCell(i,0);
				clearCell(i,1);
				clearCellWidget(i,1);
			}
			setNumRows(0);
			return;
		}

		QMap<QString,QVariant> * m = 0;

		switch(KVI_CANVAS_RTTI_CONTROL_TYPE(it))
		{
			case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE:
				m = ((KviCanvasRectangleItem *)it)->properties();
			break;
			case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE:
				m = ((KviCanvasLine *)it)->properties();
			break;
			case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON:
				m = ((KviCanvasPolygon *)it)->properties();
			break;
		}

		if(!m)
		{
			editItem(0);
			return;
		}

		for(int i=0;i<numRows();i++)
		{
			clearCell(i,0);
			clearCell(i,1);
			clearCellWidget(i,1);
		}

		setNumRows(m->count());

		QTableItem * item;

		int idx = 0;

		for(QMap<QString,QVariant>::ConstIterator iter = m->begin();iter != m->end();++iter)
		{
			item = new QTableItem(this,QTableItem::Never,iter.key().toUtf8().data());
			setItem(idx,0,item);
			item = new KviVariantTableItem(this,iter.data());
			setItem(idx,1,item);
			idx++;
		}

	}
Пример #9
0
void IngridientWindow::editFood(Food* food) {
    PRINT_DEBUG("Editing food");

    editItem(food);
    food->setItemFats(QStringToFats(ui->lineEdit_3->text()));
    food->setItemProteins(QStringToProteins(ui->lineEdit_5->text()));
    food->setItemCarbohydrates(QStringToCarbohydrates(ui->lineEdit_6->text()));
    food->setItemCalories(QStringToCalories(ui->lineEdit_7->text()));
}
Пример #10
0
void KURLBar::slotContextMenuRequested(QListBoxItem *_item, const QPoint &pos)
{
    if(m_isImmutable)
        return;

    KURLBarItem *item = dynamic_cast< KURLBarItem * >(_item);

    static const int IconSize = 10;
    static const int AddItem = 20;
    static const int EditItem = 30;
    static const int RemoveItem = 40;

    KURL lastURL = m_activeItem ? m_activeItem->url() : KURL();

    bool smallIcons = m_iconSize < KIcon::SizeMedium;
    QPopupMenu *popup = new QPopupMenu();
    popup->insertItem(smallIcons ? i18n("&Large Icons") : i18n("&Small Icons"), IconSize);
    popup->insertSeparator();

    if(item != 0L && item->isPersistent())
    {
        popup->insertItem(SmallIconSet("edit"), i18n("&Edit Entry..."), EditItem);
        popup->insertSeparator();
    }

    popup->insertItem(SmallIconSet("filenew"), i18n("&Add Entry..."), AddItem);

    if(item != 0L && item->isPersistent())
    {
        popup->insertItem(SmallIconSet("editdelete"), i18n("&Remove Entry"), RemoveItem);
    }

    int result = popup->exec(pos);
    switch(result)
    {
        case IconSize:
            setIconSize(smallIcons ? KIcon::SizeMedium : KIcon::SizeSmallMedium);
            m_listBox->triggerUpdate(true);
            break;
        case AddItem:
            addNewItem();
            break;
        case EditItem:
            editItem(static_cast< KURLBarItem * >(item));
            break;
        case RemoveItem:
            delete item;
            m_isModified = true;
            break;
        default: // abort
            break;
    }

    // reset current item
    m_activeItem = 0L;
    setCurrentItem(lastURL);
}
Пример #11
0
void QCustomTableWidget::mouseDoubleClickEvent(QMouseEvent *)
{
    QTableWidgetItem *item = currentItem();
    if (item)
    {
        editItem(item);
        bEditing = true;
    }
}
Пример #12
0
void LibraryTreeWidget::rename()
{
	if (selectedItems().empty() == true)
		return;

	QTreeWidgetItem* item = selectedItems()[0];

	editItem(item, 0);

	checkModification();
}
Пример #13
0
void AQProjectTreeWidget::onAddGroupItemClicked()
{
	AGroupProjectNode * new_group = new AGroupProjectNode("new_group");
	m_pCurrentSelection->projectNode()->addChild(new_group);

	AQProjectNode * tw_node = new AQProjectNode(new_group, m_pCurrentSelection);
	if(!m_pCurrentSelection->isExpanded())
		m_pCurrentSelection->setExpanded(true);

	editItem(tw_node);
}
Пример #14
0
void TransfersDialog::updateProgress(int value)
{
	if(!isVisible())
		return ;

	for(int i = 0; i <= DLListModel->rowCount(); i++) {
		if(selection->isRowSelected(i, QModelIndex())) {
			editItem(i, PROGRESS, QVariant((double)value));
		}
	}
}
Пример #15
0
void UserFunctionListWidget::keyPressEvent(QKeyEvent* event)
{
    if (event->key() == Qt::Key_Delete)
        deleteItem();
    else if (event->key() == Qt::Key_E)
        editItem();
    else {
        QWidget::keyPressEvent(event);
        return;
    }
    event->accept();
}
Пример #16
0
bool KURLBar::addNewItem()
{
    KURLBarItem *item = new KURLBarItem(this, d->currentURL, i18n("Enter a description"));
    if(editItem(item))
    {
        m_listBox->insertItem(item);
        return true;
    }

    delete item;
    return false;
}
Пример #17
0
void RegisteredUsersDialog::itemDoubleClicked(QTreeWidgetItem *it, int)
{
	if(!it)return;
	RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)it;
	if(b->type()==RegisteredUsersDialogItemBase::User)
	{
		editItem((RegisteredUsersDialogItem *)it);
	} else	{
		RegisteredUsersGroupItem *i = (RegisteredUsersGroupItem *)b;
		editGroup(i->group());
	}
}
bool TreeView::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: editItem((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 1: onTimer(); break;
    case 2: onRightButtonClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 3: onEditFinished(); break;
    case 4: onWatchTimer(); break;
    case 5: onAccel((int)static_QUType_int.get(_o+1)); break;
    default:
	return QListView::qt_invoke( _id, _o );
    }
    return TRUE;
}
Пример #19
0
void SummaryTree::addTask()
{
    Task *newTask = new Task;
    newTask->setAnswerFileExtension(settings->getDefaultOutputFileExtension());
    curContest->addTask(newTask);
    newTask->refreshCompilerConfiguration(settings);
    connect(newTask, SIGNAL(problemTitleChanged(QString)),
            this, SLOT(titleChanged(QString)));
    QTreeWidgetItem *newItem = new QTreeWidgetItem(this);
    setCurrentItem(newItem);
    newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled);
    newItem->setText(0, tr("Problem %1").arg(++ addCount));
    editItem(newItem);
}
Пример #20
0
ParameterProperties::ParameterProperties(QWidget* parent, Qt::WindowFlags fl)
    : QDialog(parent, fl)
{
  setupUi(this);

  connect(_listDelete, SIGNAL(clicked()), this, SLOT(deleteItem()));
  connect(_listDown,   SIGNAL(clicked()), this, SLOT(moveItemDown()));
  connect(_listEdit,   SIGNAL(clicked()), this, SLOT(editItem()));
  connect(_listNew,    SIGNAL(clicked()), this, SLOT(newItem()));
  connect(_listUp,     SIGNAL(clicked()), this, SLOT(moveItemUp()));

  _int->setValidator(new QIntValidator(this));
  _double->setValidator(new QDoubleValidator(this));
}
Пример #21
0
/*
 *  Constructs a ListEdit as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
ListEdit::ListEdit(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(_ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(_cancel, SIGNAL(clicked()), this, SLOT(reject()));
    connect(_new, SIGNAL(clicked()), this, SLOT(newItem()));
    connect(_up, SIGNAL(clicked()), this, SLOT(moveItemUp()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(editItem()));
    connect(_down, SIGNAL(clicked()), this, SLOT(moveItemDown()));
    connect(_delete, SIGNAL(clicked()), this, SLOT(deleteItem()));
}
void EditDeleteComboBoxView::mousePressEvent( QMouseEvent *event )
{
    DEBUG_BLOCK
    
    QModelIndex index = indexAt( event->pos() );
    QPoint mousePressPos = event->pos();
    mousePressPos.rx() += horizontalOffset();
    mousePressPos.ry() += verticalOffset();

    if ( EditDeleteDelegate::hitsEdit( mousePressPos, rectForIndex( index ) ) )
        emit( editItem( index.data().toString() ) );
    else if ( EditDeleteDelegate::hitsDelete( mousePressPos, rectForIndex( index ) ) )
        emit( deleteItem( index.data().toString() ) );

    QListView::mousePressEvent( event );
}
Пример #23
0
// Add a new group item below the current one.
void qtractorFileListView::newGroup (void)
{
	qtractorFileGroupItem *pParentItem = currentGroupItem();
#if 0
	if (pParentItem && !pParentItem->isOpen())
		pParentItem = pParentItem->groupItem();
#endif
	qtractorFileGroupItem *pGroupItem
		= addGroupItem(tr("New Group"), pParentItem);
	if (pGroupItem) {
		pParentItem = pGroupItem->groupItem();
		if (pParentItem)
			pParentItem->setOpen(true);
		editItem(pGroupItem, 0);
	}
}
Пример #24
0
ViewConfigurationDialog::ViewConfigurationDialog(Project *project, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ViewConfigurationDialog),
    mProject(project)
{
    ui->setupUi(this);

    mViewModel = new ViewsModel(mProject);
    ui->viewView->setModel( mViewModel );

    mTabsModel = 0;
    mItemsModel = 0;
    mPhrasalGlossesModel = 0;

    mView = 0;
    mTab = 0;

    connect(ui->addView, SIGNAL(clicked()), this, SLOT(addView()) );
    connect(ui->removeView, SIGNAL(clicked()), this, SLOT(removeView()) );

    connect(ui->addTab, SIGNAL(clicked()), this, SLOT(addTab()) );
    connect(ui->removeTab, SIGNAL(clicked()), this, SLOT(removeTab()) );

    connect(ui->addItem, SIGNAL(clicked()), this, SLOT(addItem()) );
    connect(ui->removeItem, SIGNAL(clicked()), this, SLOT(removeItem()) );
    connect(ui->itemView, SIGNAL(activated(QModelIndex)), this, SLOT(editItem(QModelIndex)) );

    connect(ui->addPhrasalGloss, SIGNAL(clicked()), this, SLOT(addPhrasalGloss()) );
    connect(ui->removePhrasalGloss, SIGNAL(clicked()), this, SLOT(removePhrasalGloss()) );
    connect(ui->phrasalGlossView, SIGNAL(activated(QModelIndex)), this, SLOT(editPhrasalGloss(QModelIndex)) );

    connect(ui->viewView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(viewChanged(QItemSelection,QItemSelection)));
    connect(ui->itemWritingSystemsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(indexLanguageChanged(int)));

    connect(ui->viewUp, SIGNAL(clicked()), this, SLOT(viewUp()));
    connect(ui->viewDown, SIGNAL(clicked()), this, SLOT(viewDown()));
    connect(ui->tabUp, SIGNAL(clicked()), this, SLOT(tabUp()));
    connect(ui->tabDown, SIGNAL(clicked()), this, SLOT(tabDown()));
    connect(ui->itemUp, SIGNAL(clicked()), this, SLOT(itemUp()));
    connect(ui->itemDown, SIGNAL(clicked()), this, SLOT(itemDown()));
    connect(ui->phrasalGlossUp, SIGNAL(clicked()), this, SLOT(phrasalGlossUp()));
    connect(ui->phrasalGlossDown, SIGNAL(clicked()), this, SLOT(phrasalGlossDown()));

    setTabWidgetsEnabled(false);
    setItemWidgetsEnabled(false);
}
Пример #25
0
DayPage::DayPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0),
    m_dateLabel(0),
    m_itemList(0),
    m_menuBar(0)
{
    QVBoxLayout *mainLayout = new QVBoxLayout();

    QHBoxLayout *dateLayout = new QHBoxLayout();
    m_dateLabel = new QLabel(this);
    m_dateLabel->setAlignment(Qt::AlignCenter);
    dateLayout->addWidget(m_dateLabel);
    dateLayout->addStretch();
#ifndef Q_OS_SYMBIAN
    QPushButton* backButton = new QPushButton("View Month",this);
    connect(backButton,SIGNAL(clicked()),this,SLOT(viewMonthClicked()));
    dateLayout->addWidget(backButton);
#endif
    mainLayout->addLayout(dateLayout);

    m_itemList = new QListWidget(this);
    mainLayout->addWidget(m_itemList);
    connect(m_itemList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(itemDoubleClicked(QListWidgetItem *)));

    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton* editEventButton = new QPushButton("Edit",this);
    connect(editEventButton,SIGNAL(clicked()),this,SLOT(editItem()));
    hbLayout->addWidget(editEventButton);
    QPushButton* removeEventButton = new QPushButton("Remove",this);
    connect(removeEventButton,SIGNAL(clicked()),this,SLOT(removeItem()));
    hbLayout->addWidget(removeEventButton);
    mainLayout->addLayout(hbLayout);

#ifdef Q_OS_SYMBIAN
    // Add softkey for symbian
    QAction* backSoftKey = new QAction("View Month", this);
    backSoftKey->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(backSoftKey);
    connect(backSoftKey, SIGNAL(triggered(bool)), this, SLOT(viewMonthClicked()));
#endif

    setLayout(mainLayout);
}
Пример #26
0
long
MFXEditableTable::onLeftBtnClicked(FXObject* , FXSelector , void* ptr) {
    FXTablePos* e = (FXTablePos*)ptr;
    int r = e->row;
    int c = e->col;
    if (c == -1 || r == -1) {
        return 1;
    }
    killSelection(false);
    myEditedItem = getItem(r, c);
    myEditedCol = c;
    myEditedRow = r;
    if (c >= 0 && r >= 0) {
        editItem(myEditedItem, 0);
    } else {
        editEnd();
    }
    return 1;
}
Пример #27
0
void LibraryTreeWidget::newFolder()
{
	QTreeWidgetItem* root = invisibleRootItem();

	if (selectedItems().empty() == false)
		root = selectedItems().front();

	QTreeWidgetItem *item = createFolderItem("New Folder");

	root->setExpanded(true);
	if (root == invisibleRootItem())
		root->addChild(item);
	else
		root->insertChild(0, item);

	editItem(item, 0);

	checkModification();
}
void MusicSongsListWidget::setChangSongName()
{
    if(rowCount() == 0 || currentRow() < 0 ||
        currentItem()->column() != 1)
    {
        return;
    }
    if((currentRow() == m_playRowIndex) && m_musicSongsPlayWidget)
    //the playing widget allow renaming
    {
        m_musicSongsPlayWidget->setItemRename();
        return;
    }
    //others
    m_renameActived = true;
    m_renameItem = currentItem();
    openPersistentEditor(m_renameItem);
    editItem(m_renameItem);
}
Пример #29
0
BookmarkWidget::BookmarkWidget(QWidget *parent)
    : QWidget(parent)
{
    hbox1 = new QHBoxLayout();
    bTreeWidget = new BookmarkTreeWidget();
    // DT: allow for right-click popup context menu.
    bTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
    hbox1->addWidget(bTreeWidget);

    hbox2 = new QHBoxLayout();
    //newFolderButton = new QPushButton("New Folder");
    addButton = new QPushButton("Add");
    editButton = new QPushButton("Edit");
    deleteButton = new QPushButton("Delete");
    //newFolderButton->setEnabled(false);
    addButton->setEnabled(false);
    editButton->setEnabled(false);
    deleteButton->setEnabled(false);

    //hbox2->addWidget(newFolderButton);
    hbox2->addWidget(addButton);
    hbox2->addWidget(editButton);
    hbox2->addWidget(deleteButton);

    connect(bTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(handleDoubleClick(QTreeWidgetItem*,int)));
    connect(bTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(saveFolderState(QTreeWidgetItem*)));
    connect(bTreeWidget, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(saveFolderState(QTreeWidgetItem*)));
    connect(bTreeWidget, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(showContextMenu(const QPoint&)));
    //connect(newFolderButton, SIGNAL(clicked()), this, SLOT(createFolder()));
    connect(addButton, SIGNAL(clicked()), this, SLOT(createBookmark()));
    connect(editButton, SIGNAL(clicked()), this, SLOT(editItem()));
    connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteItem()));

    vbox = new QVBoxLayout();
    vbox->addLayout(hbox1);
    vbox->addLayout(hbox2);

    setLayout(vbox);
    show();

    renderingMode = NULL;
}
Пример #30
0
/*
 *  Constructs a ParameterEdit as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
ParameterEdit::ParameterEdit(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(_cancel, SIGNAL(clicked()), this, SLOT(reject()));
    connect(_ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(_new, SIGNAL(clicked()), this, SLOT(newItem()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(editItem()));
    connect(_delete, SIGNAL(clicked()), this, SLOT(deleteItem()));

    _table->horizontalHeader()->setLabel( 0, tr("Active") );
    _table->horizontalHeader()->setLabel( 1, tr("Name") );
    _table->horizontalHeader()->setLabel( 2, tr("Type") );
    _table->horizontalHeader()->setLabel( 3, tr("Value") );
    
    _table->setNumRows(0);
}