// Constructor. patchesDialog::patchesDialog( QWidget *pParent, Qt::WindowFlags wflags ) : QDialog( pParent, wflags ) { // Setup UI struct... setupUi( this ); m_pSynth = NULL; m_iChan = 0; m_iBank = 0; m_iProg = 0; // Soundfonts list view... QHeaderView *pHeader = m_progListView->header(); // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setDefaultAlignment(Qt::AlignLeft); // pHeader->setDefaultSectionSize(200); #if QT_VERSION >= 0x050000 pHeader->setSectionsMovable(false); #else pHeader->setMovable(false); #endif pHeader->setStretchLastSection(true); m_progListView->resizeColumnToContents(0); // Prog. //pHeader->resizeSection(1, 200); // Name. // Initial sort order... m_bankListView->sortItems(0, Qt::AscendingOrder); m_progListView->sortItems(0, Qt::AscendingOrder); // UI connections... QObject::connect(m_bankListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(bankChanged())); QObject::connect(m_progListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(progChanged(QTreeWidgetItem*,QTreeWidgetItem*))); QObject::connect(m_progListView, SIGNAL(itemActivated(QTreeWidgetItem*,int)), SLOT(accept())); QObject::connect(m_okButton, SIGNAL(clicked()), SLOT(accept())); QObject::connect(m_cancelButton, SIGNAL(clicked()), SLOT(reject())); }
void LogsWidget::initView() { ui->programLogTableView->setModel(programLogModel); ui->programLogTableView->setObjectName("programLogTableView"); //ui->programLogTableView->setAlternatingRowColors(true); ui->programLogTableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->programLogTableView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->programLogTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->programLogTableView->setColumnHidden(0,true); ui->programLogTableView->setColumnHidden(1,true); ui->programLogTableView->setColumnHidden(5,true); QHeaderView* headerView = ui->programLogTableView->horizontalHeader(); headerView->setResizeMode(2,QHeaderView::ResizeToContents); headerView->setStretchLastSection(true); ui->websiteLogTableView->setModel(blockedWebsiteLogModel); ui->websiteLogTableView->setObjectName("websiteLogTableView"); //ui->websiteLogTableView->setAlternatingRowColors(true); ui->websiteLogTableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->websiteLogTableView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->websiteLogTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->websiteLogTableView->setColumnHidden(0,true); ui->websiteLogTableView->setColumnHidden(1,true); ui->websiteLogTableView->setColumnHidden(5,true); headerView = ui->websiteLogTableView->horizontalHeader(); headerView->setResizeMode(2,QHeaderView::ResizeToContents); headerView->setStretchLastSection(true); ui->browseWebLogTableView->setModel(browseWebLogModel); ui->browseWebLogTableView->setObjectName("browseWebLogTableView"); //ui->browseWebLogTableView->setAlternatingRowColors(true); ui->browseWebLogTableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->browseWebLogTableView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->browseWebLogTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->browseWebLogTableView->setColumnHidden(0,true); ui->browseWebLogTableView->setColumnHidden(1,true); headerView = ui->browseWebLogTableView->horizontalHeader(); headerView->setResizeMode(2,QHeaderView::ResizeToContents); headerView->setStretchLastSection(true); ui->keyloggerLogTableView->setModel(keyloggerLogModel); ui->keyloggerLogTableView->setObjectName("keyloggerLogTableView"); //ui->keyloggerLogTableView->setAlternatingRowColors(true); ui->keyloggerLogTableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->keyloggerLogTableView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->keyloggerLogTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->keyloggerLogTableView->setColumnHidden(0,true); ui->keyloggerLogTableView->setColumnHidden(1,true); headerView = ui->keyloggerLogTableView->horizontalHeader(); headerView->setResizeMode(3,QHeaderView::ResizeToContents); headerView->setStretchLastSection(true); }
connectionListDialog::connectionListDialog(csv_connection * conn, QWidget *parent) : QDialog(parent), ui(new Ui::connectionListDialog) { ui->setupUi(this); this->conn = conn; ui->spinBox->setRange(0, INT_MAX); // set max from the component ui->spinBox->setValue(conn->getNumRows()); connect(ui->spinBox,SIGNAL(valueChanged(int)), this, SLOT(updateValSize(int))); this->vModel = new csv_connectionModel(); this->vModel->setConnection(conn); this->ui->tableView->setModel(this->vModel); QHeaderView * header = this->ui->tableView->horizontalHeader(); header->setStretchLastSection(true); //header->setResizeMode(0, QHeaderView::Fixed); header->resizeSection(0, 80); header->resizeSection(1, 80); // hide import button if is a pythonscript if (this->conn->generator != NULL) { this->ui->import_csv->setVisible(false); this->ui->tableView->setMinimumWidth(240); this->ui->spinBox->setEnabled(false); } connect(this->ui->import_csv,SIGNAL(clicked()), this, SLOT(importCSV())); connect(this->vModel,SIGNAL(setSpinBoxVal(int)), ui->spinBox, SLOT(setValue(int))); }
void ListView::setupGeometry() { QPalette pl = palette(); pl.setColor(QPalette::Base, ODD_LINE_COL); pl.setColor(QPalette::AlternateBase, EVEN_LINE_COL); setPalette(pl); // does not seem to inherit application paletteAnnotate QHeaderView* hv = header(); hv->setStretchLastSection(true); #if QT_VERSION < 0x050000 hv->setResizeMode(LOG_COL, QHeaderView::Interactive); hv->setResizeMode(TIME_COL, QHeaderView::Interactive); hv->setResizeMode(ANN_ID_COL, QHeaderView::ResizeToContents); #else hv->setSectionResizeMode(LOG_COL, QHeaderView::Interactive); hv->setSectionResizeMode(TIME_COL, QHeaderView::Interactive); hv->setSectionResizeMode(ANN_ID_COL, QHeaderView::ResizeToContents); #endif hv->resizeSection(GRAPH_COL, DEF_GRAPH_COL_WIDTH); hv->resizeSection(LOG_COL, DEF_LOG_COL_WIDTH); hv->resizeSection(AUTH_COL, DEF_AUTH_COL_WIDTH); hv->resizeSection(TIME_COL, DEF_TIME_COL_WIDTH); if (git->isMainHistory(fh)) hideColumn(ANN_ID_COL); }
FusionLayersSelectPage::FusionLayersSelectPage(QWidget* pParent) : FusionPage(pParent) { QLabel* pLayerLabel = new QLabel("Available Layers for Fusion", this); QStringList columnNames; columnNames.append(LAYER_NAME_COLUMN); columnNames.append(LAYER_TYPE_COLUMN); mpLayerView = new QTreeWidget(this); mpLayerView->setColumnCount(columnNames.count()); mpLayerView->setHeaderLabels(columnNames); mpLayerView->setSortingEnabled(true); mpLayerView->setSelectionMode(QAbstractItemView::ExtendedSelection); mpLayerView->setRootIsDecorated(false); QHeaderView* pHeader = mpLayerView->header(); if (pHeader != NULL) { pHeader->setSortIndicatorShown(true); pHeader->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter); pHeader->setStretchLastSection(false); pHeader->resizeSection(0, 250); } // Layout QVBoxLayout* pLayout = new QVBoxLayout(this); pLayout->setMargin(0); pLayout->setSpacing(5); pLayout->addWidget(pLayerLabel, 0, Qt::AlignLeft); pLayout->addWidget(mpLayerView, 10); // Connections connect(mpLayerView, SIGNAL(itemSelectionChanged()), this, SIGNAL(modified())); }
BodyStateViewImpl::BodyStateViewImpl(BodyStateView* self) : self(self) { self->setDefaultLayoutArea(View::BOTTOM); QVBoxLayout* vbox = new QVBoxLayout(); stateTreeWidget.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); stateTreeWidget.setSelectionMode(QAbstractItemView::NoSelection); stateTreeWidget.setAlternatingRowColors(true); stateTreeWidget.setVerticalGridLineShown(true); stateTreeWidget.setAllColumnsShowFocus(true); stateTreeWidget.setHeaderHidden(true); stateTreeWidget.setRootIsDecorated(false); QHeaderView* header = stateTreeWidget.header(); header->setStretchLastSection(false); header->setMinimumSectionSize(0); stateTreeWidget.setColumnCount(1); vbox->addWidget(&stateTreeWidget); self->setLayout(vbox); self->sigActivated().connect(boost::bind(&BodyStateViewImpl::onActivated, this, true)); self->sigDeactivated().connect(boost::bind(&BodyStateViewImpl::onActivated, this ,false)); //self->enableFontSizeZoomKeys(true); }
TreeWindow::TreeWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::TreeWindow) { mRootWidget = this; while (mRootWidget->parentWidget()) mRootWidget = mRootWidget->parentWidget(); ui->setupUi(this); ui->tree->setStyleSheet( "QTreeView::item { " "padding: 2px;" "}" ); initPropertiesView(); QList<QWidget*> widgets = mRootWidget->findChildren<QWidget*>(); ui->tree->setRootIsDecorated(false); DomTreeItem *item = new DomTreeItem(ui->tree, mRootWidget); ui->tree->expandItem(item); ui->tree->resizeColumnToContents(0); connect(ui->tree, SIGNAL(itemSelectionChanged()), this, SLOT(updatePropertiesView())); item->setSelected(true); QHeaderView* h = new QHeaderView(Qt::Horizontal); h->setStretchLastSection(true); ui->allPropertiesView->setHorizontalHeader(h); connect(h, &QHeaderView::sectionDoubleClicked, this, &TreeWindow::sectionDoubleClickedSlot); }
JobListView::JobListView(const HostInfoManager* manager, QWidget* parent, const char* name) : QTreeWidget(parent), m_hostInfoManager(manager), m_numberOfFilePathParts(2), m_expireDuration(-1), m_expireTimer(new QTimer(this)) { setObjectName(QLatin1String(name)); qApp->setStyleSheet("QTreeView::branch { border-image: none; image: none }"); QStringList headers; headers << tr("ID") << tr("Filename") << tr("Client") << tr("Server") << tr("State") << tr("Real") << tr("User") << tr("Faults") << tr("Size In") << tr("Size Out"); setHeaderLabels(headers); const int nHeaders = headers.count(); setColumnCount(nHeaders); // Auto adjust columns according to their content QHeaderView* headerView = header(); for (int i = 0; i < nHeaders; ++i) headerView->setResizeMode(i, QHeaderView::ResizeToContents); headerView->setStretchLastSection(false); setAllColumnsShowFocus(true); setSortingEnabled(true); sortByColumn(JobColumnID, Qt::DescendingOrder); connect(m_expireTimer, SIGNAL(timeout()), this, SLOT(slotExpireFinishedJobs())); }
// Constructor. qtractorFileListView::qtractorFileListView ( qtractorFileList::Type iFileType, QWidget *pParent ) : QTreeWidget(pParent), m_iFileType(iFileType) { m_pAutoOpenTimer = NULL; m_iAutoOpenTimeout = 0; m_pDragItem = NULL; m_pDropItem = NULL; m_pRubberBand = NULL; QTreeWidget::setRootIsDecorated(false); QTreeWidget::setUniformRowHeights(true); QTreeWidget::setAlternatingRowColors(true); // QTreeWidget::setDragEnabled(true); QTreeWidget::setAcceptDrops(true); QTreeWidget::setDropIndicatorShown(true); QTreeWidget::setAutoScroll(true); QTreeWidget::setSelectionMode(QAbstractItemView::ExtendedSelection); QTreeWidget::setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); QTreeWidget::setSortingEnabled(false); QHeaderView *pHeader = QTreeWidget::header(); pHeader->setDefaultAlignment(Qt::AlignLeft); // pHeader->setDefaultSectionSize(160); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setMovable(false); #endif pHeader->setStretchLastSection(true); // Trap for help/tool-tips events. QTreeWidget::viewport()->installEventFilter(this); setAutoOpenTimeout(800); QObject::connect(this, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(itemClickedSlot(QTreeWidgetItem*))); QObject::connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(itemActivatedSlot(QTreeWidgetItem*))); // QObject::connect(this, // SIGNAL(itemActivated(QTreeWidgetItem*,int)), // SLOT(itemActivatedSlot(QTreeWidgetItem*))); QObject::connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), SLOT(itemExpandedSlot(QTreeWidgetItem*))); QObject::connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), SLOT(itemCollapsedSlot(QTreeWidgetItem*))); QObject::connect(QTreeWidget::itemDelegate(), SIGNAL(commitData(QWidget*)), SLOT(itemRenamedSlot())); }
void MyWidget::createView() { table->setModel(model); selectionModel = new QItemSelectionModel(model); table->setSelectionModel(selectionModel); QHeaderView* headerView = table->horizontalHeader(); headerView->setStretchLastSection(true); }
void ReportView::setupViews() { QSplitter *splitter = new QSplitter; table_ = new QTableView; pie_chart_ = new PieView(row_count_, total_value_); splitter->addWidget(table_); splitter->addWidget(pie_chart_); splitter->setStretchFactor(0, 0); splitter->setStretchFactor(1, 1); table_->setModel(model_view_); pie_chart_->setModel(model_); if(report_info_.report_type_ == ReportInfo::USEFUL){ table_->hideColumn(1); } QItemSelectionModel *selectionModel = new QItemSelectionModel(model_); QItemSelectionModel *selectionModel_view = new QItemSelectionModel(model_view_); table_->setSelectionModel(selectionModel_view); pie_chart_->setSelectionModel(selectionModel); QHeaderView *headerView = table_->horizontalHeader(); headerView->setStretchLastSection(true); setCentralWidget(splitter); }
//------------------------------------------------------------------------------------------------- void BachFolderBrowserTreeView::setupColumns( IniConfig & ini, const BachFolderBrowserTreeView::ColumnStructEx columns [] ) { QHeaderView * hdr = header(); int cnt = 0; QStringList labels; for( cnt=0; columns[cnt].name; ++cnt ); QVector<int> indexVec(cnt); for( int i=0; i<cnt; i++ ) { labels << QString::fromLatin1(columns[i].name); indexVec[i] = ini.readInt( columns[i].iniName + QString("Index"), columns[i].defaultPos ); } hdr->setStretchLastSection(false); for( int n=0; n<cnt; n++ ) { for( int i=0; i<cnt; i++ ) if( indexVec[i] == n ) hdr->moveSection( hdr->visualIndex(i), n ); } hdr->resizeSections(QHeaderView::Stretch); for( int n=0; n<cnt; n++ ) { int size = ini.readInt( columns[n].iniName + QString("Size"), columns[n].defaultSize ); hdr->resizeSection( n, size==0?columns[n].defaultSize:size ); } for( int n=0; n<cnt; n++ ) { bool hidden = ini.readBool( columns[n].iniName + QString("Hidden"), columns[n].defaultHidden ); hdr->setSectionHidden( n, hidden ); } hdr->setResizeMode( QHeaderView::Interactive ); }
LinkPropertyViewImpl::LinkPropertyViewImpl(LinkPropertyView* self) : self(self) { linkSelectionView = LinkSelectionView::mainInstance(); setFrameShape(QFrame::NoFrame); setColumnCount(2); setSelectionBehavior(QAbstractItemView::SelectRows); setSelectionMode(QAbstractItemView::NoSelection); QHeaderView* hh = horizontalHeader(); QHeaderView* vh = verticalHeader(); hh->hide(); vh->hide(); hh->setSectionResizeMode(QHeaderView::Stretch); vh->setSectionResizeMode(QHeaderView::ResizeToContents); hh->setStretchLastSection(true); fontPointSizeDiff = 0; MappingPtr config = AppConfig::archive()->openMapping("LinkPropertyView"); int storedFontPointSizeDiff; if(config->read("fontZoom", storedFontPointSizeDiff)){ zoomFontSize(storedFontPointSizeDiff); } connections.add( BodyBar::instance()->sigCurrentBodyItemChanged().connect( std::bind(&LinkPropertyViewImpl::onCurrentBodyItemChanged, this, _1))); connections.add( linkSelectionView->sigSelectionChanged().connect( std::bind(&LinkPropertyViewImpl::updateProperties, this))); }
QWidget *DebuggerOptionsPage::widget() { if (!m_configWidget) { m_configWidget = new QWidget; m_addButton = new QPushButton(tr("Add"), m_configWidget); m_cloneButton = new QPushButton(tr("Clone"), m_configWidget); m_delButton = new QPushButton(tr("Remove"), m_configWidget); m_container = new DetailsWidget(m_configWidget); m_container->setState(DetailsWidget::NoSummary); m_container->setVisible(false); m_debuggerView = new QTreeView(m_configWidget); m_model = new DebuggerItemModel(m_debuggerView); m_debuggerView->setModel(m_model); m_debuggerView->setUniformRowHeights(true); m_debuggerView->setSelectionMode(QAbstractItemView::SingleSelection); m_debuggerView->setSelectionBehavior(QAbstractItemView::SelectRows); m_debuggerView->expandAll(); QHeaderView *header = m_debuggerView->header(); header->setStretchLastSection(false); header->setSectionResizeMode(0, QHeaderView::ResizeToContents); header->setSectionResizeMode(1, QHeaderView::ResizeToContents); header->setSectionResizeMode(2, QHeaderView::Stretch); QVBoxLayout *buttonLayout = new QVBoxLayout(); buttonLayout->setSpacing(6); buttonLayout->setContentsMargins(0, 0, 0, 0); buttonLayout->addWidget(m_addButton); buttonLayout->addWidget(m_cloneButton); buttonLayout->addWidget(m_delButton); buttonLayout->addItem(new QSpacerItem(10, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); QVBoxLayout *verticalLayout = new QVBoxLayout(); verticalLayout->addWidget(m_debuggerView); verticalLayout->addWidget(m_container); QHBoxLayout *horizontalLayout = new QHBoxLayout(m_configWidget); horizontalLayout->addLayout(verticalLayout); horizontalLayout->addLayout(buttonLayout); connect(m_debuggerView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(debuggerSelectionChanged())); connect(m_addButton, SIGNAL(clicked()), this, SLOT(addDebugger()), Qt::QueuedConnection); connect(m_cloneButton, SIGNAL(clicked()), this, SLOT(cloneDebugger()), Qt::QueuedConnection); connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeDebugger()), Qt::QueuedConnection); m_itemConfigWidget = new DebuggerItemConfigWidget(m_model); m_container->setWidget(m_itemConfigWidget); updateState(); } return m_configWidget; }
RemoteMachineMonitorDialogImpl::RemoteMachineMonitorDialogImpl( QWidget * p, RemoteMachineMonitor* monitor, bool runTaskMode ) : QDialog( p ), PING_YES( ":core/images/remote_machine_ping_yes.png" ), PING_NO( ":core/images/remote_machine_ping_no.png" ), PING_WAIT_FOR_RESPONSE( ":core/images/remote_machine_ping_waiting_response.png" ), PING_QUESTION(":core/images/question.png"), rmm(monitor), getPublicMachinesTask( NULL ) { setupUi( this ); // add log-view widget QVBoxLayout* logLayout = new QVBoxLayout(); logViewHolder->setLayout(logLayout); LogViewWidget* logView = new LogViewWidget(prepareLogFilter()); logView->setSearchBoxMode(LogViewSearchBox_Hidden); logLayout->addWidget(logView); currentlySelectedItemIndex = -1; assert(rmm != NULL); QList< RemoteMachineSettingsPtr > monitorItems = rmm->getRemoteMachineMonitorItems(); int sz = monitorItems.size(); for( int i = 0; i < sz; ++i ) { const RemoteMachineSettingsPtr& item = monitorItems.at( i ); addMachineSettings( item, false ); } rsLog.details(tr("Found %1 remote machine records").arg(sz)); connect( okPushButton, SIGNAL( clicked() ), SLOT( sl_okPushButtonClicked() ) ); connect( cancelPushButton, SIGNAL( clicked() ), SLOT( sl_cancelPushButtonClicked() ) ); connect( addPushButton, SIGNAL( clicked() ), SLOT( sl_addPushButtonClicked() ) ); connect( removePushButton, SIGNAL( clicked() ), SLOT( sl_removePushButtonClicked() ) ); connect( modifyPushButton, SIGNAL( clicked() ), SLOT( sl_modifyPushButtonClicked() ) ); connect( showTasksButton, SIGNAL(clicked()), SLOT(sl_showUserTasksButtonClicked()) ); connect( machinesTreeWidget, SIGNAL( itemSelectionChanged() ), SLOT( sl_selectionChanged() ) ); connect( pingPushButton, SIGNAL( clicked() ), SLOT( sl_pingPushButtonClicked() ) ); connect( getPublicMachinesButton, SIGNAL( clicked() ), SLOT( sl_getPublicMachinesButtonClicked() ) ); okPushButton->setDefault( true ); QHeaderView * header = machinesTreeWidget->header(); header->setStretchLastSection( false ); #if (QT_VERSION < 0x050000) //Qt 5 header->setClickable( false ); header->setResizeMode( 1, QHeaderView::Stretch ); #else header->setSectionsClickable( false ); header->setSectionResizeMode( 1, QHeaderView::Stretch ); #endif if( runTaskMode ) { okPushButton->setText( OK_BUTTON_RUN ); } initMachineActionsMenu(); updateState(); }
UpdateCenterImpl::UpdateCenterImpl(Updates *updates, bool autoDownloadAndInstall, QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); // resize for macosx #ifndef Q_OS_WIN32 resize(630, 366); #endif closedByButton = false; // version lblxVSTVersion->setText(QString(lblxVSTVersion->text()).arg(PROGRAM_VERSION)); // set update class this->updates = updates; // configure updates list QStringList headers; headers << tr(" File ") << tr(" Version ") << tr(" Size ") << tr(" Progress "); // add the headers lsvUpdates->setHeaderLabels(headers); // change headers sizes QFontMetrics fm = fontMetrics(); QHeaderView *header = lsvUpdates->header(); // resize header->resizeSection(1, fm.width(headers.at(0) + "9.99.999 alpha")); header->resizeSection(2, fm.width(headers.at(1) + " 1024,99Mb ")); // configure resize mode header->setHighlightSections(false); header->setStretchLastSection(false); header->setSectionResizeMode(0, QHeaderView::Stretch); // set header text aligment QTreeWidgetItem * headerItem = lsvUpdates->headerItem(); headerItem->setTextAlignment(1, Qt::AlignHCenter | Qt::AlignVCenter); headerItem->setTextAlignment(2, Qt::AlignRight | Qt::AlignVCenter); headerItem->setTextAlignment(3, Qt::AlignHCenter | Qt::AlignVCenter); // fill data fillUpdates(); // signals connect(lsvUpdates, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(itemChanged(QTreeWidgetItem*, int))); connect(btnCancel, SIGNAL(clicked()), this, SLOT(btnCancelClicked())); connect(btnUpdate, SIGNAL(clicked()), this, SLOT(btnUpdateClicked())); // updater connect(updates, SIGNAL(downloadingUpdate(int, int, int)), this, SLOT(downloadingUpdate(int, int, int))); connect(updates, SIGNAL(downloadUpdateFinished(int)), this, SLOT(downloadUpdateFinished(int))); connect(updates, SIGNAL(downloadUpdateError(int)), this, SLOT(downloadUpdateError(int))); connect(updates, SIGNAL(downloadsFinished()), this, SLOT(downloadsFinished())); connect(updates, SIGNAL(readyToInstallUpdates()), this, SLOT(readyToInstallUpdates())); connect(updates, SIGNAL(failedToInstallUpdates()), this, SLOT(failedToInstallUpdates())); // if auto download & install updates, then... if (autoDownloadAndInstall) { // disable update button lsvUpdates->setEnabled(false); btnUpdate->setEnabled(false); // start automatically to download updates (in 500ms) QTimer::singleShot(500, this, SLOT(btnUpdateClicked())); } }
void SQL_INDEX_BATCH::SET_TABLE_WIDGET_DEFAULTS() { QHeaderView * header = m_ui->tableWidget_indexler->horizontalHeader(); header->setStretchLastSection(QHeaderView::Stretch); m_ui->tableWidget_indexler->setColumnWidth ( ALAN_ADI_1_COLUMN , 220 ); m_ui->tableWidget_indexler->setColumnWidth ( ALAN_ADI_2_COLUMN , 220 ); m_ui->tableWidget_indexler->setColumnWidth ( ALAN_ADI_3_COLUMN , 220 ); m_ui->tableWidget_indexler->setColumnWidth ( ALAN_ADI_4_COLUMN , 220 ); for ( int i = 0; i < NUMBER_OF_ROWS; i++ ) { m_ui->tableWidget_indexler->insertRow(i); QTableWidgetItem * new_item = new QTableWidgetItem(QString("%1").arg(INDEX_NAMES[i])); new_item->setFlags(Qt::ItemIsSelectable); m_ui->tableWidget_indexler->setItem( i, INDEX_ADI_COLUMN, new_item ); QComboBox * alan_combobox1 = new QComboBox(); QComboBox * alan_combobox2 = new QComboBox(); QComboBox * alan_combobox3 = new QComboBox(); QComboBox * alan_combobox4 = new QComboBox(); alan_combobox1->addItem(""); alan_combobox2->addItem(""); alan_combobox3->addItem(""); alan_combobox4->addItem(""); m_ui->tableWidget_indexler->setCellWidget(i, ALAN_ADI_1_COLUMN, alan_combobox1 ); m_ui->tableWidget_indexler->setCellWidget(i, ALAN_ADI_2_COLUMN, alan_combobox2 ); m_ui->tableWidget_indexler->setCellWidget(i, ALAN_ADI_3_COLUMN, alan_combobox3 ); m_ui->tableWidget_indexler->setCellWidget(i, ALAN_ADI_4_COLUMN, alan_combobox4 ); COMBOBOX_ARRAY[i][0] = alan_combobox1; COMBOBOX_ARRAY[i][1] = alan_combobox2; COMBOBOX_ARRAY[i][2] = alan_combobox3; COMBOBOX_ARRAY[i][3] = alan_combobox4; } SQL_QUERY sql_query (DB); sql_query.PREPARE_SELECT("sql_alanlar","alan_adi","tablo_id = :tablo_id"); sql_query.SET_VALUE(":tablo_id", p_tablo_id ); if ( sql_query.SELECT() EQ 0 ) { return; } while( sql_query.NEXT() EQ true ) { for ( int i = 0; i < NUMBER_OF_ROWS; i++ ) { for (int k = 0; k < NUMBER_OF_COMBOBOX; k++ ) { COMBOBOX_ARRAY[i][k]->addItem(sql_query.VALUE(0).toString()); COMBOBOX_ARRAY[i][k]->setCurrentIndex(0); } } } }
void QuotesTableView::updateStyles() { QTableView::updateGeometries(); QHeaderView* hdr = horizontalHeader(); if( !hdr ) return; hdr->setFont( *Global::native ); hdr->setStretchLastSection(true); }
WorkflowView::WorkflowView(QWidget *parent) : QTableWidget(parent) { setColumnCount(2); verticalHeader()->hide(); verticalHeader()->setDefaultSectionSize( 20 ); QHeaderView * header = new QHeaderView(Qt::Horizontal); header->setStretchLastSection(true); setHorizontalHeader(header); setHorizontalHeaderLabels(QStringList() << "Variable" << "Value"); }
void DirectoryView::setModel(DirectoryModel* model) { GenericTreeView<DirectoryModel>::setModel(model); if(model) { QHeaderView* header = this->header(); header->setStretchLastSection(false); header->setSectionResizeMode(0, QHeaderView::Stretch); header->setSectionResizeMode(1, QHeaderView::Interactive); header->setSectionResizeMode(2, QHeaderView::Interactive); } }
LogDetailWidget::LogDetailWidget(QWidget *parent, QString name) : QWidget(parent), logMan(name.toStdString()) { ui.setupUi(this); this->name = name; this->setWindowTitle("Log Information - " + name); //db = new DBInterface; //vector<LogEvent> events = db->getAllEvents(name.toStdString()); //logMan.setEvents(events); QStandardItemModel *model = new QStandardItemModel(8, 2, this); pieChart = new PieView(ui.pie_tab); pieLayout = new QVBoxLayout(ui.pie_tab); pieLayout->addWidget(pieChart); ui.include_proc_view->setModel(model); pieChart->setModel(model); QItemSelectionModel *selectionModel = new QItemSelectionModel(model); pieChart->setSelectionModel(selectionModel); ui.include_proc_view->setSelectionModel(selectionModel); QHeaderView *headerView = ui.include_proc_view->horizontalHeader(); headerView->setStretchLastSection(true); setupModel(); markovLayout = new QVBoxLayout(ui.markov_tab); generateMarkov(); QLabel *label = new QLabel; QImage img(name + ".png"); label->setPixmap(QPixmap::fromImage(img)); markovLayout->addWidget(label); seqChart = new DistributedWidget; seqChart->initForProcess(logMan); seqLayout = new QVBoxLayout(ui.seq_tab); seqLayout->addWidget(seqChart); ui.aaView->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui.aaView , SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onCustomMenuRequested(const QPoint &))); classifyAction(); funcKeyInput(); copyPaste(); }
AccountsTreeView::AccountsTreeView( QWidget *parent ) : DoubleTreeViewBase( parent ) { kDebug(planDbg())<<"---------------"<<this<<"------------------"; setSelectionMode( QAbstractItemView::ExtendedSelection ); CostBreakdownItemModel *m = new CostBreakdownItemModel( this ); setModel( m ); QHeaderView *v = m_leftview->header(); v->setStretchLastSection( false ); v->setResizeMode( 1, QHeaderView::Stretch ); v->setResizeMode ( 2, QHeaderView::ResizeToContents ); v = m_rightview->header(); v->setResizeMode ( QHeaderView::ResizeToContents ); v->setStretchLastSection( false ); hideColumns( m_rightview, QList<int>() << 0 << 1 << 2 ); slotModelReset(); connect( m, SIGNAL(modelReset()), SLOT(slotModelReset()) ); }
Delete_VM_Files_Window::Delete_VM_Files_Window( QWidget *parent ) : QDialog( parent ) { ui.setupUi( this ); QHeaderView *hv = new QHeaderView( Qt::Vertical, ui.Files_List ); hv->setResizeMode( QHeaderView::Fixed ); ui.Files_List->setVerticalHeader( hv ); hv = new QHeaderView( Qt::Horizontal, ui.Files_List ); hv->setStretchLastSection( true ); hv->setResizeMode( QHeaderView::ResizeToContents ); ui.Files_List->setHorizontalHeader( hv ); }
/** @brief Default constructor. * Initializes the object and does some UI-related things. * * @param parent pointer to the parent QWidget. */ View::View (QWidget *parent) : QTableView (parent) { QHeaderView *hh = horizontalHeader (); hh->setSortIndicatorShown (false); hh->setStretchLastSection (true); hh->setMovable (true); setShowGrid (false); setEditTriggers (QAbstractItemView::DoubleClicked); setSelectionBehavior (QAbstractItemView::SelectRows); setSelectionMode (QAbstractItemView::SingleSelection); setAlternatingRowColors (true); }
UserBrokerTransactionsWidget::UserBrokerTransactionsWidget(QTabFramework& tabFramework, QSettings& settings, Entity::Manager& entityManager, DataService& dataService) : QWidget(&tabFramework), tabFramework(tabFramework), entityManager(entityManager), dataService(dataService), transactionsModel(entityManager) { entityManager.registerListener<EConnection>(*this); setWindowTitle(tr("Transactions")); QToolBar* toolBar = new QToolBar(this); toolBar->setStyleSheet("QToolBar { border: 0px }"); toolBar->setIconSize(QSize(16, 16)); toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); refreshAction = toolBar->addAction(QIcon(":/Icons/arrow_refresh.png"), tr("&Refresh")); refreshAction->setEnabled(false); refreshAction->setShortcut(QKeySequence(QKeySequence::Refresh)); connect(refreshAction, SIGNAL(triggered()), this, SLOT(refresh())); transactionView = new QTreeView(this); transactionView->setUniformRowHeights(true); proxyModel = new UserBrokerTransactionsSortProxyModel(this); proxyModel->setSourceModel(&transactionsModel); proxyModel->setDynamicSortFilter(true); transactionView->setModel(proxyModel); transactionView->setSortingEnabled(true); transactionView->setRootIsDecorated(false); transactionView->setAlternatingRowColors(true); //transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection); QVBoxLayout* layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); layout->addWidget(toolBar); layout->addWidget(transactionView); setLayout(layout); QHeaderView* headerView = transactionView->header(); headerView->resizeSection(0, 50); headerView->resizeSection(1, 110); headerView->resizeSection(2, 85); headerView->resizeSection(3, 100); headerView->resizeSection(4, 85); headerView->resizeSection(5, 75); headerView->resizeSection(6, 85); transactionView->sortByColumn(1); settings.beginGroup("Transactions"); headerView->restoreState(settings.value("HeaderState").toByteArray()); settings.endGroup(); headerView->setStretchLastSection(false); headerView->setResizeMode(0, QHeaderView::Stretch); }
/* ProjectInfo is a dialog box that pops up to manage per-project properties. This includes build configuration and the file list. */ ProjectInfo::ProjectInfo(MainWindow *mainWindow) : QDialog( 0 ) { this->mainWindow = mainWindow; setupUi(this); connect(buttonBox, SIGNAL(accepted()), this, SLOT(applyChanges())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(accept())); connect(defaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(networkBox, SIGNAL(stateChanged(int)), this, SLOT(onNetworkChanged(int))); connect(fileBrowser, SIGNAL(removeFileRequest(QString)), this, SLOT(onRemoveFileRequest(QString))); connect(fileBrowser, SIGNAL(changeBuildType(QString, QString)), this, SLOT(onChangeBuildType(QString, QString))); QHeaderView *header = fileBrowser->header(); header->setResizeMode(FILENAME_COLUMN, QHeaderView::Stretch); header->setResizeMode(BUILDTYPE_COLUMN, QHeaderView::ResizeToContents); header->setStretchLastSection(false); }
LDFCommonTableWidget::LDFCommonTableWidget(QWidget* parent) : QTableWidget(parent) { m_ldfFont.setFamily(QStringLiteral("Courier New")); m_ldfFont.setPointSize(10); QHeaderView* pHeader = horizontalHeader(); //pHeader->setSectionResizeMode(QHeaderView::Stretch); pHeader->setSectionResizeMode(QHeaderView::Interactive); pHeader->setStretchLastSection(true); setEditTriggers(NoEditTriggers); verticalHeader()->setVisible(true); setAlternatingRowColors(true); setSelectionBehavior(QAbstractItemView::SelectRows); connect(verticalHeader(), SIGNAL(sectionMoved(int,int, int)), this, SLOT(tableItemMoved(int,int,int))); }
void CLOAD_WORKSHEET:: CreateTable(QTabWidget * tabWidget, QString tabName, quint64 rowCount) { quint64 columnCount = 12; // Table attributes QTableWidget * tableWidget = new QTableWidget(); QHeaderView * header = tableWidget->horizontalHeader(); header->setSectionResizeMode(QHeaderView::Stretch); header->setStretchLastSection(true); tableWidget->setAlternatingRowColors(true); tableWidget->setRowCount(rowCount); tableWidget->setColumnCount(columnCount); // set table column header tableWidget->setHorizontalHeaderItem(0,new QTableWidgetItem("Name")); tableWidget->setHorizontalHeaderItem(1,new QTableWidgetItem("Value")); tableWidget->setHorizontalHeaderItem(2,new QTableWidgetItem("Value Range")); tableWidget->setHorizontalHeaderItem(3,new QTableWidgetItem(" Type ")); tableWidget->setHorizontalHeaderItem(4,new QTableWidgetItem("Conversion")); tableWidget->setHorizontalHeaderItem(5,new QTableWidgetItem("Byte Offset")); tableWidget->setHorizontalHeaderItem(6,new QTableWidgetItem("Bit Offset")); tableWidget->setHorizontalHeaderItem(7,new QTableWidgetItem("Bit Size")); tableWidget->setHorizontalHeaderItem(8,new QTableWidgetItem("Field Used")); tableWidget->setHorizontalHeaderItem(9,new QTableWidgetItem("Low Byte First")); tableWidget->setHorizontalHeaderItem(10,new QTableWidgetItem("Group")); tableWidget->setHorizontalHeaderItem(11,new QTableWidgetItem("Encoding Factor")); tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(3, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(4, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(5, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(6, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(7, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(8, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(9, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(10, QHeaderView::ResizeToContents); tableWidget->horizontalHeader()->setSectionResizeMode(11, QHeaderView::ResizeToContents); // add tab tabWidget->addTab(tableWidget, tabName); }
TableView::TableView() : QWidget() { if (! this->createConnection()) { QString msg = "** Create Database Error"; throw msg; } setWindowTitle(tr("Table View Model")); setMinimumSize(300, 350); // QSqlTableModel *model = new QSqlTableModel(this, m_db); QStringList tempX = m_db.tables(); model->setTable(tempX.at(0)); QSqlError error = model->lastError(); if ( error.isValid() ) { ksMsg( this, "Table View - SQL Error", error.text() ); } model->setEditStrategy(QSqlTableModel::OnManualSubmit); model->setSort(2, Qt::AscendingOrder); model->select(); model->setHeaderData(0, Qt::Horizontal, QObject::tr("ID")); model->setHeaderData(1, Qt::Horizontal, QObject::tr("First name")); model->setHeaderData(2, Qt::Horizontal, QObject::tr("Last name")); // QTableView *view = new QTableView; view->setModel(model); view->resizeColumnsToContents(); QHeaderView *temp = view->horizontalHeader(); temp->setStretchLastSection(true); QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->addWidget(view); setLayout(mainLayout); }
PlacesView::PlacesView(QWidget* parent): QTreeView(parent), currentPath_(NULL) { setRootIsDecorated(false); setHeaderHidden(true); setIndentation(12); connect(this, &QTreeView::clicked, this, &PlacesView::onClicked); connect(this, &QTreeView::pressed, this, &PlacesView::onPressed); setIconSize(QSize(24, 24)); // FIXME: we may share this model amont all views model_ = new PlacesModel(this); setModel(model_); QHeaderView* headerView = header(); headerView->setSectionResizeMode(0, QHeaderView::Stretch); headerView->setSectionResizeMode(1, QHeaderView::Fixed); headerView->setStretchLastSection(false); expandAll(); // FIXME: is there any better way to make the first column span the whole row? setFirstColumnSpanned(0, QModelIndex(), true); // places root setFirstColumnSpanned(1, QModelIndex(), true); // devices root setFirstColumnSpanned(2, QModelIndex(), true); // bookmarks root // the 2nd column is for the eject buttons setSelectionBehavior(QAbstractItemView::SelectRows); // FIXME: why this does not work? setAllColumnsShowFocus(false); setAcceptDrops(true); setDragEnabled(true); // update the umount button's column width based on icon size onIconSizeChanged(iconSize()); #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) // this signal requires Qt >= 5.5 connect(this, &QAbstractItemView::iconSizeChanged, this, &PlacesView::onIconSizeChanged); #endif }