A<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FQTabWidget</id>
		<title>C++/Qt/QTabWidget - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FQTabWidget"/>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTabWidget&amp;action=history"/>
		<updated>2026-04-18T18:31:39Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTabWidget&amp;diff=1104&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTabWidget&amp;diff=1104&amp;oldid=prev"/>
				<updated>2010-05-25T14:21:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 14:21, 25 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTabWidget&amp;diff=1105&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTabWidget&amp;diff=1105&amp;oldid=prev"/>
				<updated>2010-05-25T10:24:49Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия: Импорт контента...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Tab dialog==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the examples of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#ifndef TABDIALOG_H&lt;br /&gt;
#define TABDIALOG_H&lt;br /&gt;
#include &amp;lt;QDialog&amp;gt;&lt;br /&gt;
QT_BEGIN_NAMESPACE&lt;br /&gt;
class QDialogButtonBox;&lt;br /&gt;
class QFileInfo;&lt;br /&gt;
class QTabWidget;&lt;br /&gt;
QT_END_NAMESPACE&lt;br /&gt;
&lt;br /&gt;
class GeneralTab : public QWidget&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
public:&lt;br /&gt;
    GeneralTab(const QFileInfo &amp;amp;fileInfo, QWidget *parent = 0);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class PermissionsTab : public QWidget&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
public:&lt;br /&gt;
    PermissionsTab(const QFileInfo &amp;amp;fileInfo, QWidget *parent = 0);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class ApplicationsTab : public QWidget&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
public:&lt;br /&gt;
    ApplicationsTab(const QFileInfo &amp;amp;fileInfo, QWidget *parent = 0);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class TabDialog : public QDialog&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
public:&lt;br /&gt;
    TabDialog(const QString &amp;amp;fileName, QWidget *parent = 0);&lt;br /&gt;
private:&lt;br /&gt;
    QTabWidget *tabWidget;&lt;br /&gt;
    QDialogButtonBox *buttonBox;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
#include &amp;quot;tabdialog.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TabDialog::TabDialog(const QString &amp;amp;fileName, QWidget *parent)&lt;br /&gt;
    : QDialog(parent)&lt;br /&gt;
{&lt;br /&gt;
    QFileInfo fileInfo(fileName);&lt;br /&gt;
    tabWidget = new QTabWidget;&lt;br /&gt;
    tabWidget-&amp;gt;addTab(new GeneralTab(fileInfo), tr(&amp;quot;General&amp;quot;));&lt;br /&gt;
    tabWidget-&amp;gt;addTab(new PermissionsTab(fileInfo), tr(&amp;quot;Permissions&amp;quot;));&lt;br /&gt;
    tabWidget-&amp;gt;addTab(new ApplicationsTab(fileInfo), tr(&amp;quot;Applications&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok&lt;br /&gt;
 &lt;br /&gt;
                                     | QDialogButtonBox::Cancel);&lt;br /&gt;
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));&lt;br /&gt;
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
    QVBoxLayout *mainLayout = new QVBoxLayout;&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(tabWidget);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(buttonBox);&lt;br /&gt;
    setLayout(mainLayout);&lt;br /&gt;
&lt;br /&gt;
    setWindowTitle(tr(&amp;quot;Tab Dialog&amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
GeneralTab::GeneralTab(const QFileInfo &amp;amp;fileInfo, QWidget *parent)&lt;br /&gt;
    : QWidget(parent)&lt;br /&gt;
{&lt;br /&gt;
    QLabel *fileNameLabel = new QLabel(tr(&amp;quot;File Name:&amp;quot;));&lt;br /&gt;
    QLineEdit *fileNameEdit = new QLineEdit(fileInfo.fileName());&lt;br /&gt;
    QLabel *pathLabel = new QLabel(tr(&amp;quot;Path:&amp;quot;));&lt;br /&gt;
    QLabel *pathValueLabel = new QLabel(fileInfo.absoluteFilePath());&lt;br /&gt;
    pathValueLabel-&amp;gt;setFrameStyle(QFrame::Panel | QFrame::Sunken);&lt;br /&gt;
    QLabel *sizeLabel = new QLabel(tr(&amp;quot;Size:&amp;quot;));&lt;br /&gt;
    qlonglong size = fileInfo.size()/1024;&lt;br /&gt;
    QLabel *sizeValueLabel = new QLabel(tr(&amp;quot;%1 K&amp;quot;).arg(size));&lt;br /&gt;
    sizeValueLabel-&amp;gt;setFrameStyle(QFrame::Panel | QFrame::Sunken);&lt;br /&gt;
    QLabel *lastReadLabel = new QLabel(tr(&amp;quot;Last Read:&amp;quot;));&lt;br /&gt;
    QLabel *lastReadValueLabel = new QLabel(fileInfo.lastRead().toString());&lt;br /&gt;
    lastReadValueLabel-&amp;gt;setFrameStyle(QFrame::Panel | QFrame::Sunken);&lt;br /&gt;
    QLabel *lastModLabel = new QLabel(tr(&amp;quot;Last Modified:&amp;quot;));&lt;br /&gt;
    QLabel *lastModValueLabel = new QLabel(fileInfo.lastModified().toString());&lt;br /&gt;
    lastModValueLabel-&amp;gt;setFrameStyle(QFrame::Panel | QFrame::Sunken);&lt;br /&gt;
    QVBoxLayout *mainLayout = new QVBoxLayout;&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(fileNameLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(fileNameEdit);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(pathLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(pathValueLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(sizeLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(sizeValueLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(lastReadLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(lastReadValueLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(lastModLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(lastModValueLabel);&lt;br /&gt;
    mainLayout-&amp;gt;addStretch(1);&lt;br /&gt;
    setLayout(mainLayout);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
PermissionsTab::PermissionsTab(const QFileInfo &amp;amp;fileInfo, QWidget *parent)&lt;br /&gt;
    : QWidget(parent)&lt;br /&gt;
{&lt;br /&gt;
    QGroupBox *permissionsGroup = new QGroupBox(tr(&amp;quot;Permissions&amp;quot;));&lt;br /&gt;
    QCheckBox *readable = new QCheckBox(tr(&amp;quot;Readable&amp;quot;));&lt;br /&gt;
    if (fileInfo.isReadable())&lt;br /&gt;
        readable-&amp;gt;setChecked(true);&lt;br /&gt;
    QCheckBox *writable = new QCheckBox(tr(&amp;quot;Writable&amp;quot;));&lt;br /&gt;
    if ( fileInfo.isWritable() )&lt;br /&gt;
        writable-&amp;gt;setChecked(true);&lt;br /&gt;
    QCheckBox *executable = new QCheckBox(tr(&amp;quot;Executable&amp;quot;));&lt;br /&gt;
    if ( fileInfo.isExecutable() )&lt;br /&gt;
        executable-&amp;gt;setChecked(true);&lt;br /&gt;
    QGroupBox *ownerGroup = new QGroupBox(tr(&amp;quot;Ownership&amp;quot;));&lt;br /&gt;
    QLabel *ownerLabel = new QLabel(tr(&amp;quot;Owner&amp;quot;));&lt;br /&gt;
    QLabel *ownerValueLabel = new QLabel(fileInfo.owner());&lt;br /&gt;
    ownerValueLabel-&amp;gt;setFrameStyle(QFrame::Panel | QFrame::Sunken);&lt;br /&gt;
    QLabel *groupLabel = new QLabel(tr(&amp;quot;Group&amp;quot;));&lt;br /&gt;
    QLabel *groupValueLabel = new QLabel(fileInfo.group());&lt;br /&gt;
    groupValueLabel-&amp;gt;setFrameStyle(QFrame::Panel | QFrame::Sunken);&lt;br /&gt;
    QVBoxLayout *permissionsLayout = new QVBoxLayout;&lt;br /&gt;
    permissionsLayout-&amp;gt;addWidget(readable);&lt;br /&gt;
    permissionsLayout-&amp;gt;addWidget(writable);&lt;br /&gt;
    permissionsLayout-&amp;gt;addWidget(executable);&lt;br /&gt;
    permissionsGroup-&amp;gt;setLayout(permissionsLayout);&lt;br /&gt;
    QVBoxLayout *ownerLayout = new QVBoxLayout;&lt;br /&gt;
    ownerLayout-&amp;gt;addWidget(ownerLabel);&lt;br /&gt;
    ownerLayout-&amp;gt;addWidget(ownerValueLabel);&lt;br /&gt;
    ownerLayout-&amp;gt;addWidget(groupLabel);&lt;br /&gt;
    ownerLayout-&amp;gt;addWidget(groupValueLabel);&lt;br /&gt;
    ownerGroup-&amp;gt;setLayout(ownerLayout);&lt;br /&gt;
    QVBoxLayout *mainLayout = new QVBoxLayout;&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(permissionsGroup);&lt;br /&gt;
    mainLayout-&amp;gt;addWidget(ownerGroup);&lt;br /&gt;
    mainLayout-&amp;gt;addStretch(1);&lt;br /&gt;
    setLayout(mainLayout);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
ApplicationsTab::ApplicationsTab(const QFileInfo &amp;amp;fileInfo, QWidget *parent)&lt;br /&gt;
    : QWidget(parent)&lt;br /&gt;
{&lt;br /&gt;
    QLabel *topLabel = new QLabel(tr(&amp;quot;Open with:&amp;quot;));&lt;br /&gt;
    QListWidget *applicationsListBox = new QListWidget;&lt;br /&gt;
    QStringList applications;&lt;br /&gt;
    for (int i = 1; i &amp;lt;= 30; ++i)&lt;br /&gt;
        applications.append(tr(&amp;quot;Application %1&amp;quot;).arg(i));&lt;br /&gt;
    applicationsListBox-&amp;gt;insertItems(0, applications);&lt;br /&gt;
    QCheckBox *alwaysCheckBox;&lt;br /&gt;
    if (fileInfo.suffix().isEmpty())&lt;br /&gt;
        alwaysCheckBox = new QCheckBox(tr(&amp;quot;Always use this application to &amp;quot;&lt;br /&gt;
            &amp;quot;open this type of file&amp;quot;));&lt;br /&gt;
    else&lt;br /&gt;
        alwaysCheckBox = new QCheckBox(tr(&amp;quot;Always use this application to &amp;quot;&lt;br /&gt;
            &amp;quot;open files with the extension &amp;quot;%1&amp;quot;&amp;quot;).arg(fileInfo.suffix()));&lt;br /&gt;
    QVBoxLayout *layout = new QVBoxLayout;&lt;br /&gt;
    layout-&amp;gt;addWidget(topLabel);&lt;br /&gt;
    layout-&amp;gt;addWidget(applicationsListBox);&lt;br /&gt;
    layout-&amp;gt;addWidget(alwaysCheckBox);&lt;br /&gt;
    setLayout(layout);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;quot;tabdialog.h&amp;quot;&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    QString fileName;&lt;br /&gt;
    if (argc &amp;gt;= 2)&lt;br /&gt;
        fileName = argv[1];&lt;br /&gt;
    else&lt;br /&gt;
        fileName = &amp;quot;.&amp;quot;;&lt;br /&gt;
    TabDialog tabdialog(fileName);&lt;br /&gt;
    return tabdialog.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>