Ejemplo n.º 1
0
void amyFolderView::SetFolder(amyKeeper<amyDCMFolder> folder)
{
	for(int i=0;i<m_PatientViewArr.size();i++)
	{
		delete m_PatientViewArr[i];
	}
	m_Folder=folder;
	m_PatientViewArr.clear();
	this->clear();
	this->setTabPosition(QTabWidget::West); 
	for(int i=0;i<folder->GetPatientArr().size();i++)
	{
		amyPatient::Keeper pat=folder->GetPatientArr()[i];
		amyPatientTable *view=new amyPatientTable(pat.GetPointer());
		QHeaderView* verticalHeader = view->verticalHeader();
		verticalHeader->setResizeMode(QHeaderView::Fixed);
		verticalHeader->setDefaultSectionSize(64);

		QHeaderView* horizontalHeader = view->horizontalHeader();
		horizontalHeader->hide();
		horizontalHeader->setResizeMode(QHeaderView::Fixed);
		horizontalHeader->setDefaultSectionSize(150);;

		this->addTab(view,pat->info->name.c_str());
		
		m_PatientViewArr.push_back(view);
	}
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
tCZoneAlarmsLayer:: tCZoneAlarmsLayer( 
    QWidget* pParent,
    CZone::tCZoneLibrary& cZoneLibrary,
    tAlarmCZoneModel& alarmCZoneModel)
: QWidget(pParent)
, m_pAlarmModel(alarmCZoneModel)
, m_cZoneLibrary(cZoneLibrary)
{
    m_pTableView = new tTableView( this );
    m_pTableView->setModel( &m_pAlarmModel );
    m_pTableView->setFocusPolicy( Qt::StrongFocus );
    m_pTableView->SetSoleFocus( true );
    m_pTableView->SetWrapping( true );
    m_pTableView->setSelectionBehavior( QAbstractItemView::SelectRows );
    QHeaderView* pVerticalHeader = m_pTableView->verticalHeader();
    pVerticalHeader->setResizeMode( QHeaderView::ResizeToContents );
    pVerticalHeader->hide();
    QHeaderView* pHorizontalHeader = m_pTableView->horizontalHeader();
    pHorizontalHeader->hide();

    if ( m_pAlarmModel.rowCount() > 0 ) 
    {
        pHorizontalHeader->setResizeMode( tAlarmCZoneModel::nameColumn, QHeaderView::Stretch );
        pHorizontalHeader->setResizeMode( tAlarmCZoneModel::statusColumn, QHeaderView::ResizeToContents);
        m_pTableView->selectRow( 0 );
    }
   
    Connect( m_pTableView, SIGNAL( clicked( const QModelIndex& ) ), this, SLOT( Clicked() ) );
    Connect( &m_pAlarmModel, SIGNAL( AlarmModelChangedSignal() ), this, SLOT( AlarmAdded() ) );

    QVBoxLayout* vLayout = new QVBoxLayout();
    vLayout->setContentsMargins( 5, 5, 5, 5 );
    vLayout->addWidget( m_pTableView );
    setLayout( vLayout );
}
Ejemplo n.º 3
0
ActivateModsDialog::ActivateModsDialog(const std::map<QString, std::vector<QString> > &missingPlugins, QWidget *parent)
  : TutorableDialog("ActivateMods", parent), ui(new Ui::ActivateModsDialog)
{
  ui->setupUi(this);

  QTableWidget *modsTable = findChild<QTableWidget*>("modsTable");
  QHeaderView *headerView = modsTable->horizontalHeader();
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
  headerView->setSectionResizeMode(0, QHeaderView::Stretch);
  headerView->setSectionResizeMode(1, QHeaderView::Interactive);
#else
  headerView->setResizeMode(0, QHeaderView::Stretch);
  headerView->setResizeMode(1, QHeaderView::Interactive);
#endif

  int row = 0;

  modsTable->setRowCount(missingPlugins.size());

  for (std::map<QString, std::vector<QString> >::const_iterator espIter = missingPlugins.begin();
       espIter != missingPlugins.end(); ++espIter, ++row) {
    modsTable->setCellWidget(row, 0, new QLabel(espIter->first));
    if (espIter->second.size() == 0) {
      modsTable->setCellWidget(row, 1, new QLabel(tr("not found")));
    } else {
      QComboBox* combo = new QComboBox();
      for (std::vector<QString>::const_iterator modIter = espIter->second.begin();
           modIter != espIter->second.end(); ++modIter) {
        combo->addItem(*modIter);
      }
      modsTable->setCellWidget(row, 1, combo);
    }
  }
}
Ejemplo n.º 4
0
BoardView::BoardView(QWidget *parent)
        :QTableView(parent)
{
	QHeaderView *hHeader = horizontalHeader();
	hHeader->setResizeMode(QHeaderView::Fixed);
	hHeader->setDefaultAlignment( Qt::AlignHCenter );
	hHeader->setDefaultSectionSize(50);
	hHeader->setClickable(false);
	hHeader->setMovable(false);

	QHeaderView *vHeader = verticalHeader();
	vHeader->setResizeMode(QHeaderView::Fixed);
	vHeader->setDefaultAlignment( Qt::AlignVCenter );
	vHeader->setDefaultSectionSize(50);
	vHeader->setClickable(false);
	vHeader->setMovable(false);

	setSelectionMode(QAbstractItemView::SingleSelection);
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

	setItemDelegate(new BoardDelegate(this));

	setStyleSheet("QHeaderView::section {background-color: #ffffe7; border: 1px solid #74440e; color: black;  }"
		      "QTableCornerButton::section { background-color: #ffffe7; border: 1px solid #74440e; color: black;  }"
		      "QToolTip { background-color: #ffeeaf; padding: 2px; border: 1px solid #74440e; }");
}
Ejemplo n.º 5
0
void Matrix::initTableView()
{
    d_table_view = new QTableView();
    d_table_view->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
    d_table_view->setSelectionMode(QAbstractItemView::ContiguousSelection);// only one contiguous selection supported
    d_table_view->setModel(d_matrix_model);
    d_table_view->setEditTriggers(QAbstractItemView::DoubleClicked);
    d_table_view->setFocusPolicy(Qt::StrongFocus);
    d_table_view->setFocus();

    QPalette pal = d_table_view->palette();
	pal.setColor(QColorGroup::Base, QColor(255, 255, 128));
	d_table_view->setPalette(pal);

	// set header properties
	QHeaderView* hHeader = (QHeaderView*)d_table_view->horizontalHeader();
	hHeader->setMovable(false);
	hHeader->setResizeMode(QHeaderView::Fixed);
	hHeader->setDefaultSectionSize(d_column_width);

    int cols = numCols();
	for(int i=0; i<cols; i++)
		d_table_view->setColumnWidth(i, d_column_width);

	QHeaderView* vHeader = (QHeaderView*)d_table_view->verticalHeader();
	vHeader->setMovable(false);
	vHeader->setResizeMode(QHeaderView::ResizeToContents);

    d_stack->addWidget(d_table_view);

    // recreate keyboard shortcut
	d_select_all_shortcut = new QShortcut(QKeySequence(tr("Ctrl+A", "Matrix: select all")), this);
	connect(d_select_all_shortcut, SIGNAL(activated()), d_table_view, SLOT(selectAll()));
}
Ejemplo n.º 6
0
CUcontent_DCs_stopCodes::CUcontent_DCs_stopCodes(QWidget *parent) : CUcontent_DCs_abstract(parent)
{
	_currOrTempDTCs.clear();
	_currOrTempDTCdescriptions.clear();
	// Setup GUI:
	setupUi(this);
	setupUiFonts();
	// Set column widths:
	QHeaderView *headerview;
	currOrTempDTCs_tableWidget->setColumnWidth (0, 70);
	headerview = currOrTempDTCs_tableWidget->horizontalHeader();
	headerview->setResizeMode(0,QHeaderView::Interactive);
	headerview->setResizeMode(1,QHeaderView::Stretch);
	// Set table row resize behavior:
	headerview = currOrTempDTCs_tableWidget->verticalHeader();
	headerview->setResizeMode(QHeaderView::Fixed);
	/* NOTE: Current method for calculating ther nr. of needed rows 
	 * assumes all rows to have the same constsant height */
	// Install event-filter for DC-tables:
	currOrTempDTCs_tableWidget->viewport()->installEventFilter(this);
	// *** Set initial content ***:
	// Set provisional titles:
	currOrTempDTCsTitle_label->setText( tr("Current Stop Code:") );
	// Disable tables and their titles:
	currOrTempDTCsTitle_label->setEnabled( false );
	currOrTempDTCs_tableWidget->setEnabled( false );
	// Disable "print"-button:
	printDClist_pushButton->setDisabled(true);
}
Ejemplo n.º 7
0
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);
}
Ejemplo n.º 8
0
TilesetView::TilesetView(MapDocument *mapDocument, QWidget *parent)
    : QTableView(parent)
    , mZoomable(new Zoomable(this))
    , mMapDocument(mapDocument)
{
    setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    setItemDelegate(new TileDelegate(this, this));
    setShowGrid(false);

    QHeaderView *header = horizontalHeader();
    header->hide();
    header->setResizeMode(QHeaderView::ResizeToContents);
    header->setMinimumSectionSize(1);

    header = verticalHeader();
    header->hide();
    header->setResizeMode(QHeaderView::ResizeToContents);
    header->setMinimumSectionSize(1);

    // Hardcode this view on 'left to right' since it doesn't work properly
    // for 'right to left' languages.
    setLayoutDirection(Qt::LeftToRight);
    
    Preferences *prefs = Preferences::instance();
    mDrawGrid = prefs->showTilesetGrid();

    connect(mZoomable, SIGNAL(scaleChanged(qreal)), SLOT(adjustScale()));
    connect(prefs, SIGNAL(showTilesetGridChanged(bool)),
            SLOT(setDrawGrid(bool)));
}
Ejemplo n.º 9
0
int HeaderView::setResizeMode(lua_State * L) // ( ResizeMode mode )
{	
    QHeaderView* obj = QtObject<QHeaderView>::check( L, 1);
	QHeaderView::ResizeMode f;
	if( Util::isNum( L, 3 ) )
	{
		int fInt = Util::toInt( L, 3 );	
		if( fInt >=0 && fInt <= 3 )
		{
			f = (QHeaderView::ResizeMode) fInt;
			obj->setResizeMode( Util::toInt( L, 2), f ) ;
		}
		else
			Lua::Util::error( L, "expecting a valid QHeaderView::ResizeMode" );
	}
	else
	{
		int fInt = Util::toInt( L, 2 );	
		if( fInt >=0 && fInt <= 3 )
		{
			f = (QHeaderView::ResizeMode) fInt;
			obj->setResizeMode( f ) ;
		}
		else
			Lua::Util::error( L, "expecting a valid QHeaderView::ResizeMode" );
	}
	return 0;
}
Ejemplo n.º 10
0
CUcontent_Adjustments::CUcontent_Adjustments(QWidget *parent) : QWidget(parent)
{
	QHeaderView *headerview;
	_SSMPdev = NULL;
	_maxrowsvisible = 0; // We don't need to calculate a value here, because we always get a resizeEvent before setting the table content
	_supportedAdjustments.clear();
	_newValueSelWidgetType.clear();
	// Setup GUI:
	setupUi(this);
	setupUiFonts();
	// Set column widths:
	adjustments_tableWidget->setColumnWidth (1, 88);
	adjustments_tableWidget->setColumnWidth (2, 106);
	adjustments_tableWidget->setColumnWidth (3, 70);
	headerview = adjustments_tableWidget->horizontalHeader();
	headerview->setResizeMode(0,QHeaderView::Stretch);
	headerview->setResizeMode(1,QHeaderView::Fixed);
	headerview->setResizeMode(2,QHeaderView::Fixed);
	headerview->setResizeMode(3,QHeaderView::Fixed);
	// Set table row resize behavior:
	headerview = adjustments_tableWidget->verticalHeader();
	headerview->setResizeMode(QHeaderView::Fixed);
	/* NOTE: Current method for calculating ther nr. of needed rows 
	 * assumes all rows to have the same constsant height */
	// Install event-filter for adjustments-table:
	adjustments_tableWidget->viewport()->installEventFilter(this);
	// Disable GUI-elements:
	title_label->setEnabled(false);
	adjustments_tableWidget->setEnabled(false);
	nonPermanentInfo_label->setEnabled(false);
}
Ejemplo n.º 11
0
void MantidMatrix::connectTableView(QTableView *view,
                                    MantidMatrixModel *model) {
  view->setSizePolicy(
      QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
  view->setSelectionMode(QAbstractItemView::ExtendedSelection);
  view->setModel(model);
  view->setCornerButtonEnabled(false);
  view->setFocusPolicy(Qt::StrongFocus);

  QPalette pal = view->palette();
  pal.setColor(QPalette::Base, m_bk_color);
  view->setPalette(pal);

  // set header properties
  QHeaderView *hHeader = (QHeaderView *)view->horizontalHeader();
  hHeader->setMovable(false);
  hHeader->setResizeMode(QHeaderView::Interactive);
  hHeader->setDefaultSectionSize(m_column_width);

  view->resizeRowToContents(0);
  int row_height = view->rowHeight(0);

  QHeaderView *vHeader = (QHeaderView *)view->verticalHeader();
  vHeader->setDefaultSectionSize(row_height);
  vHeader->setResizeMode(QHeaderView::Fixed);
  vHeader->setMovable(false);
}
Ejemplo n.º 12
0
MapPreview::MapPreview(QWidget *parent) : QDialog(parent)
{
	QHeaderView *header;
	ignoreEvents = true;
	setupUi(this);
	header = twLayers->horizontalHeader();
	header->setResizeMode(0, QHeaderView::Fixed);
	header->setResizeMode(1, QHeaderView::Stretch);
	header->resizeSections(QHeaderView::ResizeToContents);
	ignoreEvents = false;
}
Ejemplo n.º 13
0
//-----------------------------------------------------------------------------
//! Make sure the columns are sized and an item is selected when items are added to the model
//-----------------------------------------------------------------------------
void tCZoneAlarmsLayer::AlarmAdded()
{
    QHeaderView* pHorizontalHeader = m_pTableView->horizontalHeader();
    pHorizontalHeader->setResizeMode( tAlarmCZoneModel::nameColumn, QHeaderView::Stretch );
    pHorizontalHeader->setResizeMode( tAlarmCZoneModel::statusColumn, QHeaderView::ResizeToContents );

    if ( !m_pTableView->selectionModel()->hasSelection() )
    {
        m_pTableView->selectRow( 0 );
    }
}
Ejemplo n.º 14
0
/** Constructor */
MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
	/* Invoke the Qt Designer generated object setup routine */
	ui.setupUi(this);

	isControlled = controlled;
	isWindow = false;
	currMsgFlags = 0;

	connect(ui.msgList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(msgfilelistWidgetCostumPopupMenu(QPoint)));
	connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
	connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
	connect(ui.msgText, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl)));

	connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged()));
	connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged()));

	/* hide the Tree +/- */
	ui.msgList->setRootIsDecorated( false );
	ui.msgList->setSelectionMode( QAbstractItemView::ExtendedSelection );

	/* Set header resize modes and initial section sizes */
	QHeaderView * msglheader = ui.msgList->header () ;
	msglheader->setResizeMode (COLUMN_FILE_NAME, QHeaderView::Interactive);
	msglheader->setResizeMode (COLUMN_FILE_SIZE, QHeaderView::Interactive);
	msglheader->setResizeMode (COLUMN_FILE_HASH, QHeaderView::Interactive);

	msglheader->resizeSection (COLUMN_FILE_NAME, 200);
	msglheader->resizeSection (COLUMN_FILE_SIZE, 100);
	msglheader->resizeSection (COLUMN_FILE_HASH, 200);

	QFont font = QFont("Arial", 10, QFont::Bold);
	ui.subjectText->setFont(font);

	ui.bcclabel->setVisible(false);
	ui.bccText->setVisible(false);
	ui.cclabel->setVisible(false);
	ui.ccText->setVisible(false);

	ui.tagsLabel->setVisible(false);

	if (isControlled == false) {
		processSettings("MessageWidget", true);
	}

	ui.dateText-> setText("");

	/* Hide platform specific features */
#ifdef Q_WS_WIN

#endif
}
Ejemplo n.º 15
0
ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WFlags flags)
	: RsAutoUpdatePage(5000, parent, flags)
{
	setupUi(this);

	QObject::connect(NotifyQt::getInstance(), SIGNAL(lobbyListChanged()), SLOT(lobbyChanged()));
	QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyEvent(qulonglong,int,const QString&,const QString&)), this, SLOT(displayChatLobbyEvent(qulonglong,int,const QString&,const QString&)));
	QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyInviteReceived()), this, SLOT(readChatLobbyInvites()));

	QObject::connect(lobbyTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(lobbyTreeWidgetCostumPopupMenu()));
	QObject::connect(lobbyTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));

	QObject::connect(newlobbypushButton, SIGNAL(clicked()), this, SLOT(createChatLobby()));

	compareRole = new RSTreeWidgetItemCompareRole;
	compareRole->setRole(COLUMN_NAME, ROLE_SORT);

	lobbyTreeWidget->setColumnCount(COLUMN_COUNT);
	lobbyTreeWidget->sortItems(COLUMN_NAME, Qt::AscendingOrder);

	QTreeWidgetItem *headerItem = lobbyTreeWidget->headerItem();
	headerItem->setText(COLUMN_NAME, tr("Name"));
	headerItem->setText(COLUMN_USER_COUNT, tr("Count"));
	headerItem->setText(COLUMN_TOPIC, tr("Topic"));
	headerItem->setTextAlignment(COLUMN_NAME, Qt::AlignHCenter | Qt::AlignVCenter);
  headerItem->setTextAlignment(COLUMN_TOPIC, Qt::AlignHCenter | Qt::AlignVCenter);
	headerItem->setTextAlignment(COLUMN_USER_COUNT, Qt::AlignHCenter | Qt::AlignVCenter);

	QHeaderView *header = lobbyTreeWidget->header();
	header->setResizeMode(COLUMN_NAME, QHeaderView::Interactive);
	header->setResizeMode(COLUMN_USER_COUNT, QHeaderView::Interactive);
	header->setResizeMode(COLUMN_TOPIC, QHeaderView::Stretch);

	lobbyTreeWidget->setColumnWidth(COLUMN_NAME, 200);
	lobbyTreeWidget->setColumnWidth(COLUMN_USER_COUNT, 50);

	privateLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
	privateLobbyItem->setText(COLUMN_NAME, tr("Private Lobbies"));
	privateLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "1");
	privateLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, RS_CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE);
	lobbyTreeWidget->insertTopLevelItem(0, privateLobbyItem);

	publicLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
	publicLobbyItem->setText(COLUMN_NAME, tr("Public Lobbies"));
	publicLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "2");
	publicLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC);
	lobbyTreeWidget->insertTopLevelItem(1, publicLobbyItem);

	lobbyTreeWidget->expandAll();

	lobbyChanged();
}
Ejemplo n.º 16
0
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);
}
Ejemplo n.º 17
0
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 );
}
Ejemplo n.º 18
0
void EventTableWidget::uiInit() {
	QStringList tableHeader;
	tableHeader << "Event" << "Origin Time" << "Magnitude" << "Magnitude Type"
				<< "Region" << "Latitude" << "Longitude" << "Depth";

	setRowCount(0);
	setColumnCount(tableHeader.size());
	setHorizontalHeaderLabels(tableHeader);

	QHeaderView* horizontalHeaderRef = horizontalHeader();
	horizontalHeaderRef->setResizeMode(horizontalHeaderRef->count()-1, QHeaderView::Stretch);
	resizeColumnsToContents();

	setAlternatingRowColors(true);
	setSelectionBehavior(QAbstractItemView::SelectRows);
	setSelectionMode(QAbstractItemView::SingleSelection);

	QVBoxLayout* layout = new QVBoxLayout;
	setLayout(layout);

	QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
	sizePolicy.setHorizontalStretch(1);
	sizePolicy.setVerticalStretch(0);
	sizePolicy.setHeightForWidth(true);
	setSizePolicy(sizePolicy);
}
Ejemplo n.º 19
0
void StudentMainWidget::initializeTable()
{
    QHBoxLayout *tableHeader = new QHBoxLayout;
    tableHeader->setAlignment(Qt::AlignLeft);


    QLabel *lessonsLabel = new QLabel(tr("Available Lessons"));
    lessonsLabel->setFont(QFont(NULL, 20));
    lessonsLabel->setAlignment(Qt::AlignLeft);
    lessonsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    tableHeader->addWidget(lessonsLabel);

    mainLayout->addLayout(tableHeader);

    mainTable = new QTableWidget;
    mainTable->setRowCount(0);
    mainTable->setColumnCount(3);
    QStringList headers;
    headers << "Topic" << "Lessons" << "Marks";
    mainTable->setHorizontalHeaderLabels(headers);

    QHeaderView *tempHeader = mainTable->horizontalHeader();
    tempHeader->setResizeMode(0, QHeaderView::Stretch);

    QHBoxLayout *table = new QHBoxLayout;
    table->setAlignment(Qt::AlignCenter);
    table->addWidget(mainTable);

    mainLayout->addLayout(table);
}
Ejemplo n.º 20
0
DlgFilletEdges::DlgFilletEdges(Part::FilletBase* fillet, QWidget* parent, Qt::WFlags fl)
  : QWidget(parent, fl), ui(new Ui_DlgFilletEdges()), d(new DlgFilletEdgesP())
{
    ui->setupUi(this);

    d->object = 0;
    d->selection = new EdgeSelection(d->object);
    Gui::Selection().addSelectionGate(d->selection);

    d->fillet = fillet;
    d->connectApplicationDeletedObject = App::GetApplication().signalDeletedObject
        .connect(boost::bind(&DlgFilletEdges::onDeleteObject, this, _1));
    d->connectApplicationDeletedDocument = App::GetApplication().signalDeleteDocument
        .connect(boost::bind(&DlgFilletEdges::onDeleteDocument, this, _1));
    // set tree view with three columns
    QStandardItemModel* model = new FilletRadiusModel(this);
    connect(model, SIGNAL(toggleCheckState(const QModelIndex&)),
            this, SLOT(toggleCheckState(const QModelIndex&)));
    model->insertColumns(0,3);
    model->setHeaderData(0, Qt::Horizontal, tr("Edges to fillet"), Qt::DisplayRole);
    model->setHeaderData(1, Qt::Horizontal, tr("Start radius"), Qt::DisplayRole);
    model->setHeaderData(2, Qt::Horizontal, tr("End radius"), Qt::DisplayRole);
    ui->treeView->setRootIsDecorated(false);
    ui->treeView->setItemDelegate(new FilletRadiusDelegate(this));
    ui->treeView->setModel(model);

    QHeaderView* header = ui->treeView->header();
    header->setResizeMode(0, QHeaderView::Stretch);
    header->setDefaultAlignment(Qt::AlignLeft);
    header->setMovable(false);
    on_filletType_activated(0);
    findShapes();
}
Ejemplo n.º 21
0
/*!
    \fn PluginView::PluginView(PluginManager *manager, QWidget *parent)
    Constructs a PluginView that gets the list of plugins from the
    given plugin \a manager with a given \a parent widget.
*/
PluginView::PluginView(PluginManager *manager, QWidget *parent)
    : QWidget(parent),
      m_ui(new Internal::Ui::PluginView),
      p(new Internal::PluginViewPrivate),
      m_allowCheckStateUpdate(true),
      C_LOAD(1)
{
    m_ui->setupUi(this);
    QHeaderView *header = m_ui->categoryWidget->header();
    header->setResizeMode(0, QHeaderView::ResizeToContents);
    header->setResizeMode(2, QHeaderView::ResizeToContents);

    m_okIcon = QIcon(QLatin1String(":/extensionsystem/images/ok.png"));
    m_errorIcon = QIcon(QLatin1String(":/extensionsystem/images/error.png"));
    m_notLoadedIcon = QIcon(QLatin1String(":/extensionsystem/images/notloaded.png"));

    m_ui->categoryWidget->setColumnWidth(C_LOAD, 40);

    // cannot disable these
    m_whitelist << QString("Core") << QString("Locator")
                << QString("Find") << QString("TextEditor");

    p->manager = manager;
    connect(p->manager, SIGNAL(pluginsChanged()), this, SLOT(updateList()));
    connect(m_ui->categoryWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
            this, SLOT(selectPlugin(QTreeWidgetItem*)));
    connect(m_ui->categoryWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
            this, SLOT(activatePlugin(QTreeWidgetItem*)));

    updateList();
}
Ejemplo n.º 22
0
/*
  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);
}
Ejemplo n.º 23
0
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
tCZoneModesLayer::tCZoneModesLayer( QWidget* pParent )
: QWidget( pParent ) 
{
    m_pModesModel = tCZoneConfigManager::Instance()->ModesModel();
    Connect( m_pModesModel, SIGNAL( Populated() ), this, SLOT( ModesModelPopulated() ) );

    m_pModesView = new tTableView( this );
    m_pModesView->setModel( m_pModesModel );
    m_pModesView->setSelectionBehavior( QAbstractItemView::SelectRows );
    m_pModesView->setSelectionMode( QAbstractItemView::SingleSelection );  
    m_pModesView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
    m_pModesView->SetSoleFocus( true );
    m_pModesView->SetWrapping( true );
    m_pModesView->setEditTriggers( QAbstractItemView::NoEditTriggers ); // read only but still checkable NSW-18934
    QHeaderView* pHeaderView = m_pModesView->horizontalHeader();
    pHeaderView->setResizeMode( QHeaderView::Stretch );
    pHeaderView->hide();
    pHeaderView = m_pModesView->verticalHeader();
    pHeaderView->hide();
    if ( m_pModesModel->rowCount() > 0 )
    {
        m_pModesView->selectRow( 0 );
    }

    Connect( m_pModesView, SIGNAL( clicked( const QModelIndex& ) ), this, SLOT( Clicked( const QModelIndex& ) ) );

    QVBoxLayout* pVLayout = new QVBoxLayout();
    pVLayout->setContentsMargins( 5, 5, 5, 5 );
    pVLayout->addWidget( m_pModesView );
    setLayout( pVLayout );
}
Ejemplo n.º 24
0
NetworkUsageWindow::NetworkUsageWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::NetworkUsageWindow)
{
    ui->setupUi(this);

    model = new QStandardItemModel(ui->tableView);
    ui->tableView->setModel(model);

    QHeaderView *headersView = new QHeaderView(Qt::Horizontal,ui->tableView);

    headersView->setResizeMode(QHeaderView::Stretch);

    ui->tableView->setHorizontalHeader(headersView);
    ui->tableView->verticalHeader()->setVisible(false);

    QStringList labels;
    labels << "Counter" << "Received" << "Sent";

    model->setHorizontalHeaderLabels(labels);

    refresh();

    connect(ui->actionRefresh,SIGNAL(triggered()),this,SLOT(refresh()));
    connect(ui->actionReset,SIGNAL(triggered()),this,SLOT(reset()));

}
Ejemplo n.º 25
0
// ctor.
synthv1widget_controls::synthv1widget_controls ( QWidget *pParent )
	: QTreeWidget(pParent)
{
	QTreeWidget::setColumnCount(4);

	QTreeWidget::setRootIsDecorated(false);
	QTreeWidget::setAlternatingRowColors(true);
	QTreeWidget::setUniformRowHeights(true);
	QTreeWidget::setAllColumnsShowFocus(false);

	QTreeWidget::setSelectionBehavior(QAbstractItemView::SelectRows);
	QTreeWidget::setSelectionMode(QAbstractItemView::SingleSelection);

	QHeaderView *pHeaderView = QTreeWidget::header();
#if QT_VERSION < 0x050000
	pHeaderView->setResizeMode(QHeaderView::ResizeToContents);
#else
	pHeaderView->setSectionResizeMode(QHeaderView::ResizeToContents);
#endif
//	pHeaderView->hide();

	QTreeWidget::setItemDelegate(new synthv1widget_controls_item_delegate(this));

	QObject::connect(this,
		SIGNAL(itemChanged(QTreeWidgetItem *, int)),
		SLOT(itemChangedSlot(QTreeWidgetItem *, int)));
}
Ejemplo n.º 26
0
  ZMatrixDialog::ZMatrixDialog(QWidget *parent, Qt::WindowFlags) :
      QDialog(parent), m_zMatrixModel(new ZMatrixModel), m_molecule(0)
  {
    setWindowFlags(Qt::Dialog | Qt::Tool);
    ui.setupUi(this);
    ui.tableView->setModel(m_zMatrixModel);

    QHeaderView *horizontal = ui.tableView->horizontalHeader();
    horizontal->setResizeMode(QHeaderView::Stretch);
    QHeaderView *vertical = ui.tableView->verticalHeader();
    vertical->setResizeMode(QHeaderView::Stretch);

    // Connect our signals and slots...
    connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addAtom()));
    connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeAtom()));
  }
//-------------------------------------------------------------------------------------------------
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 );
}
Ejemplo n.º 28
0
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()));
}
Ejemplo n.º 29
0
  VibrationDialog::VibrationDialog( QWidget *parent, Qt::WindowFlags f ) : 
    QDialog( parent, f )
  {
    ui.setupUi(this);
    
    // Make sure the columns span the whole width of the table widget
    QHeaderView *horizontal = ui.vibrationTable->horizontalHeader();
    horizontal->setResizeMode(QHeaderView::Stretch);

    m_indexMap = new std::vector<int>;

    connect(ui.vibrationTable, SIGNAL(currentCellChanged(int, int, int, int)),
            this, SLOT(currentCellChanged(int, int, int, int)));
    connect(ui.vibrationTable, SIGNAL(cellClicked(int, int)),
            this, SLOT(cellClicked(int, int)));

    connect(ui.scaleSlider, SIGNAL(valueChanged(int)),
            this, SLOT(setScale(int)));
    connect(ui.displayForcesCheckBox, SIGNAL(toggled(bool)),
            this, SLOT(setDisplayForceVectors(bool)));
    connect(ui.animationSpeedCheckBox, SIGNAL(toggled(bool)),
            this, SLOT(setAnimationSpeed(bool)));
    connect(ui.animationButton, SIGNAL(clicked(bool)),
            this, SLOT(animateButtonClicked(bool)));
    connect(ui.exportButton, SIGNAL(clicked(bool)),
            this, SLOT(exportVibrationData(bool)));
  }
Ejemplo n.º 30
0
TEventsLog::TEventsLog(QWidget *obj_MainWindow) : QWidget(obj_MainWindow)
	{
	this->obj_MainWindow=obj_MainWindow;

	QVBoxLayout *EventsList_IntLayout = new QVBoxLayout();
	setLayout(EventsList_IntLayout);

	EventsList_TableView=new xTableView(this);
#ifdef __i386__
	EventsList_TableView->setMinimumHeight(300);
	EventsList_TableView->setMinimumWidth(600);
#endif
	EventsList_IntLayout->addWidget(EventsList_TableView);
	EventsList_TableView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	EventsList_TableView->setStyleSheet(xTableViewStyleSheet);
	EventsList_TableView->verticalHeader()->setVisible(false);
	//EventsList_TableView->setShowGrid(false);
	QHeaderView *verticalHeader = EventsList_TableView->verticalHeader();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
	verticalHeader->sectionResizeMode(QHeaderView::Fixed);
#else
	verticalHeader->setResizeMode(QHeaderView::Fixed);
#endif
	verticalHeader->setDefaultSectionSize(60);

	EventsList_TableView->setModel(&EventsList_Model);
	EventsList_TableView->setItemDelegate(new EventsList_ItemDelegate());
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
	EventsList_TableView->verticalHeader()->setDefaultAlignment(Qt::AlignVCenter|Qt::AlignRight);
#endif

	Retranslate();
	OscIndex=0;
	Load();
	}