本文整理汇总了C++中QSplitter::setCollapsible方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplitter::setCollapsible方法的具体用法?C++ QSplitter::setCollapsible怎么用?C++ QSplitter::setCollapsible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplitter
的用法示例。
在下文中一共展示了QSplitter::setCollapsible方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wrap
QSplitter* SplitView::wrap(BufferView* view, Qt::Orientation orientation)
{
QSplitter* container = qobject_cast<QSplitter*>(view->parentWidget());
if (container) {
int index = container->indexOf(view);
QSplitter* splitter = new QSplitter(orientation, container);
container->insertWidget(index, splitter);
container->setCollapsible(index, false);
splitter->addWidget(view);
splitter->setCollapsible(0, false);
return splitter;
}
return 0;
}
示例2: createLayout
void MainWindow::createLayout()
{
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->setContentsMargins(0,0,0,0);
QWidget* center = new QWidget(this);
center->setLayout(mainLayout);
setCentralWidget(center);
resize(Preferences::MainWindowSize());
mainLayout->addWidget(&m_toolBar);
m_helpBrowser.setWindowFlags(Qt::Tool);
// sideSplitter (ha ha) is a data member as we need to control its visibility
m_sideSplitter = new QSplitter(Qt::Vertical, this);
m_sideSplitter->addWidget(&m_viewerView);
/*
QWidget* progress = new QWidget(this);
progress->setLayoutDirection(
progress->addWidget();
progress->addWidget(&m_status);
progress->addWidget(&m_progressBar);
*/
m_sideSplitter->addWidget(&m_undoStackView);
m_sideSplitter->setCollapsible(0, true);
m_sideSplitter->setCollapsible(1, true);
QList<int> sizes;
sizes << Preferences::MainWindowSize().height()-220 << 220;
m_sideSplitter->setSizes(sizes);
// Main splitter
QSplitter* splitter = new QSplitter(Qt::Horizontal, this);
splitter->addWidget(m_sideSplitter);
splitter->addWidget(&m_viewer);
splitter->setCollapsible(0, true);
splitter->setCollapsible(1, false);
sizes.clear();
if (Preferences::ShowModelView()) {
sizes << 220 << Preferences::MainWindowSize().width()-200;
}else {
sizes << 0;
}
splitter->setSizes(sizes);
mainLayout->addWidget(splitter);
connect(splitter, SIGNAL(splitterMoved(int, int)), this, SLOT(splitterMoved(int, int)));
}
示例3: QWidget
ScriptWidget::ScriptWidget()
: QWidget(),
inventoryTag(NULL)
{
//Setup widgets.
QPushButton* runButton = new QPushButton("Run");
scriptTextEdit = new QPlainTextEdit();
consoleTextEdit = new QTextEdit();
consoleTextEdit->setReadOnly(true);
QPalette textPalette = palette();
textPalette.setColor(QPalette::Active,QPalette::Base,QColor(0,0,0));
textPalette.setColor(QPalette::Disabled,QPalette::Base,QColor(0,0,0));
textPalette.setColor(QPalette::Active,QPalette::Text,QColor(212,212,212));
textPalette.setColor(QPalette::Disabled,QPalette::Text,QColor(212,212,212));
consoleTextEdit->setPalette(textPalette);
QSplitter* splitter = new QSplitter(Qt::Vertical);
splitter->addWidget(scriptTextEdit);
splitter->addWidget(consoleTextEdit);
splitter->setCollapsible(0,false);
//Layout widgets.
QVBoxLayout* topLayout = new QVBoxLayout();
topLayout->addWidget(runButton);
topLayout->addWidget(splitter,1);
setLayout(topLayout);
setEnabled(false);
//Connect events.
connect(runButton,SIGNAL(pressed()),SLOT(RunScript()));
//Load previous lua script if one is available.
const QString settingsDir = FilePath::GetInvGridSettingsDirectory().c_str();
LoadScript(settingsDir + "auto.lua");
}
示例4: initialize
void PersonalMessageWidget::initialize() {
setWindowTitle("Trek Personal Chat");
// QFont f = mUsernameLabel.font();
// f.setPointSize(11);
// mUsernameLabel.setFont(f);
mSendButton.setText("Send");
mSendButton.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
mConversationText.setReadOnly(true);
mInputText.installEventFilter(this);
QHBoxLayout* inputLayout = new QHBoxLayout();
QWidget* inputWidget = new QWidget();
inputLayout->addWidget(&mInputText);
inputLayout->addWidget(&mSendButton);
inputWidget->setLayout(inputLayout);
QSplitter* splitter = new QSplitter();
splitter->setOrientation(Qt::Vertical);
splitter->addWidget(&mConversationText);
splitter->addWidget(inputWidget);
splitter->setCollapsible(0,false);
splitter->setCollapsible(1,false);
splitter->setHandleWidth(15);
mToolbar.setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
mSaveAction = mToolbar.addAction("Save");
mClearAction = mToolbar.addAction("Clear");
mGMainLayout.addWidget(&mUserIconLabel,0,2,2,1,Qt::AlignRight);
mGMainLayout.addWidget(&mToolbar, 1,0,1,2); //,1,2);
mGMainLayout.addWidget(&mUsernameLabel,0,0,Qt::AlignLeft);
mGMainLayout.addWidget(splitter, 2,0,1,3);
setLayout(&mGMainLayout);
QList<int> sizes;
sizes.append(400);
sizes.append(100);
splitter->setSizes(sizes);
userDataAltered();
connect(mClearAction, SIGNAL(triggered()), &mConversationText, SLOT(clear()));
connect(mSaveAction, SIGNAL(triggered()), this, SLOT(save()));
connect(&mSendButton, SIGNAL(clicked()), this, SLOT(send()));
connect(mUserData, SIGNAL(dataAltered()), this, SLOT(userDataAltered()));
connect(this, SIGNAL(controller_serverPersonalSpeak(const QUuid&, const QString&)), Controller::self(), SIGNAL(serverPersonalSpeak(const QUuid&, const QString&)));
connect(Controller::self(), SIGNAL(personalCommuniqueReceived(const QUuid&, const QString&)), this, SLOT(controller_personalCommuniqueReceived(const QUuid&, const QString&)));
}
示例5: KDialog
ExportDialog::ExportDialog( const QString& remoteTypeName,
AbstractModelExporterConfigEditor* configEditor,
QWidget* parent )
: KDialog( parent ),
mConfigEditor( configEditor )
{
setCaption( i18nc("@title:window","Export") );
setButtons( Ok | Cancel );
setButtonGuiItem( Ok, KGuiItem(i18nc("@action:button","&Export to File..."), QLatin1String("document-export"),
i18nc("@info:tooltip","Export the selected data to a file."),
i18nc("@info:whatsthis","If you press the <interface>Export to file</interface> "
"button, the selected data will be copied to a file "
"with the settings you entered above.")) );
setDefaultButton( Ok );
QSplitter* splitter = new QSplitter( this );
setMainWidget( splitter );
// config editor
QWidget* editorPage = new QWidget( splitter );
QVBoxLayout* editorPageLayout = new QVBoxLayout( editorPage );
QLabel* editorLabel = new QLabel( remoteTypeName );
QFont font = editorLabel->font();
font.setBold( true );
editorLabel->setFont( font );
editorPageLayout->addWidget( editorLabel );
editorPageLayout->addWidget( mConfigEditor );
editorPageLayout->addStretch();
splitter->addWidget( editorPage );
splitter->setCollapsible( 0, false );
mPreviewView = configEditor->createPreviewView();
if( mPreviewView )
{
QGroupBox* previewBox = new QGroupBox( i18nc("@title:group","Preview"), this );
splitter->addWidget( previewBox );
QHBoxLayout* previewBoxLayout = new QHBoxLayout( previewBox );
previewBoxLayout->addWidget( mPreviewView->widget() );
}
enableButtonOk( configEditor->isValid() );
connect( configEditor, SIGNAL(validityChanged(bool)), SLOT(enableButtonOk(bool)) );
}
示例6: QWidget
QueryWidget::QueryWidget(proxy::IServerSPtr server, QWidget* parent) : QWidget(parent), server_(server) {
shell_widget_ = BaseShellWidget::createWidget(server);
output_widget_ = new OutputWidget(server);
QVBoxLayout* mainLayout = new QVBoxLayout;
QSplitter* splitter = new QSplitter(Qt::Vertical);
splitter->addWidget(shell_widget_);
splitter->addWidget(output_widget_);
splitter->setCollapsible(0, false);
splitter->setCollapsible(1, false);
splitter->setStretchFactor(0, 1);
splitter->setStretchFactor(1, 3);
splitter->setHandleWidth(1);
mainLayout->addWidget(splitter);
setLayout(mainLayout);
}
示例7: setText
ChWindow::ChWindow()
{
QWidget *centralWidget = new QWidget;
QVBoxLayout* mainLayout = new QVBoxLayout;
QSplitter *spl = new QSplitter(Qt::Horizontal);
m_tabLeft = createLeftPane();
m_wRight = new RightPaneWidget;
spl->addWidget(m_tabLeft);
spl->addWidget(m_wRight);
spl->setStretchFactor(0, 0);
spl->setStretchFactor(1, 1);
spl->setCollapsible(0, false);
spl->setCollapsible(1, false);
mainLayout->addWidget(spl);
centralWidget->setLayout(mainLayout);
setCentralWidget(centralWidget);
connect(m_trSongs, SIGNAL(songSelected(const Song&)), m_wRight, SLOT(songSelected(const Song&)));
connect(m_trSongs, SIGNAL(noSongSelected()), m_wRight, SLOT(noSongSelected()));
connect(m_trSongs, SIGNAL(quit()), this, SLOT(onQuit()));
void setText(int textIndex, const QString& text);
void deleteText(int textIndex);
connect(m_wRight, SIGNAL(setText(int, const QString&)), m_trSongs, SLOT(saveText(int, const QString&)));
connect(m_wRight, SIGNAL(deleteText(int)), m_trSongs, SLOT(deleteText(int)));
setWindowTitle(tr("Chords"));
setMinimumSize(160, 160);
resize(600, 400);
}
示例8: createWidgets
void MainWindow::createWidgets()
{
setCentralWidget(new QWidget(this));
QVBoxLayout* mainFormBaseLayout = new QVBoxLayout(centralWidget(), 1, 1);
QSplitter* splitter = new QSplitter(centralWidget());
splitter->setOrientation( Qt::Vertical );
mainFormBaseLayout->addWidget(splitter);
m_tabEditor = new EditorTabWidget(splitter, this);
splitter->setCollapsible(m_tabEditor, false);
splitter->setOpaqueResize(true);
QTabWidget* tabDebug = new QTabWidget(splitter);
splitter->setCollapsible(tabDebug, false);
tabDebug->setGeometry(0,0,0,height()/15);
QWidget* globalVarTab = new QWidget(tabDebug);
QVBoxLayout* globalVarTabLayout = new QVBoxLayout(globalVarTab, 1, 1);
m_globaVarList = new VariablesListView(globalVarTab);
globalVarTabLayout->addWidget(m_globaVarList);
tabDebug->insertTab(globalVarTab, QString("Global"));
QWidget* tabStack = new QWidget(tabDebug);
QVBoxLayout* varTabLayout = new QVBoxLayout(tabStack, 1, 1);
QHBoxLayout* stackComboLayout = new QHBoxLayout(0, 6, 6);
QLabel* stackLabel = new QLabel(tabStack);
stackLabel->setText(("Stack:"));
stackLabel->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, stackLabel->sizePolicy().hasHeightForWidth()));
stackComboLayout->addWidget(stackLabel);
m_stackCombo = new DebuggerComboStack(tabStack);
stackComboLayout->addWidget(m_stackCombo);
varTabLayout->addLayout(stackComboLayout);
m_localVarList= new VariablesListView(tabStack);
varTabLayout->addWidget(m_localVarList);
tabDebug->insertTab(tabStack, QString("Local"));
QWidget* tabWatch = new QWidget(tabDebug);
QVBoxLayout* watchTabLayout = new QVBoxLayout(tabWatch, 1, 1);
QHBoxLayout* addWatchLayout = new QHBoxLayout(0, 6, 6);
QLabel* addLabel = new QLabel(tabWatch);
addLabel->setText(("Watch:"));
addWatchLayout->addWidget(addLabel);
m_edAddWatch = new KLineEdit(tabWatch);
m_edAddWatch->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, m_edAddWatch->sizePolicy().hasHeightForWidth()));
addWatchLayout->addWidget(m_edAddWatch);
m_btAddWatch = new KPushButton(tabWatch);
m_btAddWatch->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, m_btAddWatch->sizePolicy().hasHeightForWidth()));
m_btAddWatch->setText(("Add"));
addWatchLayout->addWidget(m_btAddWatch);
QSpacerItem* spacer = new QSpacerItem(430, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
addWatchLayout->addItem(spacer);
watchTabLayout->addLayout(addWatchLayout);
m_watchList = new WatchListView(tabWatch);
watchTabLayout->addWidget(m_watchList);
tabDebug->insertTab(tabWatch, QString("Watch"));
QWidget* breakpointTab = new QWidget(tabDebug);
QVBoxLayout* breakpointTabLayout = new QVBoxLayout(breakpointTab, 1, 1);
m_breakpointList = new BreakpointListView(breakpointTab);
breakpointTabLayout->addWidget(m_breakpointList);
tabDebug->insertTab(breakpointTab, QString("Breakpoints"));
QWidget* logTab = new QWidget(tabDebug);
QVBoxLayout* logTabLayout = new QVBoxLayout(logTab, 1, 1);
m_logListView = new LogListView(logTab);
logTabLayout->addWidget(m_logListView);
tabDebug->insertTab(logTab, QString("Messages"));
QWidget* outputTab = new QWidget(tabDebug);
QVBoxLayout* outputTabLayout = new QVBoxLayout(outputTab, 1, 1);
m_edOutput = new KTextEdit(outputTab);
outputTabLayout->addWidget(m_edOutput);
m_edOutput->setReadOnly(true);
m_edOutput->setTextFormat(Qt::PlainText);
m_edOutput->setPaper( QBrush(QColor("white")));
/*
KTextEditor::Document* doc = KTextEditor::EditorChooser::createDocument(
0L, "KTextEditor::Document");
//doc->setReadWrite(false);
m_edOutput = dynamic_cast<KTextEditor::EditInterface*>(doc);
m_edOutput->setText("oioi");
outputTabLayout->addWidget(doc->createView(outputTab));
*/
tabDebug->insertTab(outputTab, QString("Output"));
//.........这里部分代码省略.........