diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-06-17 16:18:32 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-06-18 14:23:51 +0200 |
commit | f77a7571e8227485b5a4a654fb4628e083de4f88 (patch) | |
tree | e1cf4191195d7b67694b9ce44efb08b6c7251413 /src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.cpp | |
parent | 703a3153ed3395990d5e3cdadaafd26cf27658fd (diff) | |
download | qt-creator-f77a7571e8227485b5a4a654fb4628e083de4f88.tar.gz |
QmlDesigner: Move TabViewDesignerAction to componentsplugin
Change-Id: Ib02092d38d4ba43ad3bed2460f7eb9615bd06fa7
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.cpp')
-rw-r--r-- | src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.cpp b/src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.cpp new file mode 100644 index 0000000000..84002ceb15 --- /dev/null +++ b/src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.cpp @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "addtabtotabviewdialog.h" +#include "ui_addtabtotabviewdialog.h" + +namespace QmlDesigner { + +AddTabToTabViewDialog::AddTabToTabViewDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AddTabToTabViewDialog) +{ + ui->setupUi(this); + ui->addTabLineEdit->setForceFirstCapitalLetter(true); +} + +AddTabToTabViewDialog::~AddTabToTabViewDialog() +{ + delete ui; +} + + +QString AddTabToTabViewDialog::create(const QString &tabName, QWidget *parent) +{ + AddTabToTabViewDialog addTabToTabViewDialog(parent); + + Utils::FileNameValidatingLineEdit *fileNameValidatingLineEdit = addTabToTabViewDialog.ui->addTabLineEdit; + + fileNameValidatingLineEdit->setText(tabName); + + int result = addTabToTabViewDialog.exec(); + + if (result == QDialog::Accepted && fileNameValidatingLineEdit->isValid()) + return fileNameValidatingLineEdit->text(); + else + return QString(); +} + +} // namespace QmlDesigner |