Esempio n. 1
0
ServerTab::ServerTab()
{
    //
    QLabel *legendLabel = new QLabel("Liste des clients connectés au serveur.");
    legendLabel->setFixedHeight(40);

    // TabWidget

    QTableWidget *tableWidget = new QTableWidget();
    tableWidget->setColumnCount(6);

    // resize to contents
    tableWidget->setColumnWidth(0, 300);
    tableWidget->setColumnWidth(4, 120);

    QStringList listHeaders;
    listHeaders << "Nom du client" << "ID de connexion" << "Adresse IP" << "Statut" << "Début de connexion" << "Fin de connexion";
    tableWidget->setHorizontalHeaderLabels(listHeaders);
    tableWidget->horizontalHeaderItem(0)->setTextAlignment(Qt::AlignLeft);


    // Layering

    QVBoxLayout *vl = new QVBoxLayout();
    setLayout(vl);
    vl->addWidget(legendLabel);
    vl->addWidget(tableWidget);
}
Esempio n. 2
0
AppHistoryTab::AppHistoryTab()
{

    //

    QLabel *legendLabel = new QLabel("Historique des applications depuis la connexion au serveur.");
    legendLabel->setFixedHeight(40);


    // TabWidget

    QTableWidget *tableWidget = new QTableWidget();
    tableWidget->setColumnCount(6);

    // resize to contents
    tableWidget->setColumnWidth(0, 300);

    QStringList listHeaders;
    listHeaders << "Nom" << "PID" << "Statut" << "UID" << "Date de début" << "Date de fin";
    tableWidget->setHorizontalHeaderLabels(listHeaders);
    tableWidget->horizontalHeaderItem(0)->setTextAlignment(Qt::AlignLeft);


    // Layering

    QVBoxLayout *vl = new QVBoxLayout();
    setLayout(vl);
    vl->addWidget(legendLabel);
    vl->addWidget(tableWidget);
}
Esempio n. 3
0
IPCamTable::IPCamTable(QWidget *parent) :
    QGroupBox(parent),
    ui(new Ui::IPCamTable)
{
    ui->setupUi(this);
	QTableWidget *tableWidget = ui->tableWidget;
    QTableWidgetItem *headerItem;
	int i = 0;
    while ((headerItem=tableWidget->horizontalHeaderItem(i)) != 0)
        m_mapHeaderToColumn.insert(headerItem->text(), i++);
}
Esempio n. 4
0
openvolume::openvolume( QWidget * parent ) :
	QDialog( parent )
{
	m_ui = new Ui::openvolume() ;
	m_ui->setupUi( this ) ;
	this->setFixedSize( this->size() ) ;
	this->setFont( parent->font() ) ;

	connect( m_ui->tableWidget,SIGNAL( itemDoubleClicked( QTableWidgetItem * ) ),this,SLOT( tableEntryDoubleClicked( QTableWidgetItem * ) ) ) ;
	connect( m_ui->tableWidget,SIGNAL( currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ),this,
		 SLOT( currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ) ) ;
	connect( m_ui->pbHelp,SIGNAL( clicked() ),this,SLOT( pbHelp() ) ) ;
	connect( m_ui->pbUUID,SIGNAL( clicked() ),this,SLOT( pbUUID() ) ) ;
	connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( pbCancel() ) ) ;

	m_action = new QAction( this ) ;
	QList<QKeySequence> keys ;
	keys.append( Qt::Key_Enter ) ;
	keys.append( Qt::Key_Return ) ;
	m_action->setShortcuts( keys ) ;

	connect( m_action,SIGNAL( triggered() ),this,SLOT( EnterKeyPressed() ) ) ;

	this->addAction( m_action ) ;

	QTableWidget * tw = m_ui->tableWidget ;
	tw->setColumnWidth( 0,183 ) ;
	tw->setColumnWidth( 1,90 ) ;
	//tw->setColumnWidth( 2,110 ) ;
	tw->hideColumn( 2 ) ;
	tw->setColumnWidth( 3,90 ) ;
	tw->setColumnWidth( 4,309 ) ;

	for( int i = 0 ; i < 5 ; i++ ){
		tw->horizontalHeaderItem( i )->setFont( this->font() ) ;
	}
	tw->horizontalHeader()->setVisible( true ) ;

	m_ui->checkBoxUUID->setVisible( false ) ;

	m_diableNonLUKS = false ;
	//m_ui->pbUUID->setVisible( false ) ;
	m_showEncryptedOnly = false ;
	m_showLuksOnly = false ;

	this->installEventFilter( this ) ;
}
void TrainLinePanel::on_delete_station_btn_clicked()
{
    QTableWidget* tableWidget =  dynamic_cast<QTableWidget*>(ui->stackedWidget->currentWidget());
    if(tableWidget == NULL)
        return;
    if(tableWidget->horizontalHeaderItem(0)->text() != "Station number")
        return ;
    QTableWidgetItem* currentItem = tableWidget->currentItem();
    if(currentItem == NULL)
        return;

    QString sql = QString("delete from tb_station_info where rowid=%1;").arg(tableWidget->item(currentItem->row(),9)->text());

    GlobalInfo_t::getInstance()->db->exec(sql);
    int index = ui->listWidget->currentRow();
    on_listWidget_currentRowChanged(index);

}
void TrainLinePanel::on_add_station_btn_clicked()
{
    QTableWidget* tableWidget =  dynamic_cast<QTableWidget*>(ui->stackedWidget->currentWidget());
    if(tableWidget == NULL)
        return;
    if(tableWidget->horizontalHeaderItem(0)->text() != "Station number")
        return ;
    QListWidgetItem* item = ui->listWidget->currentItem();
    int index = ui->listWidget->currentRow();
    if(item == NULL)
        return;
    QStringList strList = item->text().split(QChar(':'));
    QString sql = QString("insert into tb_station_info (train_id,indexNu) values(%1,(select indexNu from tb_station_info where train_id=%1 order by indexNu DESC limit 1 )+1);").arg(strList[0]);
    GlobalInfo_t::getInstance()->db->exec(sql,false);
    on_listWidget_currentRowChanged(index);


}