Beispiel #1
0
/*!
  \brief Constructor
  \param parent Parent widget
  \param name Widget name

  Create a compass widget with a scale, no needle and no rose. 
  The default origin is 270.0 with no valid value. It accepts
  mouse and keyboard inputs and has no step size. The default mode
  is QwtDial::RotateNeedle.
*/  
QwtCompass::QwtCompass(QWidget* parent, const char* name):
        QwtDial(parent, name),
    d_rose(0)
{
    setScaleOptions(ScaleLabel); // Only labels, no backbone, no ticks

    setOrigin(270.0);
    setWrapping(TRUE);


    d_labelMap.insert(0.0, QString::fromLatin1("N"));
    d_labelMap.insert(45.0, QString::fromLatin1("NE"));
    d_labelMap.insert(90.0, QString::fromLatin1("E"));
    d_labelMap.insert(135.0, QString::fromLatin1("SE"));
    d_labelMap.insert(180.0, QString::fromLatin1("S"));
    d_labelMap.insert(225.0, QString::fromLatin1("SW"));
    d_labelMap.insert(270.0, QString::fromLatin1("W"));
    d_labelMap.insert(315.0, QString::fromLatin1("NW"));

#if 0
    d_labelMap.insert(22.5, QString::fromLatin1("NNE"));
    d_labelMap.insert(67.5, QString::fromLatin1("NEE"));
    d_labelMap.insert(112.5, QString::fromLatin1("SEE"));
    d_labelMap.insert(157.5, QString::fromLatin1("SSE"));
    d_labelMap.insert(202.5, QString::fromLatin1("SSW"));
    d_labelMap.insert(247.5, QString::fromLatin1("SWW"));
    d_labelMap.insert(292.5, QString::fromLatin1("NWW"));
    d_labelMap.insert(337.5, QString::fromLatin1("NNW"));
#endif
}
Beispiel #2
0
TListView::TListView(TListViewPrivate &dd): d_ptr(&dd)
   {
      //Q_D(TListView);
      //d->q_ptr = this;
      setWrapping(true);
      setResizeMode(QListView::Adjust);
   }
Beispiel #3
0
Smb4KSharesView::Smb4KSharesView(QWidget *parent)
: QListWidget(parent)
{
  setMouseTracking(true);
  setSelectionMode(ExtendedSelection);
  setResizeMode(Adjust);
  setSortingEnabled(true);
  setWordWrap(true);
  setAcceptDrops(true);
  setDragEnabled(true);
  setDropIndicatorShown(true);
  setUniformItemSizes(true);
  setWrapping(true);
  
  setContextMenuPolicy(Qt::CustomContextMenu);

  m_tooltipItem = 0;
  m_mouseInside = false;

  // Connections:
  connect(this, SIGNAL(itemEntered(QListWidgetItem*)),
          this, SLOT(slotItemEntered(QListWidgetItem*)));

  connect(this, SIGNAL(viewportEntered()),
          this, SLOT(slotViewportEntered()));
}
Beispiel #4
0
void ImageThumbnailBar::setFlow(QListView::Flow flow)
{
    setWrapping(false);

    ImageCategorizedView::setFlow(flow);

    ImageThumbnailDelegate* const del = static_cast<ImageThumbnailDelegate*>(delegate());
    del->setFlow(flow);

    // Reset the minimum and maximum sizes.
    setMinimumSize(QSize(0, 0));
    setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));

    // Adjust minimum and maximum width to thumbnail sizes.
    if (flow == TopToBottom)
    {
        int viewportFullWidgetOffset = size().width() - viewport()->size().width();
        setMinimumWidth(del->minimumSize() + viewportFullWidgetOffset);
        setMaximumWidth(del->maximumSize() + viewportFullWidgetOffset);
    }
    else
    {
        int viewportFullWidgetOffset = size().height() - viewport()->size().height();
        setMinimumHeight(del->minimumSize() + viewportFullWidgetOffset);
        setMaximumHeight(del->maximumSize() + viewportFullWidgetOffset);
    }

    setScrollBarPolicy(d->scrollPolicy);
}
void QwtCompass::initCompass()
{
    d_data = new PrivateData;

    setScaleOptions(ScaleLabel); // Only labels, no backbone, no ticks

    setOrigin(270.0);
    setWrapping(true);


    d_data->labelMap.insert(0.0, QString::fromLatin1("N"));
    d_data->labelMap.insert(45.0, QString::fromLatin1("NE"));
    d_data->labelMap.insert(90.0, QString::fromLatin1("E"));
    d_data->labelMap.insert(135.0, QString::fromLatin1("SE"));
    d_data->labelMap.insert(180.0, QString::fromLatin1("S"));
    d_data->labelMap.insert(225.0, QString::fromLatin1("SW"));
    d_data->labelMap.insert(270.0, QString::fromLatin1("W"));
    d_data->labelMap.insert(315.0, QString::fromLatin1("NW"));

#if 0
    d_data->labelMap.insert(22.5, QString::fromLatin1("NNE"));
    d_data->labelMap.insert(67.5, QString::fromLatin1("NEE"));
    d_data->labelMap.insert(112.5, QString::fromLatin1("SEE"));
    d_data->labelMap.insert(157.5, QString::fromLatin1("SSE"));
    d_data->labelMap.insert(202.5, QString::fromLatin1("SSW"));
    d_data->labelMap.insert(247.5, QString::fromLatin1("SWW"));
    d_data->labelMap.insert(292.5, QString::fromLatin1("NWW"));
    d_data->labelMap.insert(337.5, QString::fromLatin1("NNW"));
#endif
}
void XAP_UnixDialog_Image::event_Ok ()
{
	setAnswer(XAP_Dialog_Image::a_OK);
	setTitle (gtk_entry_get_text (GTK_ENTRY(m_wTitleEntry)));
	setDescription (gtk_entry_get_text (GTK_ENTRY(m_wDescriptionEntry)));
	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbInLine)))
	{
		setWrapping(WRAP_INLINE);
	}
	else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbNone)))
	{
		setWrapping(WRAP_NONE);
	}
	else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbWrappedRight)))
	{
		setWrapping(WRAP_TEXTRIGHT);
	}
	else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbWrappedLeft)))
	{
		setWrapping(WRAP_TEXTLEFT);
	}
	else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbWrappedBoth)))
	{
		setWrapping(WRAP_TEXTBOTH);
	}

	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbPlaceParagraph)))
	{
		setPositionTo(POSITION_TO_PARAGRAPH);
	}
	else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbPlaceColumn)))
	{
		setPositionTo(POSITION_TO_COLUMN);
	}
	else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbPlacePage)))
	{
		setPositionTo(POSITION_TO_PAGE);
	}
	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_wrbTightWrap)))
	{
	        setTightWrap(true);
	}
	else
	{
	        setTightWrap(false);
	}
}
Beispiel #7
0
IconPickerDialog::IconPickerDialog(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::IconPickerDialog)
{
    MultiMCPlatform::fixWM_CLASS(this);
	ui->setupUi(this);
	setWindowModality(Qt::WindowModal);
	
	auto contentsWidget = ui->iconView;
	contentsWidget->setViewMode(QListView::IconMode);
	contentsWidget->setFlow(QListView::LeftToRight);
	contentsWidget->setIconSize(QSize(48, 48));
	contentsWidget->setMovement(QListView::Static);
	contentsWidget->setResizeMode(QListView::Adjust);
	contentsWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	contentsWidget->setSpacing(5);
	contentsWidget->setWordWrap(false);
	contentsWidget->setWrapping(true);
	contentsWidget->setUniformItemSizes(true);
	contentsWidget->setTextElideMode(Qt::ElideRight);
	contentsWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
	contentsWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	contentsWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	contentsWidget->setItemDelegate(new ListViewDelegate());
	
	//contentsWidget->setAcceptDrops(true);
	contentsWidget->setDropIndicatorShown(true);
	contentsWidget->viewport()->setAcceptDrops(true);
	contentsWidget->setDragDropMode(QAbstractItemView::DropOnly);
	contentsWidget->setDefaultDropAction(Qt::CopyAction);
	
	contentsWidget->installEventFilter(this);
	
	contentsWidget->setModel(MMC->icons().get());
	
	auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"),QDialogButtonBox::ResetRole);
	auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"),QDialogButtonBox::ResetRole);
	
	
	connect(buttonAdd,SIGNAL(clicked(bool)),SLOT(addNewIcon()));
	connect(buttonRemove,SIGNAL(clicked(bool)),SLOT(removeSelectedIcon()));
	
	connect
	(
		contentsWidget,
		SIGNAL(doubleClicked(QModelIndex)),
		SLOT(activated(QModelIndex))
	);
	
	connect
	(
		contentsWidget->selectionModel(),
		SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
		SLOT(selectionChanged(QItemSelection,QItemSelection))
	);
}
int QwtAbstractSlider::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QwtAbstractScale::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 5)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 5;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< double*>(_v) = value(); break;
        case 1: *reinterpret_cast< uint*>(_v) = totalSteps(); break;
        case 2: *reinterpret_cast< uint*>(_v) = singleSteps(); break;
        case 3: *reinterpret_cast< uint*>(_v) = pageSteps(); break;
        case 4: *reinterpret_cast< bool*>(_v) = stepAlignment(); break;
        case 5: *reinterpret_cast< bool*>(_v) = isReadOnly(); break;
        case 6: *reinterpret_cast< bool*>(_v) = isTracking(); break;
        case 7: *reinterpret_cast< bool*>(_v) = wrapping(); break;
        case 8: *reinterpret_cast< bool*>(_v) = invertedControls(); break;
        }
        _id -= 9;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setValue(*reinterpret_cast< double*>(_v)); break;
        case 1: setTotalSteps(*reinterpret_cast< uint*>(_v)); break;
        case 2: setSingleSteps(*reinterpret_cast< uint*>(_v)); break;
        case 3: setPageSteps(*reinterpret_cast< uint*>(_v)); break;
        case 4: setStepAlignment(*reinterpret_cast< bool*>(_v)); break;
        case 5: setReadOnly(*reinterpret_cast< bool*>(_v)); break;
        case 6: setTracking(*reinterpret_cast< bool*>(_v)); break;
        case 7: setWrapping(*reinterpret_cast< bool*>(_v)); break;
        case 8: setInvertedControls(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 9;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 9;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #9
0
Reflector::Reflector(Object3D* parent, SceneGraph::DrawableGroup3D* group): Object3D(parent), SceneGraph::Drawable3D(*this, group) {
    CubeMapResourceManager& resourceManager = CubeMapResourceManager::instance();

    /* Sphere mesh */
    if(!(_sphere = resourceManager.get<GL::Mesh>("sphere"))) {
        Trade::MeshData3D sphereData = Primitives::uvSphereSolid(16, 32, Primitives::UVSphereTextureCoords::Generate);

        GL::Buffer* buffer = new GL::Buffer;
        buffer->setData(MeshTools::interleave(sphereData.positions(0), sphereData.textureCoords2D(0)), GL::BufferUsage::StaticDraw);

        Containers::Array<char> indexData;
        MeshIndexType indexType;
        UnsignedInt indexStart, indexEnd;
        std::tie(indexData, indexType, indexStart, indexEnd) = MeshTools::compressIndices(sphereData.indices());

        GL::Buffer* indexBuffer = new GL::Buffer;
        indexBuffer->setData(indexData, GL::BufferUsage::StaticDraw);

        GL::Mesh* mesh = new GL::Mesh;
        mesh->setPrimitive(sphereData.primitive())
            .setCount(sphereData.indices().size())
            .addVertexBuffer(*buffer, 0, ReflectorShader::Position{}, ReflectorShader::TextureCoords{})
            .setIndexBuffer(*indexBuffer, 0, indexType, indexStart, indexEnd);

        resourceManager.set("sphere-buffer", buffer, ResourceDataState::Final, ResourcePolicy::Resident)
            .set("sphere-index-buffer", indexBuffer, ResourceDataState::Final, ResourcePolicy::Resident)
            .set(_sphere.key(), mesh, ResourceDataState::Final, ResourcePolicy::Resident);
    }

    /* Tarnish texture */
    if(!(_tarnishTexture = resourceManager.get<GL::Texture2D>("tarnish-texture"))) {
        Resource<Trade::AbstractImporter> importer = resourceManager.get<Trade::AbstractImporter>("jpeg-importer");
        Utility::Resource rs("data");
        importer->openData(rs.getRaw("tarnish.jpg"));

        Containers::Optional<Trade::ImageData2D> image = importer->image2D(0);
        CORRADE_INTERNAL_ASSERT(image);
        auto texture = new GL::Texture2D;
        texture->setWrapping(GL::SamplerWrapping::ClampToEdge)
            .setMagnificationFilter(GL::SamplerFilter::Linear)
            .setMinificationFilter(GL::SamplerFilter::Linear, GL::SamplerMipmap::Linear)
            .setStorage(Math::log2(image->size().min())+1, GL::TextureFormat::RGB8, image->size())
            .setSubImage(0, {}, *image)
            .generateMipmap();

        resourceManager.set<GL::Texture2D>(_tarnishTexture.key(), texture, ResourceDataState::Final, ResourcePolicy::Resident);
    }

    /* Reflector shader */
    if(!(_shader = resourceManager.get<GL::AbstractShaderProgram, ReflectorShader>("reflector-shader")))
        resourceManager.set<GL::AbstractShaderProgram>(_shader.key(), new ReflectorShader, ResourceDataState::Final, ResourcePolicy::Resident);

    /* Texture (created in CubeMap class) */
    _texture = resourceManager.get<GL::CubeMapTexture>("texture");
}
Beispiel #10
0
DoubleSpinBox::DoubleSpinBox(const char format, QWidget *parent)
    : QAbstractSpinBox(parent), d_format(format), d_min_val(-DBL_MAX),
      d_max_val(DBL_MAX), d_value(0.0), d_step(0.1), d_prec(14) {
  if (format == 'f')
    d_prec = 1;

  setFocusPolicy(Qt::StrongFocus);
  lineEdit()->setText(locale().toString(d_value, d_format, d_prec));
  setWrapping(false);
  connect(this, SIGNAL(editingFinished()), this, SLOT(interpretText()));
}
Beispiel #11
0
ChannelView::ChannelView(QWidget *parent) : QListView(parent),
    showUpdated(false),
    sortBy(SortByName) {

    setItemDelegate(new ChannelItemDelegate(this));
    setSelectionMode(QAbstractItemView::NoSelection);

    // layout
    setSpacing(15);
    setFlow(QListView::LeftToRight);
    setWrapping(true);
    setResizeMode(QListView::Adjust);
    setMovement(QListView::Static);
    setUniformItemSizes(true);

    // cosmetics
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    setFrameShape(QFrame::NoFrame);
    setAttribute(Qt::WA_MacShowFocusRect, false);

    QPalette p = palette();
    /*
    p.setColor(QPalette::Base, p.window().color());
    p.setColor(QPalette::Text, p.windowText().color());
    */
    p.setColor(QPalette::Disabled, QPalette::Base, p.base().color());
    p.setColor(QPalette::Disabled, QPalette::Text, p.text().color());
    setPalette(p);

    verticalScrollBar()->setPageStep(3);
    verticalScrollBar()->setSingleStep(1);

    setMouseTracking(true);

    connect(this, SIGNAL(clicked(const QModelIndex &)),
            SLOT(itemActivated(const QModelIndex &)));
    connect(this, SIGNAL(entered(const QModelIndex &)),
            SLOT(itemEntered(const QModelIndex &)));

    channelsModel = new ChannelModel(this);
    setModel(channelsModel);
    connect(this, SIGNAL(viewportEntered()),
            channelsModel, SLOT(clearHover()));

    setupActions();

    connect(ChannelAggregator::instance(), SIGNAL(channelChanged(YTChannel*)),
            channelsModel, SLOT(updateChannel(YTChannel*)));
    connect(ChannelAggregator::instance(), SIGNAL(unwatchedCountChanged(int)),
            SLOT(unwatchedCountChanged(int)));

    unwatchedCountChanged(ChannelAggregator::instance()->getUnwatchedCount());
}
//-------------------------------------------------------------------------------------------------
BachAssetListView::BachAssetListView( QWidget * parent )
:	RecordListView( parent )
,	mDragDropHelper( this )
,	mShowingCollection( false )
{
	setFlow(QListView::LeftToRight);
	setWrapping(true);
	setUniformItemSizes(true);
	setLayoutMode(QListView::Batched);
	setResizeMode(QListView::Adjust);
	setSelectionRectVisible(true);
}
Beispiel #13
0
MovieList::MovieList(QWidget *parent) : QListView(parent){
    setItemDelegate(new MovieDelegate());

    setFlow(QListView::LeftToRight);
    setWrapping(true);
    setResizeMode(QListView::Adjust);
    setMouseTracking(true);
    setUniformItemSizes(true);
    setSpacing(10);

   // setModel();

}
void AP_UnixDialog_FormatFrame::notifyActiveFrame(XAP_Frame *_pFrame)
{
    UT_ASSERT(m_windowMain);
	ConstructWindowName();
	gtk_window_set_title (GTK_WINDOW (m_windowMain), m_WindowName);
	setAllSensitivities();
	FV_View * pView = static_cast<FV_View *>(_pFrame->getCurrentView());
	if(pView && pView->isInFrame(pView->getPoint()))
	{
		fl_BlockLayout * pBL = pView->getCurrentBlock();
		fl_FrameLayout * pFrame = static_cast<fl_FrameLayout *>(pBL->myContainingLayout());
		if(pFrame->getContainerType() != FL_CONTAINER_FRAME)
		{
			UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN);
			return;
		}
		if(pFrame->getFrameWrapMode() >= FL_FRAME_WRAPPED_TO_RIGHT)
		{
			setWrapping(true);
		}
		else
		{
			setWrapping(false);
		}
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_wWrapButton),getWrapping());
		if(positionMode() == FL_FRAME_POSITIONED_TO_BLOCK)
		{
		     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( m_wPosParagraph),TRUE);
		}
		else if(positionMode() == FL_FRAME_POSITIONED_TO_COLUMN)
		{
		     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_wPosColumn),TRUE);
		} 
		else if(positionMode() == FL_FRAME_POSITIONED_TO_PAGE)
		{
		     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_wPosPage),TRUE);
		} 
	}
}
DoubleSpinBox::DoubleSpinBox(const char format, QWidget * parent)
    :QAbstractSpinBox(parent),
     d_format(format),
     d_min_val(-DBL_MAX),
     d_max_val(DBL_MAX),
     d_value(0.0),
     d_step(0.1),
     d_prec(1)
{
    lineEdit()->setText(locale().toString(d_value, d_format, d_prec));
    setKeyboardTracking(false);
    setWrapping(false);
    connect(this, SIGNAL(editingFinished()), this, SLOT(interpretText()));
}
AttitudeIndicator::AttitudeIndicator(
        QWidget *parent):
    QwtDial(parent),
    d_gradient(0.0)
{
    setMode(RotateScale);
    setWrapping(true);

    setOrigin(270.0);
    setScaleComponents( QwtAbstractScaleDraw::Ticks );
    setScale(0, 0, 30.0);

    const QColor color = palette().color(QPalette::Text);
    setNeedle(new AttitudeIndicatorNeedle(color));
}
Beispiel #17
0
BrowseWidget::BrowseWidget(QWidget *parent, unsigned int dbid,
			   QPixmap *dir_pixmap, QPixmap *file_pixmap)
    : QListWidget(parent),
      m_dbid(dbid),
      m_dir_pixmap(dir_pixmap),
      m_file_pixmap(file_pixmap)
{
    setResizeMode(Adjust);
    setSelectionMode(ExtendedSelection);
    setWordWrap(false);
    setSpacing(0);
    setViewMode(ListMode);
    setWrapping(true);
    setDragDropMode(DragOnly);
}
Beispiel #18
0
/*!
  \brief Constructor
  \param parent Parent widget

  Create a compass widget with a scale, no needle and no rose.
  The default origin is 270.0 with no valid value. It accepts
  mouse and keyboard inputs and has no step size. The default mode
  is QwtDial::RotateNeedle.
*/
QwtCompass::QwtCompass( QWidget* parent ):
    QwtDial( parent )
{
    d_data = new PrivateData;

    setScaleDraw( new QwtCompassScaleDraw() );

    setOrigin( 270.0 );
    setWrapping( true );

    setScaleMaxMajor( 36 );
    setScaleMaxMinor( 10 );

    setScale( 0.0, 360.0 ); // degrees as default
    setTotalSteps( 360 );
}
Beispiel #19
0
ListView_Impl::ListView_Impl()
	: QListView(), WidgetInterface(), fWideSel(false)
{
	setItemDelegate(new ListView_Delegate(this));
	setContextMenuPolicy(Qt::CustomContextMenu);
	setDragDropMode(DropOnly);
	setDropIndicatorShown(false);
	setEditTriggers(NoEditTriggers);
	setTextElideMode(Qt::ElideMiddle);
	setSelectionMode(QAbstractItemView::SingleSelection);
	setResizeMode(QListView::Adjust);
	setWrapping(true);
	
	connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(handleActivated(const QModelIndex&)));
	connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(handleContextMenu(const QPoint&)));
}
Beispiel #20
0
TListView::TListView(): d_ptr(new TListViewPrivate)
   {
      setWrapping(true);
      setResizeMode(QListView::Adjust);
      m_PopupMenu = new QMenu(this);
      //m_PopupMenu->addAction(QIcon(Constants::ICON_ADDNEW), "Add New Task", this, SLOT(_q_AddNew_triggered()));

      //setShowGrid(false);
      //setViewMode(QListView::IconMode);
      //setLayoutMode(QListView::Batched);
      //setEditTriggers(QAbstractItemView::DoubleClicked);
      //setGridSize(QSize(100, 20));

      //d->ItemInfoWidget = new TItemInfoWidget(this);
      //SetToolTip(d->ItemInfoWidget);
   }
bool QDial::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setValue((int)static_QUType_int.get(_o+1)); break;
    case 1: addLine(); break;
    case 2: subtractLine(); break;
    case 3: addPage(); break;
    case 4: subtractPage(); break;
    case 5: setNotchesVisible((bool)static_QUType_bool.get(_o+1)); break;
    case 6: setWrapping((bool)static_QUType_bool.get(_o+1)); break;
    case 7: setTracking((bool)static_QUType_bool.get(_o+1)); break;
    default:
	return QWidget::qt_invoke( _id, _o );
    }
    return TRUE;
}
Beispiel #22
0
ClipboardBrowser::ClipboardBrowser(QWidget *parent, const ClipboardBrowserSharedPtr &sharedData)
    : QListView(parent)
    , m_itemLoader()
    , m_tabName()
    , m_lastFiltered(-1)
    , m(this)
    , d(this)
    , m_invalidateCache(false)
    , m_expireAfterEditing(false)
    , m_editor(NULL)
    , m_sharedData(sharedData ? sharedData : ClipboardBrowserSharedPtr(new ClipboardBrowserShared))
    , m_loadButton(NULL)
    , m_searchProgress(NULL)
    , m_dragTargetRow(-1)
    , m_dragStartPosition()
    , m_spinLock(0)
    , m_scrollSaver()
{
    setLayoutMode(QListView::Batched);
    setBatchSize(1);
    setFrameShape(QFrame::NoFrame);
    setTabKeyNavigation(false);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setWrapping(false);
    setLayoutMode(QListView::SinglePass);
    setEditTriggers(QAbstractItemView::NoEditTriggers);
    setAlternatingRowColors(true);

    initSingleShotTimer( &m_timerSave, 30000, this, SLOT(saveItems()) );
    initSingleShotTimer( &m_timerScroll, 50 );
    initSingleShotTimer( &m_timerUpdate, 10, this, SLOT(doUpdateCurrentPage()) );
    initSingleShotTimer( &m_timerFilter, 10, this, SLOT(filterItems()) );
    initSingleShotTimer( &m_timerExpire, 0, this, SLOT(expire()) );

    // ScrollPerItem doesn't work well with hidden items
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

    connect( verticalScrollBar(), SIGNAL(valueChanged(int)),
             SLOT(updateCurrentPage()) );

    setAttribute(Qt::WA_MacShowFocusRect, 0);

    setAcceptDrops(true);

    connectModelAndDelegate();
}
Beispiel #23
0
int QwtDial::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QwtAbstractSlider::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = hasVisibleBackground(); break;
        case 1: *reinterpret_cast< int*>(_v) = lineWidth(); break;
        case 2: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break;
        case 3: *reinterpret_cast< Mode*>(_v) = mode(); break;
        case 4: *reinterpret_cast< double*>(_v) = origin(); break;
        case 5: *reinterpret_cast< bool*>(_v) = wrapping(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: showBackground(*reinterpret_cast< bool*>(_v)); break;
        case 1: setLineWidth(*reinterpret_cast< int*>(_v)); break;
        case 2: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break;
        case 3: setMode(*reinterpret_cast< Mode*>(_v)); break;
        case 4: setOrigin(*reinterpret_cast< double*>(_v)); break;
        case 5: setWrapping(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #24
0
InlineView::InlineView(QWidget* parent) : QListWidget(parent)
{
	setDragEnabled(true);
	setViewMode(QListView::IconMode);
	setFlow(QListView::LeftToRight);
	setSortingEnabled(true);
	setWrapping(true);
	setAcceptDrops(true);
	setDropIndicatorShown(true);
	setDragDropMode(QAbstractItemView::DragDrop);
	setResizeMode(QListView::Adjust);
	setSelectionMode(QAbstractItemView::SingleSelection);
	setContextMenuPolicy(Qt::CustomContextMenu);
	delegate = new ScListWidgetDelegate(this, this);
	delegate->setIconOnly(true);
	setItemDelegate(delegate);
	setIconSize(QSize(50, 50));
}
SymbolView::SymbolView(QWidget* parent) : QListWidget(parent)
{
	setDragEnabled(true);
	setViewMode(QListView::IconMode);
	setFlow(QListView::LeftToRight);
	setSortingEnabled(true);
	setWrapping(true);
	setAcceptDrops(true);
	setDropIndicatorShown(true);
	setDragDropMode(QAbstractItemView::DragDrop);
	setResizeMode(QListView::Adjust);
	setSelectionMode(QAbstractItemView::SingleSelection);
	setContextMenuPolicy(Qt::CustomContextMenu);
	delegate = new ScListWidgetDelegate(this, this);
	setItemDelegate(delegate);
	setIconSize(QSize(48, 48));
	connect(this, SIGNAL(customContextMenuRequested (const QPoint &)), this, SLOT(HandleContextMenu(QPoint)));
}
Beispiel #26
0
/******************************************************************************
 * Construct a wrapping 00:00 - 23:59, or 12:00 - 11:59 time spin box.
 */
TimeSpinBox::TimeSpinBox(bool use24hour, QWidget* parent, const char* name)
    : SpinBox2(0, 1439, 1, 60, parent, name),
      mMinimumValue(0),
      m12Hour(!use24hour),
      mPm(false),
      mInvalid(false),
      mEnteredSetValue(false)
{
    mValidator = new TimeValidator(0, 1439, this, "TimeSpinBox validator");
    mValidator->m12Hour = m12Hour;
    setValidator(mValidator);
    setWrapping(true);
    setReverseWithLayout(false);   // keep buttons the same way round even if right-to-left language
    setShiftSteps(5, 360);    // shift-left button increments 5 min / 6 hours
    setSelectOnStep(false);
    setAlignment(Qt::AlignHCenter);
    connect(this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
}
Beispiel #27
0
PageLayoutsWidget::PageLayoutsWidget(QWidget* parent) : QListWidget(parent)
{
	setDragEnabled(false);
	setViewMode(QListView::IconMode);
	setFlow(QListView::LeftToRight);
	setSortingEnabled(false);
	setWrapping(false);
	setWordWrap(true);
	setAcceptDrops(false);
	setDropIndicatorShown(false);
	setDragDropMode(QAbstractItemView::NoDragDrop);
	setResizeMode(QListView::Adjust);
	setSelectionMode(QAbstractItemView::SingleSelection);
	setFocusPolicy(Qt::NoFocus);
	setIconSize(QSize(32, 32));
	clear();
	setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
}
Beispiel #28
0
int QDial::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractSlider::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 5)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 5;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = wrapping(); break;
        case 1: *reinterpret_cast< int*>(_v) = notchSize(); break;
        case 2: *reinterpret_cast< qreal*>(_v) = notchTarget(); break;
        case 3: *reinterpret_cast< bool*>(_v) = notchesVisible(); break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setWrapping(*reinterpret_cast< bool*>(_v)); break;
        case 2: setNotchTarget(*reinterpret_cast< qreal*>(_v)); break;
        case 3: setNotchesVisible(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 4;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #29
0
void OptionListWidget::arrangeIcons()
{
	int maxWidth = 0;
	setWrapping(false);
	QListWidgetItem* ic;
	int startY = 5;
	for (int cc = 0; cc < count(); ++cc)
	{
		ic = item(cc);
		QRect ir = visualItemRect(ic);
		maxWidth = qMax(ir.width(), maxWidth);
	}
	setMaximumWidth(maxWidth+16);
	setResizeMode(QListView::Fixed);
#ifdef _WIN32
	int scrollBarWidth = 0;
	QList<QScrollBar*> scrollBars = findChildren<QScrollBar*>();
	for (int cc = 0; cc < scrollBars.count(); ++cc)
	{
		if (scrollBars.at(cc)->orientation() == Qt::Vertical)
		{
			scrollBarWidth = scrollBars.at(cc)->height();
			break;
		}
	}
#else
	int scrollBarWidth = maxWidth;
#endif
	int startX = qMax((viewport()->width() - scrollBarWidth) / 2, 0);
	for (int cc = 0; cc < count(); ++cc)
	{
		ic = item(cc);
		QRect ir = visualItemRect(ic);
		
#ifdef _WIN32
		setPositionForIndex(QPoint(qMax(startX - ir.width() / 2, 0), startY), indexFromItem(ic));
#else
		int moveW = (maxWidth - ir.width()) / 2;
		setPositionForIndex(QPoint(moveW + startX, startY), indexFromItem(ic));
#endif
		
		startY += ir.height()+5;
	}
}
SpeedoMeter::SpeedoMeter(QWidget *parent):
    QwtDial(parent),
    d_label("km/h")
{
    setWrapping(false);
    setReadOnly(true);

    setOrigin(135.0);
    setScaleArc(0.0, 270.0);
    scaleDraw()->setSpacing(8);

    QwtDialSimpleNeedle *needle = new QwtDialSimpleNeedle(
            QwtDialSimpleNeedle::Arrow, true, Qt::red, 
            QColor(Qt::gray).light(130));
    setNeedle(needle);

    setScaleOptions(ScaleTicks | ScaleLabel);
    setScaleTicks(0, 4, 8);
}