Esempio n. 1
0
VariableListWidget::VariableListWidget(const VariableList & variableList,
			       QWidget *parent) 
  : QTableWidget(parent)
{

  // constructor of variable table

  // make variable table
  setRowCount(0);
  setColumnCount(0);
  setColumnCount(2);

  // set headers for columns
  QTableWidgetItem *nameItem = new QTableWidgetItem;
  QTableWidgetItem *varItem = new QTableWidgetItem;
  nameItem->setText(tr("Variable List:"));
  varItem->setText(tr("Value:"));
  setHorizontalHeaderItem(0,nameItem);
  setHorizontalHeaderItem(1,varItem);
  setSortingEnabled(false);

  // control geometry
  setMinimumWidth(300);
  horizontalHeader()->setResizeMode(QHeaderView::Stretch);

  // fill list
  updateList(variableList);

  // add connections
  connect(this,SIGNAL(itemActivated(QTableWidgetItem*)),
          this,SLOT(itemValue(QTableWidgetItem*)));
  
}
Esempio n. 2
0
void Foundlist::runQuery( const QString &query, const QString &category )
{
   QStringList labels;
   labels
      << tr("Category")
      << tr("ID")
      << tr("Track")
      << tr("Title")
      << tr("Playtime")
#if INCLUDE_EXT
      << tr("Ext")
#endif
      ;

   if( !mQuery.isFinished() )
   {
      mQuery.stop();
      mQuery.wait();
   }

   clear();
#if INCLUDE_EXT
   setColumnCount( 6 );
#else
   setColumnCount( 5 );
#endif
   setRowCount( 0 );
   setHorizontalHeaderLabels( labels );

   mQuery.setQuery( query, category );
   mQuery.start();
}
Esempio n. 3
0
void Table::setMaskType(PolyEdit::Shape type)
{
    isReady = false;

    clear();
    mMask->clear();

    switch (type)
    {
        case PolyEdit::Polygon:
        {
            setColumnCount(2);
            setRowCount(1);
            setHorizontalHeaderItem(0, new Cell("X"));
            setHorizontalHeaderItem(1, new Cell("Y"));
            break;
        }
        case PolyEdit::Circle:
        {
            setColumnCount(1);
            setRowCount(3);
            setHorizontalHeaderItem(0, new Cell("Circle"));
            setVerticalHeaderItem(0,new Cell("X"));
            setVerticalHeaderItem(1,new Cell("Y"));
            setVerticalHeaderItem(2,new Cell("Radius"));
            break;
        }
        case PolyEdit::Box:
        {
            setColumnCount(1);
            setRowCount(4);
            setHorizontalHeaderItem(0, new Cell("Box"));
            setVerticalHeaderItem(0,new Cell("Left"));
            setVerticalHeaderItem(1,new Cell("Top"));
            setVerticalHeaderItem(2,new Cell("Width"));
            setVerticalHeaderItem(3,new Cell("Height"));
            break;
        }
        case PolyEdit::Invalid:
        {
            break;
        }
    }

    clearContents();

    mType = type;
    horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);

    mMask->setType(type);

    isReady = true;
}
Esempio n. 4
0
void MatrixModel::setDimensions(int rows, int cols) {
  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));

  if (rows < d_rows) { // first remove rows (faster)
    removeRows(rows, d_rows - rows);
    setColumnCount(cols);
  } else {
    setColumnCount(cols);
    if (rows > d_rows)
      insertRows(d_rows, rows - d_rows);
  }

  QApplication::restoreOverrideCursor();
}
Esempio n. 5
0
CoverageView::CoverageView(bool showCallers, TraceItemView* parentView, QWidget* parent)
    : QTreeWidget(parent), TraceItemView(parentView)
{
    _showCallers = showCallers;

    QStringList labels;
    labels  << tr( "Incl." );
    if (_showCallers) {
        setColumnCount(4);
        labels  << tr( "Distance" ),
        labels  << tr( "Called" ),
        labels  << tr( "Caller" );
    }
    else {
        setColumnCount(5);
        labels  << tr( "Self" ),
        labels  << tr( "Distance" ),
        labels  << tr( "Calling" ),
        labels  << tr( "Callee" );
    }
    setHeaderLabels(labels);

    // forbid scaling icon pixmaps to smaller size
    setIconSize(QSize(99,99));
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setUniformRowHeights(true);
    // sorting will be enabled after refresh()
    sortByColumn(0, Qt::DescendingOrder);
    setMinimumHeight(50);

    this->setWhatsThis( whatsThis() );

    connect( this,
             SIGNAL( currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
             SLOT( selectedSlot(QTreeWidgetItem*,QTreeWidgetItem*) ) );

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect( this,
             SIGNAL(customContextMenuRequested(const QPoint &) ),
             SLOT(context(const QPoint &)));

    connect(this,
            SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
            SLOT(activatedSlot(QTreeWidgetItem*,int)));

    connect(header(), SIGNAL(sectionClicked(int)),
            this, SLOT(headerClicked(int)));
}
void Spreadsheet::clear()
{
    setRowCount(0);
    setColumnCount(0);
    setRowCount(RowCount);
    setColumnCount(ColumnCount);

    for (int i = 0; i < ColumnCount; ++i) {
        QTableWidgetItem *item = new QTableWidgetItem;
        item->setText(QString(QChar('A' + i)));
        setHorizontalHeaderItem(i, item);
    }

    setCurrentCell(0, 0);
}
Esempio n. 7
0
/**************************** QgsGrassModuleInputModel ****************************/
QgsGrassModuleInputModel::QgsGrassModuleInputModel( QObject *parent )
    : QStandardItemModel( parent )
    , mWatcher( 0 )
{
  setColumnCount( 1 );
  reload();

  QString locationPath = QgsGrass::getDefaultLocationPath();
  mWatcher = new QFileSystemWatcher( this );
  mWatcher->addPath( locationPath );

  // Watching all dirs in loacation because a dir may become a mapset later, when WIND is created

  //QStringList mapsets = QgsGrass::mapsets( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
  QStringList dirNames = locationDirNames();
  foreach ( QString dirName, dirNames )
  {
    QString dirPath = locationPath + "/" + dirName;
    // Watch the dir in any case, WIND mabe created later
    mWatcher->addPath( dirPath );

    foreach ( QString watchedDir, watchedDirs() )
    {
      watch( dirPath + "/" + watchedDir );
    }
Esempio n. 8
0
CodeViewWidget::CodeViewWidget()
{
  setColumnCount(5);
  setShowGrid(false);
  setContextMenuPolicy(Qt::CustomContextMenu);
  setSelectionMode(QAbstractItemView::SingleSelection);
  setSelectionBehavior(QAbstractItemView::SelectRows);

  setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

  for (int i = 0; i < columnCount(); i++)
  {
    horizontalHeader()->setSectionResizeMode(i, QHeaderView::Fixed);
  }

  verticalHeader()->hide();
  horizontalHeader()->hide();
  horizontalHeader()->setStretchLastSection(true);

  setFont(Settings::Instance().GetDebugFont());

  Update();

  connect(this, &CodeViewWidget::customContextMenuRequested, this, &CodeViewWidget::OnContextMenu);
  connect(this, &CodeViewWidget::itemSelectionChanged, this, &CodeViewWidget::OnSelectionChanged);
  connect(&Settings::Instance(), &Settings::DebugFontChanged, this, &QWidget::setFont);
  connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this] {
    m_address = PC;
    Update();
  });

  connect(&Settings::Instance(), &Settings::ThemeChanged, this, &CodeViewWidget::Update);
}
Esempio n. 9
0
AssignedListView::AssignedListView(QWidget* const parent)
    : QTreeWidget(parent)
{
    setSelectionMode(QAbstractItemView::SingleSelection);
    setWhatsThis(i18n("This is the list of batch tools assigned."));
    setIconSize(QSize(ICONSIZE, ICONSIZE));

    setDragEnabled(true);
    setAcceptDrops(true);
    viewport()->setAcceptDrops(true);
    setDropIndicatorShown(true);

    setContextMenuPolicy(Qt::CustomContextMenu);
    setSortingEnabled(false);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(2);
    setHeaderHidden(true);
    header()->setSectionResizeMode(QHeaderView::ResizeToContents);

    connect(this, SIGNAL(itemSelectionChanged()),
            this, SLOT(slotSelectionChanged()));

    connect(this, SIGNAL(customContextMenuRequested(QPoint)),
            this, SLOT(slotContextMenu()));
}
Esempio n. 10
0
ObjectTableWidget::ObjectTableWidget(unsigned button_conf, bool conf_exclusion, QWidget *parent): QWidget(parent)
{
	setupUi(this);
	connect(move_down_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
	connect(move_up_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
	connect(move_first_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
	connect(move_last_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
	connect(add_tb, SIGNAL(clicked(bool)), this, SLOT(addRow(void)));
	connect(remove_tb, SIGNAL(clicked(bool)), this, SLOT(removeRow(void)));
	connect(edit_tb, SIGNAL(clicked(bool)), this, SLOT(editRow(void)));
	connect(update_tb, SIGNAL(clicked(bool)), this, SLOT(updateRow(void)));
	connect(remove_all_tb, SIGNAL(clicked(bool)), this, SLOT(removeRows(void)));
	connect(table_tbw, SIGNAL(cellClicked(int,int)), this, SLOT(setButtonsEnabled(void)));
	connect(table_tbw, SIGNAL(cellActivated(int,int)), this, SLOT(setButtonsEnabled(void)));
	connect(table_tbw, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(editRow(void)));
	connect(table_tbw, SIGNAL(itemSelectionChanged(void)), this, SLOT(setButtonsEnabled(void)));
	connect(table_tbw, SIGNAL(itemSelectionChanged(void)), this, SLOT(emitRowSelected(void)));

	this->conf_exclusion=conf_exclusion;

	setButtonConfiguration(button_conf);
	setColumnCount(1);

	add_tb->setToolTip(add_tb->toolTip() + QString(" (%1)").arg(add_tb->shortcut().toString()));
	remove_tb->setToolTip(remove_tb->toolTip() + QString(" (%1)").arg(remove_tb->shortcut().toString()));
	remove_all_tb->setToolTip(remove_all_tb->toolTip() + QString(" (%1)").arg(remove_all_tb->shortcut().toString()));
	update_tb->setToolTip(update_tb->toolTip() + QString(" (%1)").arg(update_tb->shortcut().toString()));
	edit_tb->setToolTip(edit_tb->toolTip() + QString(" (%1)").arg(edit_tb->shortcut().toString()));
	move_last_tb->setToolTip(move_last_tb->toolTip() + QString(" (%1)").arg(move_last_tb->shortcut().toString()));
	move_first_tb->setToolTip(move_first_tb->toolTip() + QString(" (%1)").arg(move_first_tb->shortcut().toString()));
	move_up_tb->setToolTip(move_up_tb->toolTip() + QString(" (%1)").arg(move_up_tb->shortcut().toString()));
	move_down_tb->setToolTip(move_down_tb->toolTip() + QString(" (%1)").arg(move_down_tb->shortcut().toString()));
}
Esempio n. 11
0
FileTransferWidget::FileTransferWidget(QWidget * pParent)
    : KviTalTableWidget(pParent)
{
	//hide the header
	verticalHeader()->hide();
	//hide cells grids
	setShowGrid(false);
	//disable cell content editing
	setEditTriggers(QAbstractItemView::NoEditTriggers);

	//select one row at once
	setSelectionBehavior(QAbstractItemView::SelectRows);
	setSelectionMode(QAbstractItemView::SingleSelection);

	//prepare columns
	setColumnCount(3);

	QStringList colHeaders;
	colHeaders << __tr2qs_ctx("Type", "filetransferwindow")
	           << __tr2qs_ctx("Information", "filetransferwindow")
	           << __tr2qs_ctx("Progress", "filetransferwindow");
	setHorizontalHeaderLabels(colHeaders);
	//default column widths
	setColumnWidth(0, FILETRANSFERW_CELLSIZE);
	horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
	horizontalHeader()->setSectionResizeMode(1, QHeaderView::Interactive);
	setColumnWidth(1, 500);
	horizontalHeader()->setStretchLastSection(true);
	//focus policy
	setFocusPolicy(Qt::NoFocus);
	viewport()->setFocusPolicy(Qt::NoFocus);
}
Esempio n. 12
0
ProgressTree2::ProgressTree2(QWidget *parent) :
    QTreeWidget(parent)
{
    this->autoExpandNodes = false;
    setColumnCount(5);

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(timerTimeout()));
    timer->start(1000);

    this->monitoredJobLastChanged = 0;

    setColumnWidth(0, 500);
    setColumnWidth(1, 100);
    setColumnWidth(2, 100);
    setColumnWidth(3, 200);
    setColumnWidth(4, 100);
    header()->setStretchLastSection(false);

    QStringList hls;
    hls.append(QObject::tr("Task / Step"));
    hls.append(QObject::tr("Elapsed time"));
    hls.append(QObject::tr("Remaining time"));
    hls.append(QObject::tr("Progress"));
    hls.append(QObject::tr(""));
    setHeaderLabels(hls);
}
Esempio n. 13
0
AdvancedSettings::AdvancedSettings(QWidget *parent)
    : QTableWidget(parent)
{
    // column
    setColumnCount(COL_COUNT);
    QStringList header = {tr("Setting"), tr("Value", "Value set for this setting")};
    setHorizontalHeaderLabels(header);
    // row
    setRowCount(ROW_COUNT);
    verticalHeader()->setVisible(false);
    // etc.
    setAlternatingRowColors(true);
    setSelectionMode(QAbstractItemView::NoSelection);
    setEditTriggers(QAbstractItemView::NoEditTriggers);
    // Signals
    connect(&spinBoxCache, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
            , this, &AdvancedSettings::updateCacheSpinSuffix);
    connect(&comboBoxInterface, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
            , this, &AdvancedSettings::updateInterfaceAddressCombo);
    connect(&spinBoxSaveResumeDataInterval, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
            , this, &AdvancedSettings::updateSaveResumeDataIntervalSuffix);
    // Load settings
    loadAdvancedSettings();
    resizeColumnToContents(0);
    horizontalHeader()->setStretchLastSection(true);
}
Esempio n. 14
0
void CrosswordGrid::setPuzzle( AcrossLitePuzzle* puzzle )
{
    m_puzzle           = puzzle;
    m_focusOrientation = FocusHorizontal;

    setColumnCount( m_puzzle->nColumns() );
    setRowCount( m_puzzle->nRows() );

    int colWidth  = 20;
    int rowHeight = 20;

    for( int row = 0; row < rowCount(); row++ )
    {
        for( int col = 0; col < columnCount(); col++ )
        {
            CrosswordCell* cell = new CrosswordCell();
            cell->setSolution( m_puzzle->solutionCell( col, row ) );
            cell->setShowCorrectness( false );
            cell->setGuess( m_puzzle->diagramCell( col, row ) );
            cell->setNumber( m_puzzle->cellNumber( col, row ) );
            cell->showNumber( true );
            colWidth  = cell->sizeHint().width();
            rowHeight = cell->sizeHint().height();

            setItem( row, col, cell );
        }
    }

    for( int col = 0; col < columnCount(); col++ )
        setColumnWidth( col, colWidth );
    for( int row = 0; row < rowCount(); row++ )
        setColumnWidth( row, rowHeight );
}
Esempio n. 15
0
MgEventsView::MgEventsView(QWidget * parent):QTableWidget(parent)
{
	setColumnCount(3);
	QStringList labels;
	labels<<"Type"<<"Name"<<"Event";
	setHorizontalHeaderLabels(labels);
}
Esempio n. 16
0
MenuBarTree::MenuBarTree(TFilePath & path, QWidget* parent)
	: QTreeWidget(parent)
	, m_path(path)
{
	setObjectName("SolidLineFrame");
	setAlternatingRowColors(true);
	setDragEnabled(true);
	setDropIndicatorShown(true);
	setDefaultDropAction(Qt::MoveAction);
	setDragDropMode(QAbstractItemView::DragDrop);

	setColumnCount(1);
	header()->close();

	/*- m_pathが存在するならファイルから読み込む。無ければテンプレートを読み込む -*/
	TFilePath fp;
	if (TFileStatus(path).isWritable())
		fp = m_path;
	else
	{
		fp = m_path.withParentDir(ToonzFolder::getTemplateModuleDir());
		if (!TFileStatus(path).isReadable())
			fp = ToonzFolder::getTemplateModuleDir() + "menubar_template.xml";
	}

	loadMenuTree(fp);
}
Esempio n. 17
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()));
}
Esempio n. 18
0
PlayListView::PlayListView(QWidget *parent, const char *name)
    : QTreeWidget(parent)
{
	this->setObjectName( name );
	
//     addColumn(tr("Title"));
//     addColumn(tr("File name"));
	setColumnCount( 2 );
	setHeaderLabels( QStringList() << tr("Title") << tr("File name") );
    setAllColumnsShowFocus(true);
	
    setSelectionBehavior( QAbstractItemView::SelectRows );
    setSelectionMode( QAbstractItemView::SingleSelection );
    
    setDropIndicatorShown(true);
    setDragEnabled(true);
    setAcceptDrops(true);
    //setDragDropMode( QAbstractItemView::NoDragDrop );
    //setDragDropMode(QAbstractItemView::InternalMove);
    
	
	/*
	setShowToolTips(true);		//&&& disabled a few property inits
	setShowSortIndicator(true);
	setItemsMovable(true);
    setSorting(-1);
	*/
}
Esempio n. 19
0
KColorCells::KColorCells( QWidget *parent, int rows, int cols )
    : QTableWidget( parent ), d( new KColorCellsPrivate( this ) )
{
    setItemDelegate( new KColorCellsItemDelegate( this ) );

    setFrameShape( QFrame::NoFrame );
    d->shade = true;
    setRowCount( rows );
    setColumnCount( cols );

    verticalHeader()->hide();
    horizontalHeader()->hide();

    d->selected = -1;
    d->inMouse = false;

    // Drag'n'Drop
    setAcceptDrops( true );

    setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
    setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
    viewport()->setBackgroundRole( QPalette::Background );
    setBackgroundRole( QPalette::Background );


    setSelectionMode( QAbstractItemView::SingleSelection );
    setDragEnabled( false );
}
void MusicDownloadTableWidget::clearAllItems()
{
    qDeleteAll(m_items);
    m_items.clear();
    MusicAbstractTableWidget::clear();
    setColumnCount(1);
}
Esempio n. 21
0
// wrapper class to extract info from QTableWidget regarding sorting and
// position of each label in the header
MailListView::MailListView(QWidget *parent, const char *name)
    : QTableWidget( parent)
{
    setObjectName( name );
    setFrameStyle( NoFrame );
    connect(horizontalHeader(), SIGNAL(sectionResized(int,int,int)), this, SLOT(sizeChange(int,int,int)) );
    horizontalHeader()->setSortIndicatorShown(false);

    sortColumn = -1;
    ascending = false;
    emailsOnly = false;

    connect( &menuTimer, SIGNAL(timeout()), SLOT(itemMenuRequested()) );
    connect( this, SIGNAL(itemSelectionChanged()), SLOT(cancelMenuTimer()) );
    connect( horizontalScrollBar(), SIGNAL(valueChanged(int)),
             this, SLOT(scrollToLeft(int)) );

    arrival = false;

    hVisible = true;    //part of sizeChangefix (avoid unnecessary flickering)
    maxColumnWidth = 0;
    mSingleColumnMode = true;
    QSoftMenuBar::setLabel(this, Qt::Key_Select, QSoftMenuBar::NoLabel);
    columns << "";
    if(!mSingleColumnMode)
    {
        columns << tr( "From" );
        columns <<  tr( "Subject" );
        columns <<  tr( "Date" );
    }
    setColumnCount( columns.count() );
    setHorizontalHeaderLabels( columns );
    verticalHeader()->hide();

    // Row height should be the size of the text - the second line being 3/4ths of the first
    int textHeight = QFontMetrics(font()).height() * 7 / 4;

    // Also, the icon could be larger than the text
    int iconHeight = style()->pixelMetric(QStyle::PM_ListViewIconSize);
    verticalHeader()->setDefaultSectionSize( qMax(textHeight, iconHeight) );

    setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
    setAlternatingRowColors( true );

    horizontalHeaderItem(0)->setIcon(QPixmap(":image/flag"));

    QAction *hhWhatsThis = QWhatsThis::createAction( horizontalHeader() );
    hhWhatsThis->setText( tr("Select the sort order by tapping any of the columns in this header.  Tapping the same column twice will switch between ascending and descending order.") );

    QAction *tWhatsThis = QWhatsThis::createAction( this );
    tWhatsThis->setText( tr("A list of the messages in your current folder.  Tap a message to examine it.") );

//    setRootIsDecorated( true );

    setSelectionMode( QAbstractItemView::ExtendedSelection );
    EmailListItemDelegate *delegate = new EmailListItemDelegate( this );
    setItemDelegate( delegate );
    scrollToLeft( 0 );
    horizontalHeader()->setResizeMode(QHeaderView::Stretch);
}
Esempio n. 22
0
ThreadListWidget::ThreadListWidget(QWidget *parent) : QTreeWidget(parent) {
    setColumnCount(3);
    currentGroup = 0;
    disableSortAndResize = false;
    QStringList headers;
    headers << "Subject" << "Date" << "Author" << "Ordernum";
    setHeaderLabels(headers);
    setSelectionMode(QAbstractItemView::SingleSelection);

    connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem *)),
            this, SLOT(messageSelected(QTreeWidgetItem*,QTreeWidgetItem *)));
    hideColumn(3);

    markReadAction = new QAction("Mark thread read", this);
    markReadAction->setToolTip("Marks all messages in this thread read");
    connect(markReadAction, SIGNAL(triggered()), this, SLOT(markReadClicked()));
    markUnreadAction = new QAction("Mark thread unread", this);
    markUnreadAction->setToolTip("Marks all messages in this thread as unread");
    connect(markUnreadAction, SIGNAL(triggered()), this, SLOT(markUnreadClicked()));
    threadPropertiesAction = new QAction("Thread properties", this);
    threadPropertiesAction->setToolTip("Information and settings for selected thread");
    connect(threadPropertiesAction, SIGNAL(triggered()), this, SLOT(threadPropertiesClicked()));
    viewInBrowserAction = new QAction("View in browser", this);
    viewInBrowserAction->setToolTip("View the message in external browser");
    connect(viewInBrowserAction, SIGNAL(triggered()), this, SLOT(viewInBrowserClicked()));
    forceUpdateThreadAction = new QAction("Force update of thread", this);
    forceUpdateThreadAction->setToolTip("Updates all messages in selected thread");
    connect(forceUpdateThreadAction, SIGNAL(triggered()), this, SLOT(forceUpdateThreadClicked()));
}
DisassembleWidget::DisassembleWidget(CppDebuggerPlugin* plugin, QWidget *parent)
        : QTreeWidget(parent),
        active_(false),
        lower_(0),
        upper_(0),
        address_(0)
{
    setToolTip(i18n("<b>Machine code display</b><p>"
                    "A machine code view into your running "
                    "executable with the current instruction "
                    "highlighted. You can step instruction by "
                    "instruction using the debuggers toolbar "
                    "buttons of \"step over\" instruction and "
                    "\"step into\" instruction."));
    setWindowIcon( KIcon("system-run") );
    setWindowTitle(i18n("Disassemble View"));
    setFont(KGlobalSettings::fixedFont());
    setSelectionMode(SingleSelection);
    setColumnCount(ColumnCount);

    setHeaderLabels(QStringList() << i18n("Address") << i18n("Function") << i18n("Offset") << i18n("Instruction"));

    connect(KDevelop::ICore::self()->debugController(), 
            SIGNAL(currentSessionChanged(KDevelop::IDebugSession*)),
            SLOT(currentSessionChanged(KDevelop::IDebugSession*)));

    connect(plugin, SIGNAL(reset()), this, SLOT(clear()));
    connect(plugin, SIGNAL(reset()), this, SLOT(slotDeactivate()));
}
Esempio n. 24
0
FeedListWidget::FeedListWidget(QWidget *parent)
    : QTreeWidget(parent)
{
    setContextMenuPolicy(Qt::CustomContextMenu);
    setDragDropMode(QAbstractItemView::InternalMove);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setColumnCount(1);
    headerItem()->setText(0, tr("RSS feeds"));

    connect(RSS::Session::instance(), &RSS::Session::itemAdded, this, &FeedListWidget::handleItemAdded);
    connect(RSS::Session::instance(), &RSS::Session::feedStateChanged, this, &FeedListWidget::handleFeedStateChanged);
    connect(RSS::Session::instance(), &RSS::Session::feedIconLoaded, this, &FeedListWidget::handleFeedIconLoaded);
    connect(RSS::Session::instance(), &RSS::Session::itemPathChanged, this, &FeedListWidget::handleItemPathChanged);
    connect(RSS::Session::instance(), &RSS::Session::itemAboutToBeRemoved, this, &FeedListWidget::handleItemAboutToBeRemoved);

    m_rssToTreeItemMapping[RSS::Session::instance()->rootFolder()] = invisibleRootItem();

    m_unreadStickyItem = new QTreeWidgetItem(this);
    m_unreadStickyItem->setData(0, Qt::UserRole, reinterpret_cast<quintptr>(RSS::Session::instance()->rootFolder()));
    m_unreadStickyItem->setText(0, tr("Unread  (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount()));
    m_unreadStickyItem->setData(0, Qt::DecorationRole, GuiIconProvider::instance()->getIcon("mail-folder-inbox"));

    connect(RSS::Session::instance()->rootFolder(), &RSS::Item::unreadCountChanged, this, &FeedListWidget::handleItemUnreadCountChanged);

    setSortingEnabled(false);
    fill(nullptr, RSS::Session::instance()->rootFolder());
    setSortingEnabled(true);

//    setCurrentItem(m_unreadStickyItem);
}
Esempio n. 25
0
void PumpSpreadsheet::clearData()
{
    setRowCount(0);
    setColumnCount(0);
    setColumnCount(ColumnCount);

    setHorizontalHeaderItem(Date, new QTableWidgetItem(tr("Date")));
    setHorizontalHeaderItem(Time, new QTableWidgetItem(tr("Time")));
    setHorizontalHeaderItem(Pump, new QTableWidgetItem(tr("Pump")));
    setHorizontalHeaderItem(Company,
                            new QTableWidgetItem(tr("Company")));
    setHorizontalHeaderItem(User, new QTableWidgetItem(tr("User")));
    setHorizontalHeaderItem(Quantity,
                            new QTableWidgetItem(tr("Quantity")));
    setHorizontalHeaderItem(Status, new QTableWidgetItem(tr("Status")));
}
Esempio n. 26
0
EnfuseStackList::EnfuseStackList(QWidget* parent)
               : QTreeWidget(parent), d(new EnfuseStackListPriv)
{
    d->progressTimer = new QTimer(this);

    setContextMenuPolicy(Qt::CustomContextMenu);
    setIconSize(QSize(64, 64));
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSortingEnabled(false);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(3);
    setHeaderHidden(false);
    setDragEnabled(false);
    header()->setResizeMode(QHeaderView::Stretch);

    QStringList labels;
    labels.append( i18n("To Save") );
    labels.append( i18n("Target") );
    labels.append( i18n("Inputs") );
    setHeaderLabels(labels);

    connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
            this, SLOT(slotItemClicked(QTreeWidgetItem*)));

    connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(slotContextMenu(const QPoint&)));

    connect(d->progressTimer, SIGNAL(timeout()),
            this, SLOT(slotProgressTimerDone()));
}
Esempio n. 27
0
QQuestionsTableWidget::QQuestionsTableWidget(QWidget *parent,unsigned int rating, unsigned int choice_count) :
    QTableWidget(parent),
    RATING(rating),
    CHOICE_COUNT(choice_count),
    shortcut_new(QKeySequence(Qt::CTRL + Qt::Key_N),this)
{
    table_width = -1;
    QStringList sl;
    sl << tr("Вопрос");
    for (unsigned int i = 0; i < CHOICE_COUNT; i++)
        sl << tr("Ответ №%1").arg(QString::number(i + 1));
    sl << tr("Правильный ответ");
    if (RATING)
        sl << tr("Сложность");
    setColumnCount(sl.count());
    setHorizontalHeaderLabels(sl);
    initMenu();
    setSelectionBehavior(SelectRows);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    connect(this,SIGNAL(itemChanged(QTableWidgetItem*)),this,SIGNAL(signalNeedSave()));
    connect(&shortcut_new,SIGNAL(activated()),this,SLOT(addQuestionRow()));

}
void
AnalysisDataFrameAverageModule::dataStarted(AbstractAnalysisData *data)
{
    setColumnCount(0, data->dataSetCount());
    impl_->sampleCount_.resize(data->dataSetCount());
    impl_->storage_.startDataStorage(this, &moduleManager());
}
Esempio n. 29
0
InterfaceTree::InterfaceTree(QWidget *parent) :
    QTreeWidget(parent)
#ifdef HAVE_LIBPCAP
    ,stat_cache_(NULL)
    ,stat_timer_(NULL)
#endif // HAVE_LIBPCAP
{
    QTreeWidgetItem *ti;

    header()->setVisible(false);
    setRootIsDecorated(false);
    setUniformRowHeights(true);
    setColumnCount(2);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setAccessibleName(tr("Welcome screen list"));

    setItemDelegateForColumn(1, new SparkLineDelegate());
    setDisabled(true);

    ti = new QTreeWidgetItem();
    ti->setText(0, tr("Waiting for startup" UTF8_HORIZONTAL_ELLIPSIS));
    addTopLevelItem(ti);
    resizeColumnToContents(0);

    connect(wsApp, SIGNAL(appInitialized()), this, SLOT(getInterfaceList()));
    connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectedInterfaces()));
}
BracketStackList::BracketStackList(Interface* iface, QWidget* parent)
                : QTreeWidget(parent), d(new BracketStackListPriv)
{
    d->iface = iface;

    setIconSize(QSize(64, 64));
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSortingEnabled(true);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(3);
    setHeaderHidden(false);
    setDragEnabled(false);
    header()->setResizeMode(QHeaderView::Stretch);

    QStringList labels;
    labels.append( i18n("To process") );
    labels.append( i18n("File Name") );
    labels.append( i18n("Exposure (EV)") );
    setHeaderLabels(labels);

    if (d->iface)
    {
        connect(d->iface, SIGNAL(gotThumbnail(KUrl,QPixmap)),
                this, SLOT(slotThumbnail(KUrl,QPixmap)));
    }

    d->loadRawThumb = new KPRawThumbThread(this);

    connect(d->loadRawThumb, SIGNAL(signalRawThumb(KUrl,QImage)),
            this, SLOT(slotRawThumb(KUrl,QImage)));

    sortItems(2, Qt::DescendingOrder);
}